Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to code a system's left-margin labels #277

Open
notator opened this issue Dec 13, 2021 · 4 comments
Open

How to code a system's left-margin labels #277

notator opened this issue Dec 13, 2021 · 4 comments

Comments

@notator
Copy link
Contributor

notator commented Dec 13, 2021

This proposal

  • takes Specify system bracket ordering #276 into account, and should also help to resolve Reusable layouts below system #269.
    Note that the <group-layout> element is no longer recursive here, but the <group-label> element is. See the Thoughts about Recursion below.
  • separates left-margin labels (the labels and brackets to the left of a system), from the <part>-related content of the system's staves. The <part> element can't know how it is going to be combined on a staff with other <part>s, so can't know exactly how it is going to be labelled.
  • encloses the left-margin labels in a <labels> element, inside <system-layout>, following the <staff-layout> and <group-layout> definitions.
  • uses system staff indices, in a way that is similar to <part>s local use of staff index.
  • makes <part>'s name and short-name attributes redundant. They should be deleted.
  • makes the existing label, labelref and symbol attributes on <group-layout> and <staff-layout> redundant. These attributes should be deleted.
  • means that <group-layout> no longer needs to be recursive.
    <group-layout>'s <group-layout> content should therefore be deleted.

As a reminder of how to code a grand staff, see @clnoel's #185 (comment) (point 5).

Thoughts about Recursion

