In MusicXML, a clef with no number is for staff 1, not for all staves in a part#1905
Conversation
…. Looked it up, and this applies also to staff-layout and staff-details.
|
I thought I had a good example MusicXML file, but I was wrong. I made this fix locally several months ago, and am having trouble remembering exactly what files prompted it; I do remember realizing that there were quite a few files with this issue (non-numbered clefs in multi-staff parts) out in the wild, and I tested against Finale and Musescore, who both parsed them correctly (putting the non-numbered clef in staff 1 of a multi-staff part), where music21 was incorrectly putting the clef in both staves of a multi-staff part. I am scanning all my test files to find examples of non-numbered clefs in multi-staff parts. |
|
Ah, I see. It is music21's MusicXML writer that is writing non-numbered clefs in multi-staff parts. I attach two MusicXML files, one (with clefs numbered) that was read by music21, and the other (some clefs not numbered) that was subsequently written by music21. The written MusicXML file, when read again by music21 (without this PR), ends up with the clef change incorrectly happening in both piano staves, instead of just in the right hand staff. I attach both MusicXML files, as well as PDFs of both as rendered by music21, with the extra inserted clefs called out (in red, with text notation) by musicdiff. BrahWiMeSample.musicxml.txt |
Looked it up, and this applies also to staff-layout and staff-details.