[MusicXML] Import can produce empty voice 1

• Sep 7, 2011 - 09:55
S4 - Minor

MuseScore 1.1, current branch and trunk r4754

Finale produces MusicXML file with no voice 1 in some measures. When importing such a file, MuseScore ends up with no voice 1 in these measures. As MuseScore assume voice 1 is always present, it could lead to different problems.

See measure 7 to 9 in the attached file.

Attachment Size
Salva_me_da_Tanta_Infamia.xml 68.89 KB


A few questions, as I'd like to fully understand the issue.

- what is the expected behavior (filling voice 1 with rests if not present in the MusicXML file ?)
- what kind of issues are caused by the current implementation (I can't find any) ?
- where is this constraint documented (source code or documentation) and enforced (source code) ?

Found the answer to my third question in edit.cpp function Score::deleteItem(), which contains the remark: " voice 0 rests cannot be removed".

Initial fix in 0.9.6 in revision 5096 (fill voice 0 with rests in case the MusicXML import left gaps).

Sorry I missed your questions in this thread.
So regarding number 3, rests can't be deleted from voice 0 in the user interface. If you exchange a voice that doesn't have all beats filled with voice 0, the rests are recreated. So the code about exchangeVoice is also a place to look at.

Expected behavior : I would say put rests like you did, but make them invisible.

Issue encountered : For example, you can't edit a voice with missing rests except if you exchange voices twice.