[MusicXML import] crash if midi-instrument is missing from drum set part

• Apr 11, 2015 - 09:20
S2 - Critical

See #55436: Crash when trying to edit a percussion part from a MusicXML file

File Funk.mxl parts P7 and P8 are unpitched (drum set and tambourine). Typically a set of midi-instruments would be found in each part, but in this case the parts contain a virtual-instrument instead (which does not provide any MIDI information).

The MusicXML importer does not expect this and fails because it does not know the MIDI program numbers for the unpitched notes. The result is calling Note::setPitch() with an invalid pitch (-1).

MusicXML midi-instrument definitions are not required, the specification states: "MusicXML software should be able to automatically assign reasonable channels and instruments without these elements in simple cases, such as where part names match General MIDI instrument names".