[MusicXML import (DOM and PULL parsers)] Wrong import of InstrumentChange elements

• Jun 17, 2015 - 17:56
Type
Functional
Severity
S4 - Minor
Status
active
Regression
No
Workaround
No
Project
Tags

LUbuntu 15.04, commit bf8dc84.

Steps to reproduce:

  1. Comment the line "define PULL_PARSER true" in importxml.cpp to switch to the DOM parser.
  2. Create a new score with two instruments: Piano and Harpsichord.
  3. Put a few notes in order to check the sound later.
  4. Add InstrumentChange (Classical Guitar) to the first part, put a few notes.
  5. Add InstrumentChange (Voice) to the second part, put a few notes.
  6. Export file to MusicXML format (*.xml).
  7. Import file to MuseScore.

Expected behaviour: notes sound as they should, we have 2 parts with 2 InstrumentChange elements, 4 entries in Mixer.
Actual behaviour: notes sound not as they should, we have 2 parts with 6 InstrumentChange elements, total 8 entries in Mixer (some instruments duplicated).

Import log:

ChordList::read failed:
importMusicXml(0x8e10970, /home/xxx/Documents/MuseScoreDevelopment/Scores/test.xml)
Validation time elapsed: 125 ms
importMusicXml() file '/home/xxx/Documents/MuseScoreDevelopment/Scores/test.xml' is a valid MusicXML file
MusicXmlInstrList::setInstrument instr '', tick 0/1 (0): element already exists
MusicXmlInstrList::setInstrument instr '', tick 2/1 (3840): element already exists
ImportXml: warning: break on first measure
xmlPart: changed instrument '' at tick 3840 not found in part 'P1'
xmlPart: changed instrument '' at tick 9600 not found in part 'P1'
xmlPart: changed instrument '' at tick 14400 not found in part 'P1'
ImportXml: warning: break on first measure
xmlPart: changed instrument '' at tick 1920 not found in part 'P2'
xmlPart: changed instrument '' at tick 5760 not found in part 'P2'
xmlPart: changed instrument '' at tick 9600 not found in part 'P2'
xmlPart: changed instrument '' at tick 11520 not found in part 'P2'
Parsing time elapsed: 6 ms
importMusicXml() return 0

I know that MusicXML doesn't support InstrumentChange elements, but import/export works for simple scores: for example, for a score with one part with one instrument change.
Exported MusicXML file looks correct, so I think it's import problem.

Attachment Size
test.xml 19.23 KB
test.mscx 18.33 KB
mixer_mscx.png 48.44 KB
mixer_imported_musicXML.png 93.26 KB

Comments

Title [MusicXML import (DOM parser)] Wrong import of InstrumentChange elements [MusicXML import (DOM and PULL parsers)] Wrong import of InstrumentChange elements

The same bug in the PULL parser: wrong number of entries in the Mixer, wrong sound.