How to tie 2 notes ?

• Mar 1, 2023 - 08:36

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

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