Tuplets in MSCX

• Jun 23, 2021 - 12:24

Each Tuplet tag has a corresponding /Tuplet tag but what is the endTuplet/ tag for?

Tuplets.png


Comments

In reply to by yonah_ag

The <endTuplet/> tag isn't a closing tag for the tuplet XML-wise, it's a closing tag for the tuplet timewise. As in, the tuplet start is defined by the <Tuplet> tag and all of its contents, and the end of the tuplet is indicated by the <endTuplet/> tag; meaning everything in-between two such tags should belong in the tuplet.

See the attached example where the endTuplet from L#182 closes (logically speaking, not xml-speaking) the Tuplet contents that was started at L#152. Similarly, the end of L#223 marks the end of Tuplet L#193.
It serves as an additional sanity/corruption check. Under normal circumstances the sum of the durationTypes of all chordrests inbetween a Tuplet and its endTuplet should match normalNotes*baseNote of the Tuplet.

(Enclose your xml in <xml></xml> tags to have it show up that way)

Attachment Size
1085476-endTuplet-example.mscx 7.82 KB

In reply to by jeetee

Here I will only describe the possibilities that I have considered:

It seems that the <endTuplet/> tag is a standalone (self closing) tag. So it's not a termination tag of something. But it's like a warning flag or some sort of separator.

I don't know why it was invented, but it could be used to warn when one tuplet is ending and another one is starting and it might work for nested tuplets as well. Maybe one of the uses is set to calculate when a tuplet overflows from one measure to another during copy/paste.

In reply to by jeetee

Thanks for that. It makes sense but the example doesn't seem to be "normal circumstances" for either of the tuplet sections. For the 152-182 section:

normalNotes * baseNote = 2 * quarter but Sum Chord durations = 3 quarters

so I'm confused.

          <Tuplet>
            <normalNotes>2</normalNotes>
            <actualNotes>3</actualNotes>
            <baseNote>quarter</baseNote>
            <Number>
              <style>Tuplet</style>
              <text>3</text>
              </Number>
            </Tuplet>
          <Chord>
            <durationType>quarter</durationType>
            <Note>
              <pitch>67</pitch>
              <tpc>15</tpc>
              </Note>
            </Chord>
          <Chord>
            <durationType>quarter</durationType>
            <Note>
              <pitch>65</pitch>
              <tpc>13</tpc>
              </Note>
            </Chord>
          <Chord>
            <durationType>quarter</durationType>
            <Note>
              <pitch>64</pitch>
              <tpc>18</tpc>
              </Note>
            </Chord>
          <endTuplet/>

Do you still have an unanswered question? Please log in first to post your question.