Key signature import/export and accidental spelling in midi
I am using midi output from MuseScore in another application and want to see if I understand some things correctly. I have tried to look through the code, and base part of this on that, but ... there's a lot of code, so hoping someone just knows for sure.
On import of a Midi song, I THINK the score determines key signature heuristically, but looking at notes, and not from the key signature (if any) inside the Midi. I ran across a piece (Flight of the Bumble Bee I downloaded from 8notes) that explicitly has F-Major in the midi data, but imports in A-Major, and exports in A-Major from MuseScore.
On export of a midi file, it looks like the actual key signature is written as midi data.
For export of explicitly coded accidentals, it looks like MuseScore does not use the convention for encoding spelling in the low order bits of velocity. That this was ever done was news to me, but I ran across it in the MidiFile program (in craigsapp on git) which referred to a book here, see page 100. I've confirmed experimentally it does not honor that encoding, I think my question is more whether this sort of encoding was ever mainstream?
My goal in the longer term is to take MuseScore exports of PDF's and exports of Midi, and use them in a separate application, so not trying to change what MuseScore does so much as make sure I understand it.