How does musescore decide staff name when importing MIDI?
Hello! I'm trying to work on a project that requires reading in MIDI tracks that are labeled with their instruments. With the library I'm using in Python (music21), it claims many of my tracks have no instrument number, though I notice that musescore is still able to properly assign them to the correct instruments. I've noticed that even for the tracks missing instrument codes, musescore still is able to map them to proper instruments (mostly noticed with drums and electric guitar so far). Of interest to me in particular is the staff name being correct, since this contains the exact info I need.
Could someone elaborate where in the MIDI file musescore finds what is uses for staff name?
Comments
I believe what happens is it uses the program number (ie, the sound) selected and matches that against our own internal list of instruments to find the name of an instrument using that sound. Something like that, anyhow.