w3c / mnx

Music Notation CG next-generation music markup proposal.
174 stars 19 forks source link

Sequence/Part exclusivity in layouts #274

Open clnoel opened 2 years ago

clnoel commented 2 years ago

I feel like mode is kind of central and necessary when talking about using part-voice in layouts. Here's a thought example: Imagine a choral piece, where the final chorus has a high-soprano descant. It's the only place in the whole piece where the sopranos would split, and for the set of measures where it exists, the relevant sequences are labelled voice="descant", and no other voices are labelled, even in those measures.

<system-layout "twoStaffVoices">
    <staff-layout>
        <voice-layout stem="up">
            <part-layout part="soprano"/>            
        </voice-layout>
        <voice-layout stem="down">
            <part-layout part="alto"/>
        </voice-layout>
    </staff-layout>
    <staff-layout>
         ... male voices ...
    </staff-layout>
</system-layout>
<system-layout "twoStaffVoicesDescant">
    <staff-layout>
        <voice-layout stem="up">
            <part-layout part="soprano" part-voice="descant"/>            
        </voice-layout>
        <voice-layout stem="down">
            <part-layout part="soprano"/>
            <part-layout part="alto"/>
        </voice-layout>
    </staff-layout>
    <staff-layout>
         ... male voices ...
    </staff-layout>
</system-layout>

In the descant layout, how does the algorithm know to not repeat the descant sequence in the stem-down voices? The only way for it to know that is if we assume that a note can only show up in a system layout once, and that is patently false as you could easily just add a whole part to more than one staff layout. In order for that layout to work, we need to add <part-layout part="soprano" part-voice="descant" mode="exclude"/> to the downstem voices. We can't assume that any note only shows up in a system layout once, or that a part refers only to the unlabeled sequences.

Originally posted by @clnoel in https://github.com/w3c/mnx/issues/185#issuecomment-976894088

joeberkovitz commented 2 years ago

I have a couple of questions that may help me understand the issue better. It’s not an objection that this is broken, just trying to get to the core of why this is needed.