Simple recursion is possible in XML schemas (See
https://stackoverflow.com/questions/148988/recursion-in-an-xml-schema).

Edit: Forward declarations are allowed in XML schema, so the workaround below is probably not necessary:

Forward reference to named definitions and declarations is allowed, both within and between schema documents. By the time the component corresponding to an XML representation which contains a forward reference is actually needed for validation an appropriately-named component may have become available to discharge the reference.

If the following two-level recursion is a problem

<group-label>
    <group-symbol>
        <group-label>

we could simply create two new elements (<group-label2> and <group-symbol2>), and limit the nesting to two levels:

<group-label2>
    <group-symbol2>
        <group-label>
            <group-symbol>

This would only affect Example 4 below.

If thought necessary, three levels could also be implemented in this way.


Definitions of Proposed New Elements

The code in the rest of this proposal assumes the following new elements:

  • two low-level helper elements for creating multi-line text blocks.
    (We've discussed this before, but don't seem to have come to any conclusion. I've adopted this solution here as a temporary measure. These details could be changed later.):

    • <string>:
      • Attribute text (a String): defines a string of text that will be rendered in a single line.
      • Content: none
    • <text-block>:
      • Attibutes: none
      • Content: one or more <string> elements that define the lines of a multi-line text block.
  • three new grouping symbol elements (bracket types):
    The use of "symbol" in these names is consistent with current usage in the docs (and MusicXML), but I think its confusing. I'd rather call these <group-bracket>, <staff-bracket> and <staff-bracket2>.

    • <group-symbol>:
      • Attributes type, top-staff and bottom-staff.
      • Content: a mixed list of one or more <staff-label> and/or <group-label> elements
        N.B. two-level recursion: <group-label> contains <group-symbol>.
    • <staff-symbol>:
      • Attributes type, top-staff and bottom-staff.
      • Content: an optional <staff-symbol2> element that will be rendered to its immediate left.
    • <staff-symbol2>:
      • Attributes: type, top-staff and bottom-staff.
      • Content: none

    The type attributes take grouping symbol values.
    The top-staff and bottom-staff attributes are staff indices in the <system-layout>. The top staff has index 1 and the index increments downwards. Staves inside <group-layout> elements count individually.

  • two new label elements

    • <group-label>

      • Attributes:
        • column-align -- optional attribute having possible values left|center|right. Default: center
          Aligns this <text-block> with respect to the widest <group-label> in the same column in the system label. The right edges of <group-symbol> and <staff-symbol> elements in the same column are always aligned.
      • Content:
        • a <text-block> element
        • a <group-symbol> or <staff-symbol> element.

      The <text-block> is positioned to the left of, and is vertically aligned with the vertical centre of, the contained <group-symbol>.

    • <staff-label>

      • Attributes:
        • staff -- the staff index in the system.
        • column-align -- optional attribute having possible values left|center|right. Default: center
          Aligns this <text-block> with respect to the widest <staff-label> in the same column in the system label. The right edges of <staff-symbol> elements in the same column are always aligned.
      • Content:
        • a <text-block> element.
        • an optional <staff-symbol> element.

      The <text-block> is aligned horizontally with the staff, and immediately to the left of it, separated from the staff only by any <staff-symbol> or <staff-symbol2> element that includes the staff.


Coded example diagrams

Example 1:
4hornsPiano
These are coded in two separate <system-layout>s: "page1SystemLayout" and "defaultSystemLayout".
(In this case, the only difference between the two <system-layout>s is in the outer <string> associated with the upper <group-label>. I think its better to assume that the two layouts might be very different, and not to attempt any optimisation at this point.)

Code
    <layouts>
        <staff-layout id="horns1and2"> // one staff (one voice, could be two note chords on one stem)
            <part-layout part="horn1" /> // the part must be homophonic
            <part-layout part="horn2" /> // the part must be homophonic
        </staff-layout>
        <staff-layout id="horns3and4"> // one staff (one voice, could be two note chords on one stem)
            <part-layout part="horn3" /> // the part must be homophonic
            <part-layout part="horn4" /> // the part must be homophonic.
        </staff-layout>
        <group-layout id="pianoGrandStaff"> // two staves
            <staff-layout part="piano" part-staff="1" />  // the part must contain staves (be polyphonic)
            <staff-layout part="piano" part-staff="2" />
        </group-layout>

        <system-layout id="page1SystemLayout">
            <staff-layout layout="horns1and2" /> // staff 1 in system  
            <staff-layout layout="horns3and4" /> // staff 2 in system
            <group-layout layout="pianoGrandStaff"/> // staves 3 and 4 in system

            <labels>
                <group-label>
                    <text-block>
                        //****************************
                        // page1SystemLayout
                        <string text="4 Horns in F" /> // replaced by "Hn." in the defaultSystemLayout below
                        //****************************
                    </text-block>
                    <group-symbol type="bracket" top-staff="1" bottom-staff="2" >
                        <staff-label staff="1" column-align="center">
                            <text-block>
                                <string text="1, 2" />
                            </text-block>
                        </staff-label>
                        <staff-label staff="2" column-align="center">
                            <text-block>
                                <string text="3, 4" />
                            </text-block>
                        </staff-label>
                    </group-symbol>
                </group-label>
                <group-label>
                    <text-block>
                        <string text="Piano" />
                    </text-block>
                    <staff-symbol type="brace" top-staff="3" bottom-staff="4" />                    
                </label>
            </labels> 
        </system-layout>
        
        <system-layout id="defaultSystemLayout">
            <staff-layout layout="horns1and2" /> // staff 1 in system  
            <staff-layout layout="horns3and4" /> // staff 2 in system
            <group-layout layout="pianoGrandStaff"/> // staves 3 and 4 in system

            <labels>
                <group-label>
                    <text-block>
                        //****************************
                        // defaultSystemLayout
                        <string text="Hn." /> // replaces "4 Horns in F" in the page1SystemLayout
                        //****************************
                    </text-block>
                    <group-symbol type="bracket" top-staff="1" bottom-staff="2" >
                        <staff-label staff="1" column-align="center">
                            <text-block>
                                <string text="1, 2" />
                            </text-block>
                        </staff-label>
                        <staff-label staff="2" column-align="center">
                            <text-block>
                                <string text="3, 4" />
                            </text-block>
                        </staff-label>
                    </group-symbol>
                </group-label>
                <group-label>
                    <text-block>
                        <string text="Piano" />
                    </text-block>
                    <staff-symbol type="brace" top-staff="3" bottom-staff="4" />                    
                </label>
            </labels>
        </system-layout>
    </layouts>

Example 2:
TwoVoices
Two Voices on a staff: The <staff-label> on staff 1 uses a multi-line <text-block>. Multi-line <text-block>s can also be used in <group-label>s.

Code
    <layouts>
        <staff-layout id="horns1to4"> // one staff (two voices, could be two note chords on each stem)
            <voice-layout stem="up">
                <part-layout part="horn1" /> // the part must be homophonic
                <part-layout part="horn3" /> // the part must be homophonic
            </voice-layout>
            <voice-layout stem="down">
                <part-layout part="horn2" /> // the part must be homophonic
                <part-layout part="horn4" /> // the part must be homophonic
            </voice-layout>
        </staff-layout>
        <group-layout id="pianoGrandStaff"> // two staves
            <staff-layout part="piano" part-staff="1" />  // the part must contain staves (be polyphonic)
            <staff-layout part="piano" part-staff="2" />
        </group-layout>

        <system-layout id="page1SystemLayout">
            <staff-layout layout="horns1to4" /> // staff 1 in system
            <group-layout layout="pianoGrandStaff"/> // staves 2 and 3 in system             
            <labels>
                <group-label>
                    <text-block>
                        <string text="4 Horns in F" /> 
                    </text-block>
                    <group-symbol type="bracket" top-staff="1" bottom-staff="1">
                        <staff-label staff="1">
                            <text-block>
                                <string text="1, 3" />
                                <string text="2, 4" />
                            </text-block>
                            // Could also contain a <staff-symbol> 
                        </staff-label>
                    </group-symbol>
                </group-label>
                <group-label>
                    <text-block>
                        <string text="Piano" />
                    </text-block>
                    <staff-symbol type="brace" top-staff="2" bottom-staff="3" />                    
                </group-label>
            </labels>
        </system-layout>
    </layouts>

Example 3:
bracket ordering
This is the brackets ordering issue posed in #276. I've put the answer here because it needs to be part of the general solution.

Code
<layouts>
        <staff-layout id="sopSoloLayout"> // one staff (one voice)
            <part-layout part="sopSolo" /> // the part must be homophonic
        </staff-layout>
        <staff-layout id="sopranoLayout"> // one staff (one voice)
            <part-layout part="soprano" /> // the part must be homophonic
        </staff-layout>
        <staff-layout id="altoLayout"> // one staff (one voice)
            <part-layout part="alto" /> // the part must be homophonic
        </staff-layout>

        <system-layout id="layoutA">
            <staff-layout layout="sopSoloLayout" /> // staff 1 in system  
            <staff-layout layout="sopranoLayout" /> // staff 2 in system
            <staff-layout layout="altoLayout" /> // staff 3 in system 
            <labels>
                <staff-label staff="1" column-align="right">
                    <text-block>
                        <string text="Sop. Solo" />
                    </text-block>
                    //**********************
                    //  layoutA 
                    <staff-symbol type="square" top-staff="1" bottom-staff="2">
                        <staff-symbol2 type="bracket" top-staff="1" bottom-staff="3" />
                    </staff-symbol>
                    //**********************
                </staff-label>
                <staff-label staff="2" column-align="right">
                    <text-block>
                        <string text="Soprano" />
                    </text-block>
                </staff-label>
                <staff-label staff="3" column-align="right">
                    <text-block>
                        <string text="Alto" />
                    </text-block>
                </staff-label>
            </labels>
        </system-layout>

        <system-layout id="layoutB">
            <staff-layout layout="sopSoloLayout" /> // staff 1 in system  
            <staff-layout layout="sopranoLayout" /> // staff 2 in system
            <staff-layout layout="altoLayout" /> // staff 3 in system 
            <labels>
                <staff-label staff="1" column-align="right">
                    <text-block>
                        <string text="Sop. Solo" />
                    </text-block>
                    //**********************
                    //  layoutB 
                    <staff-symbol type="bracket" top-staff="1" bottom-staff="3" />
                        <staff-symbol2 type="square" top-staff="1" bottom-staff="2">                        
                    </staff-symbol>
                    //**********************
                </staff-label>
                <staff-label staff="2" column-align="right">
                    <text-block>
                        <string text="Soprano" />
                    </text-block>
                </staff-label>
                <staff-label staff="3" column-align="right">
                    <text-block>
                        <string text="Alto" />
                    </text-block>
                </staff-label>
            </labels>
        </system-layout>

</layouts>

Example 4:
groupGroup
A score for two groups of players, one on the left of the stage, one on the right.
Demonstrates <group-label> nesting.

Code
    <layouts>
        <staff-layout id="fluteLayout"> // one staff (one voice)
            <part-layout part="flutePart" /> // the part must be homophonic
        </staff-layout>
        <group-layout id="piano1GrandStaffLayout"> // two staves
            <staff-layout part="piano1" part-staff="1" />  // the part must contain staves (be polyphonic)
            <staff-layout part="piano1" part-staff="2" />
        </group-layout>
        <staff-layout id="clarinetLayout"> // one staff (one voice)
            <part-layout part="clarinetPart" /> // the part must be homophonic
        </staff-layout>
        <group-layout id="piano2GrandStaffLayout"> // two staves
            <staff-layout part="piano2" part-staff="1" />  // the part must contain staves (be polyphonic)
            <staff-layout part="piano2" part-staff="2" />
        </group-layout>

        <system-layout id="defaultSystemLayout">
            <staff-layout layout="fluteLayout" /> // staff 1 in system
            <group-layout layout="piano1GrandStaffLayout"/> // staves 2 and 3 in system   
            <staff-layout layout="clarinetLayout" /> // staff 4 in system
            <group-layout layout="piano2GrandStaffLayout"/> // staves 5 and 6 in system  
           
            <labels>
                <group-label column-align="center">
                    <text-block>
                        <string text="Left Group" />
                    </text-block>
                    <group-symbol type="bracket" top-staff="1" bottom-staff="3">
                        <staff-label staff="1" column-align="center">
                            <text-block>
                                <string text="Fl." />
                            </text-block>
                        </staff-label>
                        <group-label column-align="center">
                            <text-block>
                                <string text="Piano" />
                            </text-block>
                            <staff-symbol type="brace" top-staff="2" bottom-staff="3"/>
                        </group-label>
                    </group-symbol> // end of top large bracket
                </group-label>
                <group-label column-align="center">
                    <text-block>
                        <string text="Right Group" />
                    </text-block>
                    <group-symbol type="bracket" top-staff="4" bottom-staff="6">
                        <staff-label staff="4" column-align="center">
                            <text-block>
                                <string text="Cl." />
                            </text-block>
                        </staff-label>
                        <group-label column-align="center">
                            <text-block>
                                <string text="Piano" />
                            </text-block>
                            <staff-symbol type="brace" top-staff="5" bottom-staff="6"/>
                        </group-label>
                    </group-symbol> // end of bottom large bracket
                </group-label>

            </labels>
        </system-layout>
    </layouts>
@notator
Copy link
Contributor Author

notator commented Dec 14, 2021

I've now edited the above proposal, adding optional column-align attributes to <group-label> and <staff-label>.
column-align can take values left|center|right, and has default center.
All the examples except Example 3 use column-align="center".
Example 3 uses <staff-label ... column-align="right"/>

@clnoel
Copy link

clnoel commented Dec 16, 2021

I have to say I dislike this proposal, with the notable exception of the text-block element, which is actually #278. We already have a grouping hierarchy, and it feels like a step backwards. I want to handle the symbols and layouts inside the -layouts hierarchy, not separately. However, the counter proposal I have thus far come up with does not handle Example 4 properly, so I'm still thinking.

@notator
Copy link
Contributor Author

notator commented Dec 20, 2021

I want to handle the symbols and layouts inside the -layouts hierarchy, not separately.

I don't think that can work. The same part may have to be labelled differently in different system layouts. The left-margin labels actually apply to staves, not parts.

@clnoel
Copy link

clnoel commented Jan 28, 2022

@notator Yes, we have to apply labels to staff-layouts & group-layouts, not to part-layouts. That doesn't mean it can't happen in the layout-hierarchy.

Okay, so let's say that default positioning of brackets have them going from children on the right to parents on the left. And default positioning of labels has them to the left of all brackets, once again where children-to-parents = right-to-left. Labels are vertically centered on their staff or on their group symbol.

Surveying a random sampling of real chamber music and orchestral scores on imslp.org showed this being by far the most common configuration.

Please note that while I have tried to come up with good names, I am not tied to them. For instance label-source below could be part-source, part-ref, part-id, etc. I've been through all of those options when making these examples, and I finally just picked one.

Proposal

For this purpose, then, I'd like to propose a child to both group-layout and staff-layout: <label>
Contents:
The contents of <label> will take on whatever format we decide is best in the text-block discussion in #278, which is beside the point for this discussion, so I'll use the <string> children like you did in your proposal.
Attributes:
label-source: The value is a part id. When defined, instead of the contents of <label> use the name or short-name of the referenced part. The contents of <label> should be empty if this is defined.
label-type: enum with values short and long (default long) only has meaning if label-source is also defined, and determines whether the name (long) or short-name (short) of the part is used for this label.

I would like to add the new attribute symbol-placement to <group-layout>
symbol-placement: enum with values leftmost, rightmost, inside-parent, and outside-parent, defaults to inside-parent. This changes the placement of the group's symbol relative to the rest of the stack of symbols.

  • leftmost: Place to the left of non-leftmost symbols. If more than one symbol in a hierarchy layer uses leftmost then the hierarchy order is used, so leftmost children of leftmost parents appear to the right of those parents,
  • rightmost: Place to the right of non-rightmost symbols. If more than one symbol in a hierarchy layer uses rightmost then the hierarchy order is used, so rightmost children of rightmost parents appear to the right of those parents.
  • inside-parent (default): Place immediately to the right of the parent symbol regardless of parent's leftmost/rightmost setting.
  • outside-parent: Place immediately to the left of the parent symbol regardless of parent's leftmost/rightmost setting.
    In order to keep the defaults consistent, inside-parent and outside-parent become equivalent when there is no parent: these are the baseline by which other symbols in their hierarchy are placed.

I would like to add the new attribute label-placement to both <group-layout> and <staff-layout>
label-placement: enum with values over-staff, leftmost, rightmost, inside-symbol, outside-symbol, inside-label-parent outside-label-parent, and aligned-label-parent, defaults to leftmost. This changes the location of the label relative to the other labels and symbols in the hierarchy. The containing symbol for a label on a group-layout is that group's symbol. The containing symbol for a label on a staff-layout is the symbol of the containing group (if any). The parent label is the label of next highest-group in the hierarchy.

  • over-staff: Place the label above the staff (the topmost staff if used on a group-layout label) instead of next to it. If more than one item in a hierarchy has over-staff, the labels should vertically align with each other with the outermost on top.
  • leftmost (default): Place to the left of non-leftmost symbols and labels. These appear in hierarchy order, with labels assumed to be inside-parent-label (if the parent label is also leftmost) or outside-symbol for group labels and inside-symbol for staff labels (if the parent symbol is leftmost).
  • rightmost: Place to the right of non-rightmost symbols and labels. These appear in hierarchy order, with labels assumed to be inside-parent-label (if the parent label is also rightmost) or outside-symbol for group labels and inside-symbol for staff labels (if the parent symbol is rightmost).
  • inside-symbol: Place to the immediate right of the containing symbol, regardless of that symbol's placement setting.
  • outside-symbol: Place to the immediate left of the containing symbol, regardless of that symbol's placement setting.
  • inside-label-parent: Place to the immediate right of the parent label, regardless of that label's placement setting.
  • outside-label-parent: Place to the immediate left of the parent label, regardless of that label's placement setting.
  • aligned-label-parent: Place above or below the parent label, still vertically centered on the staff or group if possible. If the parent label collides with that location, this should behave as inside-label-parent.

Note: In the examples below, I have removed the idea of reusable -layout elements (except system-layout), which are not part of the current spec, partially because most people did not want to try track that. It makes for longer files, but actually removes quite a bit of complexity, since you don't have to worry about how the individual elements might be reused in different system-layouts.

Example 1&2

Code
<mnx>
    <global>...</gobal>
    <part id="Horn1">...</part>
    <part id="Horn2">...</part>
    <part id="Horn3">...</part>
    <part id="Horn4">...</part>
    <part id="Piano" staves="2" name="Piano" short-name="Piano">...</part>
    <layouts>
        <system-layout id="TwoStaffHorns">
            <group-layout symbol="bracket">
                <label>
                    <string text="4 Horns in F"/>
                </label>
                <staff-layout label-placement="inside-symbol">
                    <label>
                        <string text="1,2"/>
                    </label>
                    <voice-layout stem="float">
                        <part-layout part="Horn1"/>
                        <part-layout part="Horn2"/>
                    </voice-layout>
                </staff-layout>
                <staff-layout label-placement="inside-symbol">
                    <label>
                        <string text="3,4"/>
                    </label>
                    <voice-layout stem="float">
                        <part-layout part="Horn3"/>
                        <part-layout part="Horn4"/>
                    </voice-layout>
                </staff-layout>
            </group-layout>
            <group-layout symbol="brace">
                <label label-source="Piano" />
                <staff-layout part-staff="1">
                    <part-layout part="Piano"/>
                </staff-layout>
                <staff-layout part-staff="2">
                    <part-layout part="Piano"/>
                </staff-layout>
            </group-layout>
        </system-layout>
        <system-layout id="TwoStaffHornsShort">
            <group-layout symbol="bracket">
                <label>
                    <string text="Hn."/>
                </label>
                <staff-layout label-placement="inside-symbol">
                    <label>
                        <string text="1,2"/>
                    </label>
                    <voice-layout stem="float">
                        <part-layout part="Horn1"/>
                        <part-layout part="Horn2"/>
                    </voice-layout>
                </staff-layout>
                <staff-layout label-placement="inside-symbol">
                    <label>
                        <string text="3,4"/>
                    </label>
                    <voice-layout stem="float">
                        <part-layout part="Horn3"/>
                        <part-layout part="Horn4"/>
                    </voice-layout>
                </staff-layout>
            </group-layout>
            <group-layout symbol="brace">
                <label label-source="Piano" type="short"/>
                <staff-layout part-staff="1">
                    <part-layout part="Piano"/>
                </staff-layout>
                <staff-layout part-staff="2">
                    <part-layout part="Piano"/>
                </staff-layout>
            </group-layout>
        </system-layout>
        <system-layout id="OneStaffHorns">
            <group-layout symbol="bracket">
                <label>
                    <string text="4 Horns in F"/>
                </label>
                <staff-layout label-placement="inside-symbol">
                    <label>
                        <string text="1,3"/>
                        <string text="2,4"/>
                    </label>
                    <voice-layout stem="up">
                        <part-layout part="Horn1"/>
                        <part-layout part="Horn3"/>
                    </voice-layout>
                    <voice-layout stem="down">
                        <part-layout part="Horn2"/>
                        <part-layout part="Horn4"/>
                    </voice-layout>
                </staff-layout>
            </group-layout>
            <group-layout symbol="brace">
                <label label-source="Piano"/>
                <staff-layout part-staff="1">
                    <part-layout part="Piano"/>
                </staff-layout>
                <staff-layout part-staff="2">
                    <part-layout part="Piano"/>
                </staff-layout>
            </group-layout>
        </system-layout>
    </layouts>
    <score name="fullScore">
        <page>
            <system measure="1" layout="TwoStaffHorns"/>
            <system measure="7" layout="TwoStaffHornsShort"/>
        </page>
        <page>
            <system measure="13" layout="OneStaffHorns"/>
        </page>
        ...
    </score>
</mnx>

Example 3

This actually becomes dead simple. The first one is the default positioning, and the second requires only one additional symbol-placement tag.

Code
<mnx>
    <global>...</global>
    <part id="Solo" name="Soprano Solo" short-name="Sop. Solo">...</part>
    <part id="Soprano" name="Soprano" short-name="S">...</part>
    <part id="Alto" name="Alto" short-name="A">...</part>
    <layouts>
        <system-layout id="layoutA">
            <group-layout symbol="bracket">
                <group-layout symbol="square">
                    <staff-layout>
                        <label label-source="Solo" label-type="short"/>
                        <part-layout part="Solo"/>
                    </staff-layout>
                    <staff-layout>
                        <label label-source="Soprano"/>
                        <part-layout part="Soprano"/>
                    </staff-layout>
                </group-layout>
                <staff-layout>
                    <label label-source="Alto"/>
                    <part-layout part="Alto"/>
                </staff-layout>
            </group-layout>
        </system-layout>
        <system-layout id="layoutB">
            <group-layout symbol="bracket">
                <group-layout symbol="square" symbol-placement="outside-parent">
                    <staff-layout>
                        <label label-source="Solo" label-type="short"/>
                        <part-layout part="Solo"/>
                    </staff-layout>
                    <staff-layout>
                        <label label-source="Soprano"/>
                        <part-layout part="Soprano"/>
                    </staff-layout>
                </group-layout>
                <staff-layout>
                    <label label-source="Alto"/>
                    <part-layout part="Alto"/>
                </staff-layout>
            </group-layout>
        </system-layout>
    </layouts>
    <score>
        <page>
            <system measure="1" layout="layoutA"/>
            ...
        </page>
        <page>
            <system measure="11" layout="layoutB"/>
            ...
        </page>
    </score>
</mnx>

Example 4

The one problem I have with my proposal is that there is more than one way to do things. Both of the following work for this example.

Code 1 (Inside/Outside)
<mnx>
    <global>...</gobal>
    <part id="Flute" name="Flute" short-name="Fl.">...</part>
    <part id="Clarinet" name="Clarinet" short-name="Cl.">...</part>
    <part id="PianoL" name="Left Piano" short-name="L. Pno." staves="2">...</part>
    <part id="PianoR" name="Right Piano" short-name="R. Pno." staves="2">...</part>
    <layouts>
        <system-layout id="LeftRightGrouping">
            <group-layout symbol="bracket">
                <label>
                    <string text="Left Group"/>
                </label>
                <staff-layout label-placement="inside-symbol">
                    <label label-source="Flute" />
                    <part-layout part="Flute"/>
                </staff-layout>
                <group-layout symbol="brace" label-placement="outside-symbol">
                    <label>
                        <string text="Piano"/>
                    </label>
                    <staff-layout part-staff="1">
                        <part-layout part="PianoL"/>
                    </staff-layout>
                    <staff-layout part-staff="2">
                        <part-layout part="PianoL"/>
                    </staff-layout>
                </group-layout>
            </group-layout>
            <group-layout symbol="bracket">
                <label>
                    <string text="Right Group"/>
                </label>
                <staff-layout label-placement="inside-symbol">
                    <label label-source="Clarinet"/>
                    <part-layout part="Clarinet"/>
                </staff-layout>
                <group-layout symbol="brace" label-placement="outside-symbol">
                    <label>
                        <string text="Piano"/>
                    </label>
                    <staff-layout part-staff="1">
                        <part-layout part="PianoR"/>
                    </staff-layout>
                    <staff-layout part-staff="2">
                        <part-layout part="PianoR"/>
                    </staff-layout>
                </group-layout>
            </group-layout>
        </system-layout>
    </layouts>
    <score>
        <page>
            <system measure="1" layout="LeftRightGrouping"/>
        </page>
        ...
    </score>
</mnx>
Code 2 (Rightmost)
<mnx>
    <global>...</gobal>
    <part id="Flute" name="Flute" short-name="Fl.">...</part>
    <part id="Clarinet" name="Clarinet" short-name="Cl.">...</part>
    <part id="PianoL" name="Left Piano" short-name="L. Pno." staves="2">...</part>
    <part id="PianoR" name="Right Piano" short-name="R. Pno." staves="2">...</part>
    <layouts>
        <system-layout id="LeftRightGrouping">
            <group-layout symbol="bracket">
                <label>
                    <string text="Left Group"/>
                </label>
                <staff-layout label-placement="rightmost">
                    <label label-source="Flute" />
                    <part-layout part="Flute"/>
                </staff-layout>
                <group-layout symbol="brace" symbol-placement="rightmost" label-placement="rightmost">
                    <label>
                        <string text="Piano"/>
                    </label>
                    <staff-layout part-staff="1">
                        <part-layout part="PianoL"/>
                    </staff-layout>
                    <staff-layout part-staff="2">
                        <part-layout part="PianoL"/>
                    </staff-layout>
                </group-layout>
            </group-layout>
            <group-layout symbol="bracket">
                <label>
                    <string text="Right Group"/>
                </label>
                <staff-layout label-placement="rightmost">
                    <label label-source="Clarinet"/>
                    <part-layout part="Clarinet"/>
                </staff-layout>
                <group-layout symbol="brace" symbol-placement="rightmost" label-placement="rightmost">
                    <label>
                        <string text="Piano"/>
                    </label>
                    <staff-layout part-staff="1">
                        <part-layout part="PianoR"/>
                    </staff-layout>
                    <staff-layout part-staff="2">
                        <part-layout part="PianoR"/>
                    </staff-layout>
                </group-layout>
            </group-layout>
        </system-layout>
    </layouts>
    <score>
        <page>
            <system measure="1" layout="LeftRightGrouping"/>
        </page>
        ...
    </score>
</mnx>

Alternate Proposal:

It might be that the placement enums are too complicated (or cumbersome) for programs (rather than humans) to properly assign in a way that conforms to "one way to do things". In that case, we would instead define "columns". These columns are referenced right-to-left across vertical placements for both symbols and labels. Anything that lines up vertically is given the same column number, and the symbol-placement and label-placement attributes become the integer attributes symbol-column and label-column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants