w3c / musicxml

MusicXML specification
479 stars 56 forks source link

Clarify duration in <rest measure="yes"> #478

Open mscuthbert opened 1 year ago

mscuthbert commented 1 year ago

Clarify the meaning of the measure="yes" attribute in MusicXML.

Different clients had been interpreting it differently.

music21 at present is interpreting it to mean that it implies a full measure of rest in the current time signature to be displayed as a whole rest, and was ignoring the duration and type. A one-beat pickup rest in 4/4 would not use measure="yes".

Finale 27 seems to be using it to indicate that the rest lasts an entire measure, with no other implication unless <type> is omitted, in which case it is to be read as a whole rest. The <duration> is controlling, not the TimeSignature.

MuseScore 4 takes a middle road. It reads Finale exported files as Finale expects them, but does not mark a rest as measure="yes" if the <duration> does not add up to that which is expected by the time signature.

I welcome updates from developers/users of other clients. If no other input is given, I will clarify the docs in favor of MuseScore's interpretation, make a note that some clients choose to do Finale's version, and warn against the music21 interpretation.

mdgood commented 1 year ago

I am not quite sure what needs to be clarified. As the documentation states, if the measure attribute is yes, "this indicates this is a complete measure rest." Time signature is not mentioned as it is not relevant.

The omission of the <type> element is only significant in Finale in order to maintain compatibility with pre-3.0 versions of MusicXML that did not include a measure attribute in the <rest> element. Omitting the <type> element was the workaround we used to distinguish between Finale measure rests and non-measure rests.

mscuthbert commented 1 year ago

I am not quite sure what needs to be clarified. As the documentation states, if the measure attribute is yes, "this indicates this is a complete measure rest." Time signature is not mentioned as it is not relevant.

If I'm told "here's the beat; play a note that lasts for a full measure" then the time signature seems very relevant to me. If the time signature is not relevant to what "one measure of rest" means, that seems significant enough to mention.

This seems particularly important for pickup measure with "measure='yes'" where "rest fror a full measure" is very different from "rest for the duration indicated with the <duration> and <type> attributes, and by the way, that adds up to a full measure". The former indicates that type and duration can be ignored. The latter indicates that type and duration of this element indicate the effective time signature for the pickup bar.

Whenever there are three conflicting interpretations of a spec, it seems a good opportunity to clarify the spec.

mscuthbert commented 1 year ago

I'm also not clear how the spec intersects with <supports> if we're in divisions=1 and there is a <rest measure="yes"><duration>3</duration><type>whole</type> does this indicate a dotted-half rest that is to be displayed as a whole rest? Does that measure="yes" indicate that the rest is to be centered in the space? And how does all this information collapse if any one of the three of measure, <duration>, or <type> are omitted? (and does this change if we're in 3/4 in general, or in 4/4 with a 3/4 pickup measure?)