You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MusicXML import drops piano-family MIDI programs when the instrument name isn't recognized #2084
When a part's <midi-program> is one music21 maps to Piano (MusicXML programs 1–6), the importer replaces that instrument with the one made from <instrument-name>. That makes sense when the name is recognized, since exporters often write piano as a default program. But when the name isn't recognized, the replacement is a plain Instrument with no midiProgram, so the program is lost. Other programs are kept.
The replacement is in MeasureParser's score-part handling (musicxml/xmlToM21.py):
# 2. midiProgram is Piano (often this is encoded only as piano for convenience)ifinst_from_name.midiProgram==i.midiProgramorisinstance(i, instrument.Piano):
i=inst_from_name
This isn't asking to remove the piano rule, only to not lose the program when the name doesn't give an instrument, for example by only replacing when the name was recognized, or by keeping i.midiProgram on the replacement.
Activity