How can a plugin see if a rest belongs to a tuplet?
We can now see from a plugin if a note belongs to a tuplet with:
notes[i].parent.tuplet != null
But what about a rest belonging to a tuplet? I tried:
rest.parent.tuplet != null & variations, but that does not work.
Comments
Since a rest is already of the type ChordRest you don't need to go up to the parent (a Note lives within the Chord). So just
rest.tuplet
In reply to Since a rest is already of… by jeetee
Many thanks!! But (edit)
else if(cursor.element && cursor.element.type === Element.REST) {
var rest = cursor.element.REST;
does not work.
Neither does cursor.element.rest
How do I get rest?
In reply to Many thanks!! by elsewhere
var rest = cursor.element
In reply to var rest = cursor.element by jeetee
Thanks!!