How to tie 2 notes ?
Hi,
I'm trying to tie notes thru the API.
The fallback and easy solution is to use cmd("chord-tie")
(*) but I'd like to find a better approach because that cmd adds an undo step a every call and I may end up with a lot undo while I'd like to wrap my plugin action in a single undo.
I tried to newElement(Element.TIE)
but it crashed MS:
cursor.rewindToTick(firstChord.parent.tick);
var tie=newElement(Element.TIE);
cursor.add(tie);
The tie
element has startNote
and endNote
properties but read-only.
Selecting manually a tie and analysing it (with ElementAnalyser) shows the tie is actually not a Element but a Segment of type "TIE".
Anyone already succeeded to add ties between notes ?
(*):
cursor.rewindToTick(firstChord.parent.tick);
selectCursor(cursor); // select all elements of type Element.NOTE at cursor
cmd("chord-tie");
Comments
Can https://musescore.org/en/node/330798 help?
In reply to Can https://musescore.org/en… by elsewhere
This is mostly about accessing ties. I need to create ties. But I will have a try.