How to add a measure at score start instead of its end?
I can add measures to the score end using "score.appendMeasure(int n)".
Is there a way to add a measure to the start of the score or to any position?
I tried "cursor.AddElement" passing a measure but it ends up at the end of the score and file is corrupted.
var measure = newElement(Element.MEASURE);
cursor.add(measure);
Comments
See: https://musescore.org/en/handbook/3/measure-operations#insert
In reply to See: https://musescore.org… by Shoichi
Which doesn't talk about how to do it in a plugin 😉
I would try
cmd("insert-measure")
In reply to I would try cmd("insert… by sammik
After selecting (something in) the first measure
cmd("insert-measure") works! Thanks a lot.
I had to select something first as you mentioned. And I also had to enclose those calls to make the rest of my code run afterwards.