Open notator opened 2 years ago
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"/>
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.
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.
@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.
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.
This actually becomes dead simple. The first one is the default positioning, and the second requires only one additional symbol-placement tag.
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.
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
.
This proposal
<group-layout>
element is no longer recursive here, but the<group-label>
element is. See the Thoughts about Recursion below.<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.<labels>
element, inside<system-layout>
, following the<staff-layout>
and<group-layout>
definitions.<part>
s local use of staff index.<part>
'sname
andshort-name
attributes redundant. They should be deleted.label
,labelref
andsymbol
attributes on<group-layout>
and<staff-layout>
redundant. These attributes should be deleted.<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 https://github.com/w3c/mnx/issues/185#issuecomment-974201595 (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](https://www.w3.org/TR/xmlschema-1/#d0e1610), 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 ```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.): - `Coded example diagrams
Example 1: 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
```Example 2: 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
```Example 3: 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
```Example 4: A score for two groups of players, one on the left of the stage, one on the right. Demonstrates
<group-label>
nesting.Code
```