Rosegarden

From Arnout Engelen

Jump to: navigation, search

delcocazell

Contents

[edit] Contributions

[edit] musicxml import

I started on preliminary musicxml importing support.

[edit] Pitch spelling

Rosegarden was originally a sequencer. Since then music notation capabilities have been added, making it one of the best music notation packages currently available on Linux, but everything is still internally based on MIDI-like events rather than a more notation-oriented representation.

In Rosegarden, a Pitch is represented by the number of semitones from the lowest 'c', plus an *optional* accidental. When deciding what note to show, Rosegarden tries to use the specified accidental, or otherwise makes a guess.

This guessing code used to be quite primitive ('use sharps when there are sharps on the current key signature, flats otherwise'), causing accidentals to 'flip around' when a segment (including key) was transposed.

I replaced this with a context-sensitive algorithm guessing the most likely accidental based on the current key used, which fixes the problem with accidentals 'flipping around'. More specifically, it counts the number of steps on the circle of fifths must be taken to reach a key that contains a spelling for the pitch. The spelling which takes the lowest number of steps on the circle of fifths is chosen.

There are some more sophisticated pitch spelling algorithms out there, but they are much more involved (and thus less predictable), by taking into account not only the current key, but also other notes near the one which is to be spelled.

[edit] Transposition

Rosegarden's transposition used to be rather primitive, simply moving notes up and down by a specified number of semitones, keeping the accidental constant as much as possible.

I implemented 'Transpose by Interval' functionality that implements transposition in a more sane way, seen from a music theory standpoint.

I also built an easier way to switch between transpositions from the Notation view. There's still a couple of bugs ([1], [2]) open before I consider that finished and move forward to improve musicxml import further and get that merged to trunk.

[edit] Unit testing

The accidental guessing and transposition code I wrote is tricky to get right, and it's hard to keep track of all the corner cases. Rosegarden so far had no regression testing, so I decided to take a shot at that.

Rosegarden is built with [CMake], which has some support for testing. I leveraged that to create some unit-test-like tests that are nicely integrated into the general Rosegarden build process, and can be run with 'make test'.

[edit] Misc other thoughts

[edit] Things I missed

  • importing mp3 audio tracks, not only wav (though mpg123 -w is not hard to type :) )
  • the 'timing' popup should link to more info
  • Might be useful to somehow communicate the song position to an external program (like Transcribe!). Can MIDI be used for this kind of stuff?

[edit] Auto-aligning with audio track

Would be nice to be able to auto-align an audio track.

Maybe simply by a seperate app that takes a waveform and yields a rosegarden file with the waveform as its only track and the tempo settings set.

[edit] Notation

[edit] Merging

Viewing all blocks of a track as one piece of sheet music

[edit] Transposition

When transposing changing the keys, we must do something smart with the accidentals.

Example: piece in C# major contains a C#. Transposing this, including key, to C (0 steps, -1 semitones) should yield a C.

Right now: it transposes the C# to C. However, C does not exist in the key of C# major, so the note becomes B# (!?). Then the key is changed from C# major to C major, but this does not affect keys.

New situation: Change keys while walking though the segment changing the notes. The invariant is not the accidental (a B in C major becomes a F# in G major), but the amount of correction from the not in key (B in C major is in-key (distance 0), In G major, F# is in-key. Similarly, Bb in C-major is distance -1, so in G-major this should become a F (distance -1 from the in-key F#).

So the method here becomes:

  • get the correction from the in-key note in the old key
  • transpose step and pitch
  • choose the accidental to use based on the correction and the 'native' accidental for step/pitch in the new key

This is different from what happens when transposing within a key.

[edit] braindump

There has been some talk about transposition on the rosegarden-devel lists: http://thread.gmane.org/gmane.comp.audio.rosegarden.devel/1923

My personal use-case: I use Rosegarden to arrange the horn parts of our band, which consists of 2 alto saxes (in Eb) and 1 tenor (in Bb).

When making the arrangement, I generally do that in C. This is useful because then I don't have to transpose in 'in my head' to see how a chord is distributed over the various instruments.

Suppose then I'd like to see what this looks like for the tenor sax player, for instance to see if I wrote anything outside of his range: right now I generally export to lilypond, add \transpose, lilypond and evince, but for obvious reasons that's not very convenient.

How rosegarden could help me here: maybe an easy way to transpose the notes in all segments of a track, and at the same time change the 'transposition' of the segment in the other direction, so the sound remains the same. Preferably some kind of visible indicator that i'm now looking at the representation "in Bb".

Sometimes one 'track' is not restricted to one instrument: for ensembles it's not uncommon that for example 'voice 4' is filled in by either a tenor sax in Bb or a trombone in C. It'd be nice if it was simple to switch between C/Bb 'views' of a track easily.

Personal tools