Help needed with plugin in Musescore 2.x

• Jun 27, 2019 - 15:19

My plugin is a private tool so it is not so elegant, and some parameters are hard-coded because I know the score will be suitably prepared, and the notes selected.
The use of the plugin is to reverse the order of nplets of notes, for example triplets.
[I am testing it on MS 2.x because a few months ago I tried the new version but it was laggish and unusable.
Furthermore, I am using Ubuntu Studio, and I found MS 2.x installed by default.]
(Please see the attachment, it is very easy to test the plugin yourself)

But very strange things happen that involve my algorithm and the plugin mechanism, both seem to have problems.
(I used the tick information to pick the right notes. But maybe segment information is involved too, I do not understand what segment is)

I tested it on 4 triplets and after the plugin run the notes sounds as expected, that is in reverse order within each triplet.
-A 5th triplet is involved too, in the next measure, but it is unwanted effect, the processing exceeds the selection.
-The first 2 triplets are unchanged as it comes to appearance, while the 3rd and 4th triplets are completely altered (notes are spread too much, although they sound as they should).

If I save the score, the next time I open it I see that the appearance has not changed (so the first 2 triplets are in the original form, the 3rd and 4th have the spread notes), but this time the first 2 triplets play the original notes (not reversed) and the 3rd and 4th plays the spread notes (and the 5th too).
What's wrong?

Attachment Size
example.qml 1.32 KB

Comments

I put my algorithm in the code suggested in this thread
https://musescore.org/en/node/291348
by @Jojo-Schmitz
so now I think I have taken into account everything when cycling through notes.
When I run the plugin (see attached qml file ) the pitch is reversed within each nplet in selection as expected.
But, let's say I have triplets, and a selection of four triplets in a measure:
-the appearance is wrong: the first nplet is spread, the other seems unchanged.
-if I save, next time the appearance is in the above mentioned form and the playback follows the appearing pitch.
Other cases are possible, as with 4plets for example, with slightly different results but the issue is the same
This is very strange. What could I do? I mean, this is rather a simple plugin, it should work now.
Or maybe there is a bug that has to be tracked somewhere?

Attachment Size
Plugin.qml 3.18 KB

In reply to by Jojo-Schmitz

I just replaced
import MuseScore 1.0
with
import MuseScore 3.0
and the result for the reverse order of pitches is the same (successful).
The scores were created with Musescore 2.x, maybe it is compatible because of this reason.
indeed some differences are found.
But differences are in general found also in MuseScore 2.x when it comes to different notes, triplets or measures that are selected, and to saving and reloading.

I have found a workaround for my need of reverse-ordering the notes. I have to apply this to several score. They are simple scores and I managed to export them as midi files, then creating new scores.
It does not solve or explain what is going on with the plugin but at least I have to perform less work.

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