Problem With Adding A Rest

• Jul 21, 2016 - 09:46

Hi

Im trying to add a rest to a staff but the method I have worked out just keeps crashing the program when I run it.

The method I am using is

var _rest = newElement(Element.REST);
cursor.add(_rest);

Any help would be greatly appreciated


Comments

I'm not very familiar with the plugin interface, but based on how the code itself works internally, my guess is that the rest you just created defaults to an invalid duration and you need to set that yourself before trying to add it. Maybe also you would need to explicitly set the track (staff & voice) and/or some other properties.

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