Tuplets in MSCX
Each Tuplet tag has a corresponding /Tuplet tag but what is the endTuplet/ tag for?
Each Tuplet tag has a corresponding /Tuplet tag but what is the endTuplet/ tag for?
Do you still have an unanswered question? Please log in first to post your question.
Comments
Seems to me that they come in pairs
<Tuplet>
is used at the start of a tuplet whereas<endTuplet/>
is used to end one (duration/timewise).https://github.com/musescore/MuseScore/search?l=C%2B%2B&q=endTuplet
In reply to Seems to me that they come… by jeetee
But there's already a /Tuplet to end the opening Tuplet and endTuplet/ is both an opening and closing tag without data. It appears to be redundant but I'm sure that it's not.
(How did you make angled brackets work in your post?)
In reply to But there's already a … 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)In reply to The <endTuplet/> tag isn't a… 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 It seems that the <endTuplet… by Ziya Mete Demircan
It really is the tuplet termination marker and corruption check as mentioned above. Check the link in my first reply, the measure.cpp entry upon reading in a file.
In reply to It seems that the <endTuplet… by Ziya Mete Demircan
Nested tuplets? Nooooooooo! That hurts my brain. Surely such things do not actually exist.
In reply to The <endTuplet/> tag isn't a… 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.
In reply to Thanks for that. It makes… by yonah_ag
apologies, tuplet contents is compared with actualNotes
time between tuplet and endTuplet with normalNotes
In reply to apologies, tuplet contents… by jeetee
Phew! That's a relief. Thanks for taking the time to help out.