I'm jotting this stuff down now in the hope that I will eventually make some real documentation out of it, and probably hack on Rosegarden some too. These are just random notes at the moment.

I've been trying to use Rosegarden for a fairly serious notation project, making a score for “Romanza,” a piece I'm trying to learn on classical guitar. Rosegarden is no MuseScore, but I'm lazy, and don't want to learn a new application. Instead, I'm pounding the hell out of Rosegarden to extract every bit of real functionality out of it I can manage.

I started with a MIDI import of the piece that includes a pile of 8th note triplets in 3/4 time. Rosegarden is having funky problems with this.

Step 1 was to split out the voices. This particular piece in this particular MIDI rendition lines up well enough as chords that it's functional as imported, but it's not written correctly. The bass line consists of dotted half notes, the accompaniment is a line of triplet 8th notes sounding arpeggiated chords, and the melody is quarter notes up on top.

I discovered a handy trick using the new linked segments feature that I can scarcely remember how to use.

The neat thing about that is you can edit the voices individually, and even solo them, but you can also display everything (and export it) on one staff with no extra faffing about. That's pretty sweet, and this trick is basically what prompted me to write something here on the wiki. It's kind of awkward, but I'm a firm believer in “not impossible” being an adequate standard, because making things easy for the user is very hard for developers!

First the bass notes. I ended up selecting all the notation-duration 8th notes that were really dotted half notes by modifying the selection event filter to allow me to select on performance duration. That let me get the longer sounding notes selected. Then I inverted the selection by picking “exclude” from the duration controls, and ended up with all the shorter notes selected instead, which I erased from the bass segment.

This left me with a bunch of 8th notes, I think it was. I tried to turn them into dotted half notes with Ctrl+2 and they did actually become dotted half notes, but with quarter rests left in the measure! Setting them to the correct duration resulted in them being displayed as whole notes. That's no good. I know there's some debate as to whether a whole note means four beats or a whole measure, and apparently that's what's at play here. I dislike this, but didn't figure out where this is hiding after a quick hunt to go throw a toggle in (“Whole note equals [four beats|whole measure]”), so I decided to go with the short dotted half notes, and hide the rests instead. I added the ability to use the selection event filter to filter on rests instead of notes, so I could get them all selected and Make Invisible on them at once. (The interface for that quick hack needs a lot more thought.)

I couldn't find an efficient way to select just the longer notes after my modifications to the event filter, so I may have broken it. There aren't so many of them, so I just picked them off with the eraser. I left the melody notes in the middle voice, since removing them would yield a bunch of 8th rests where those notes were, and it's quite obvious reading the part what's going on.

I couldn't find an efficient way to select just the top notes in the melody voice, to split them off. I tried split on pitch with various options, and none of them came anywhere close to having the desired effect.

NOTE: Split on pitch would be a lot more useful if it used the same clef and transposition as the part you're working with. Guitar is a transposing 8vb clef, so you go to pick the E you want to split on, and it's an octave too high. I know the pitch picker widget uses clefs for its own purposes, and it may be the most recycled widget in all of Rosegarden, so it's imperative not to break any of that. I'm thinking perhaps a second pitch picker showing sounding pitch for the part. One of the left is concert pitch, one on the right is adjusted relative to segment transpose, user can manipulate either one of them, and the result it spits out is concert pitch.

I ended up pulling the middle notes out of the melody segment with a big manual sweep selection that I had to shift+click edit a few times. It wasn't too bad, but it would be nice if the event filter could be used for useful real world things like that. It did, after all, get patterned after Cakewalk from years ago at a time when I had scarcely gotten my head around Rosegarden. It was the first thing I wrote, I think, and it isn't very good, but it's such a bitch to totally write something better from scratch that I've never gotten around to it. Maybe I can think up enough good use cases and make it happen for some 2014 version of Rosegarden.

Once I had the melody isolated, I tried to turn all the triplet 8th notes into quarter notes with Ctrl+4. They all became dotted quarter notes! (It's worth noting that no 3 show up in the interface anywhere, but the events have duration 320, so they are triplet 8th notes. This file seems to have confused Rosegarden mightily. It's basically a piece in 9/8 that everybody writes in 3/4 with a solid wall of triplets for some reason. I thought to just put the piece in 9/8, but that didn't work out either.

Anyway, to get the quarter notes to come out right, I had to go into the matrix. You apparently can't do an arbitrary set-duration-to-n from the notation editor, I don't think.

Went back to check that and saw that when I open the corrected segment in notation, the quarter notes are coming out with dots again. Why the hell? Their duration is precisely 960 in 3/4 time.

That is obviously some kind of bug, and I should see if I can fix it. Not displaying the triplet numbers is also a bug, I'm sure.

The LilyPond export comes out massively boogered up by all these freaked out notes. Short of finding and fixing Rosegarden's bugs, it looks like the only way to clean this up is to edit the raw XML by hand to fix some things.

I haven't edited the B part of this yet at all, so having learned from the first iteration, I think I'll see what I can do in the way of fixing bugs before I resort to hacking the XML by hand.

Maybe I'll come back and do all of this in one of my HTML tutorials, or maybe I'll do it on the wiki, or most likely I won't do any of it at all. I have so little free time these days. I've already blown out most of my time for today without actually getting to enjoy playing the damn guitar that I'm trying to write this score for.

TRICK The triplet-based MIDI file imported with funky properties on the notes, making them all triplets and yet not triplets. The way to clean up the melody (all quarter notes) and the bass (all dotted half notes) is to Select All → Phrase → Un-tuplet, then Select All and Ctrl+4 or Ctrl+2 Ctrl+. as appropriate. This takes care of that problem without hand hacking XML.

The greater issue is that Rosegarden apparently mangles the import of triplets from MIDI, and doubtless while recording also. Worth investigating, I suppose, although there are 5,001 different kinds of weird tuplets in the real world, like 17 in the time of 64, and the most we could ever hope for is to handle triplets correctly. Even then, it would only be machine-generated triplets that were very precise mathematically, and not at all loose and human. It's probably a lost cause even bothering, is what I'm thinking.

NOTE So apparently this problem has come up before, and there's already a way to deal with it from inside Rosegarden. Phrase → Make Tuplet, check the “[x] Timing is already correct; update display only” box.

Good news is this works perfectly for sorting out this mangled mess. Bad news is this function only works on one beam group at a time. Select 100 of them, apply, 99 to go. It looks like there is no way to avoid having to go into this dialog and set everything back up for every bloody triplet group. This would be a particularly obnoxious thing to hack into the XML manually, however, because every tuplet group needs an ID and so on and so forth. It would take me about as long to do all that as it would to jerk off the GUI 15,000 times. Sooooo… Let's try to make this make tuplet group thing iterative, shall we?

Bah

So TupletCommand is really cheap. It gets a segment and a start time and a list of parameters of what you're trying to make, then it modifies the first n events and bails out. It's not at all aware of selections, and can't be made to work on a selection without some pretty heavy lifting.

Ideally it would take a selection, not a segment, and it would work on groups of n until it ran out of events in the selection. Don't make six triplets in one giant beam group, make a group of three, then another group of three, until you're done.

I could do this, but it's really a tall order to solve a problem nobody else has ever complained about.

I'm just going to suck it up and fix one group at a time. It's only 48 measures.