w3c / musicxml

MusicXML specification
479 stars 56 forks source link

Document `<bar-style>` default value #467

Closed cecilios closed 1 year ago

cecilios commented 1 year ago

In a <barline> element, <bar-style> is optional. But I've not found neither in the new documentation nor in the DTD the default value when <bar-style> is not present. I always assumed "regular" but I would appreciate confirmation. Thank you.

cecilios commented 1 year ago

Uhm! Not so clear that "regular" is the default value. I'm starting to think that:

mdgood commented 1 year ago

@cecilios The <barline> element documentation states, "If a barline is other than a normal single barline, it should be represented by a <barline> element that describes it." I think that makes it clear that barlines indeed have a regular style if not specified. Is there specific wording that could clarify this?

XSD schemas make it difficult to specify that a child element is required for a specific attribute value. I think our documentation has the practical effect of making <bar-style> mandatory for mid-measure barlines, though we cannot validate for this.

cecilios commented 1 year ago

Thank you @mdgood. Yes, documentation suggests that regular barline should be assumed, but in practice this assumption is not supported by an analysis of MusicXML samples. For instance, from Saltarello sample, measure 7:

      </note>
    </measure>
    <!--=======================================================-->
    <measure number="7" width="183">
      <barline location="left">
        <ending default-y="40" end-length="20" number="1" type="start"/>
      </barline>
      <note default-x="17">

Right barline is an implicit barline and the left barlines dont' have style, so it must be assumed that both are 'regular. Therefore, this example should be displayed as a doble barline ('light-light') or, if no space left between both barlines, it will be displayed as a double thickness light barline. So, either, the default value for any of them is 'none' or some overlapping/combination rules are defined but not documented, which I guess is the case.

Look now at measure 9:

      <barline location="right">
        <bar-style>light-heavy</bar-style>
        <ending number="1" type="stop"/>
        <repeat direction="backward" winged="none"/>
      </barline>
    </measure>
    <!--=======================================================-->
    <measure number="9" width="267">
      <print new-system="yes"/>
      <barline location="left">
        <ending default-y="40" end-length="20" number="2" type="start"/>
      </barline>

Again, if we assume default value for left barline, regular, rendering both barlines would result in a light-heavy-light baline.

Perhaps what needs to be documented is how the right bar style and the next left bar styles have to be combined for visual rendition and what are the valid combinations for generating MusicXML. In current MozartTrio sample, the doble repetition barline is encoded as:

      <barline location="right">
        <bar-style>heavy-heavy</bar-style>
        <repeat direction="backward" winged="none"/>
      </barline>
    </measure>
    <!--=======================================================-->
    <measure implicit="yes" number="X1" width="71">
      <barline location="left">
        <repeat direction="forward" winged="none"/>
      </barline>

Again, assuming 'regular' for left barline will display 'heavy-heavy-light'. So again left barline style is none, or there is missing documentation about combinations. And, taking about combinations, why not to encode both barlines in this example as "heavy" (assuming space between barlines is allowed) ?

In a previous version of this sample, this barline was encoded as:

      <barline location="right">
        <bar-style>light-heavy</bar-style>
        <repeat direction="backward" winged="none"/>
      </barline>
    </measure>
    <!--=======================================================-->
    <measure implicit="yes" number="X1" width="71">
      <print new-system="no"/>
      <barline location="left">
        <bar-style>heavy-light</bar-style>
        <repeat direction="forward" winged="none"/>
      </barline>

That again would be rendered as 'light-heavy-heavy-light', or if no space between them, as light-double heavy-light'.

My conclusion is that documentation about barline styles, valid combinations and resulting glyphs should be improved.

Nevertheless, you can close this issue at your convenience. I have have deduced from different MusicXML samples a set of empirical rules that seems to work.

mdgood commented 1 year ago

Back-to-back repeat barlines are indeed under-specified, as described in #104. Since that appears to be the main issue remaining in this discussion, I will plan to close this one soon.