Transpose Key - detection

• Jan 27, 2012 - 15:58

Hello,

I want to transpose a large number of midi files to C major/A minor key.

I don't know their current key.

I already figured out that I will have to do it manually, by notes->transpose.

But I wonder: how is the current key detected? And how accurate is this? I presume on which notes are used most, or key signature?

Thanks for the insight!


Comments

In reply to by dorien

I've never used this on a score import from MIDI, and I have no idea how MIDI represents key signature or how that maps to key signatures in MuseScore. But for scores created in MuseScore, it's definitely the current key signature of the selection that forms the basis for the transposition by key signature. I have no idea what happens if the selection encompasses multiple key signatures, but I image you test will reveal that. I'd be afraid to rely on this, though, and would instead suggest transposition by interval if you need to that.

In reply to by Marc Sabatella

Key signatures in a SMF are stored as a MIDI Meta event :

Key Signature
This meta event is used to specify the key (number of sharps or flats) and scale (major or minor) of a sequence. A positive value for the key specifies the number of sharps and a negative value specifies the number of flats. A value of 0 for the scale specifies a major key and a value of 1 specifies a minor key.

Not all MIDI files will have this information.

There have been other comments in the forum which suggests that MuseScore does not read the key signature when importing MIDI files

If you are interested you can find a detailed specification of the SMF here:

http://www.sonicspot.com/guide/midifiles.html

It does seem to transpose based on the key signature of the first instrument.

I ran into anther problem. I want to save the transposed score as a midi file. However, save/save as mid, always saves the original score...

Any ideas?

In reply to by dorien

I have now had occasion to want to transpose a piece that had key signature changes within it. I can verofy that using the transpose by semitone (as opposed to by key), and checking the option to transpose key signatures, works as expected. All notes are transposed properly, as are all key signatures.

Do you still have an unanswered question? Please log in first to post your question.