reverse notes order in n-plets - plugin having no effect

• Jun 26, 2019 - 16:45

I am creating a tool for Musescore (currently I am using version 2.3.2).
The plugin has to reverse the order of notes in triplets or other n-plets of a selection.
You can see it as an attachment (qml file).
It's for my only use, so there are no type checks. I do not mind because it processes a selection that I know to make without errors.
Some parameters are hard-coded in this preliminar version as you can see.
In fact it does nothing if I run it on a selection. No errors but the notes are left unchanged.
What is wrong with the code?
This is my first MS plugin so any suggestion is welcome.

Attachment Size
example.qml 1.1 KB

Comments

    var lastNote=cursor;
    cursor.rewind(1);
    while (cursor!=lastNote){

You'll probably want to store the segment/element in lastNote and not the cursor itself. The latter then indeed is still the same cursor, which is why you don't enter the while loop.

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