w3c / musicxml

MusicXML specification
479 stars 56 forks source link

Add example of "pp subito" to official examples #509

Open mscuthbert opened 1 month ago

mscuthbert commented 1 month ago

From @mdgood 's comment at #504 -- proper encoding is:

<direction placement="below">
    <direction-type>
        <dynamics>
            <pp/>
        </dynamics>
    </direction-type>
    <direction-type>
        <words font-style="italic"> subito</words>
    </direction-type>
    <sound dynamics="36"/>
</direction>
lemzwerg commented 1 month ago

Hmm, shouldn't this be rather

<words xml:space="yes" font-style="italic"> subito</words>

since the default of the xml:space attribute is 'no'?

mdgood commented 1 month ago

No, that would be invalid XML. The allowed values for xml:space are "default" and "preserve" and the attribute does not have a value if unspecified. One could add the xml:space="preserve" attribute.

lemzwerg commented 1 month ago

Ah, my mistake, sorry. I've meant preserve.

But wouldn't your change from subito to subito have no effect if xml:space weren't set to preserve?

lemzwerg commented 1 month ago

Or maybe even better: Explain in the documentation that whitespace between <words> and non-<words> elements is implementation-defined. While I'm not a friend of 'implementation-defined' stuff in a specification in general I don't see a good solution to this particular conundrum, because a dynamics 'p' is certainly not a normal text object – this makes it nearly impossible to define clean rules for interaction with text. For example, a <p/> glyph might provide much more horizontal padding around it to (a) avoid collisions with other objects, and (b) to attach words like 'subito' directly, not needing to take spacing into account.

lemzwerg commented 1 month ago

Please forget my remarks. I misunderstood what xml:space="preserve" does. Sorry for the noise.