Closed MarcSabatella closed 2 years ago
Actually, "Color notes" works, but neither "new retrograde" nor "mirror intervals" do.
@heuchi is the original author (of these Courtesy accidental plugins) and might be interested in this
It's new-major-version time again ;-) I hope the plugin frame work hasn't changed too much. I don't really have time to look into this now and I haven't even looked at version 4, either. So it might take a while... But anyway, thanks for the notification.
I tried to look at this, but I ran into some difficulties. I don't know if this is the best place to share it, but since they seem to be of different origins but all affect plugin development, I'd list them here. Feel free to suggest a different place. :-)
I'm using the latest nightly build AppImage for Linux ("MuseScoreNightly-latest-x86_64.AppImage" from Aug 28)
On a side note: "Color notes" works but cannot be undone.
I managed to compile MuseScore myself again, which made the console.log() problem go away. The nightly builds don't seem to be debug builds, so they don't show the messages created by plugins.
Now I found that Element.CHORD is undefined in QML. I think the reason is at src/plugins/api/qmlpluginapi.cpp:
Enum* PluginAPI::elementTypeEnum = nullptr; Enum* PluginAPI::accidentalTypeEnum = nullptr;
At least these two are needed for the courtesy accidental plugins to work. I'm afraid I don't know how to solve this.
Maybe try asking in discord (#development)? People ask dev questions there
On a side note: "Color notes" works but cannot be undone.
That should indicate that cmdStart
and cmdEnd
are either not used or not working?
On a side note: "Color notes" works but cannot be undone.
That should indicate that
startCmd
andendCmd
are either not used or not working?
That one was easier to solve: startCmd()
and endCmd()
are used only if there's no selection:
function applyToNotesInSelection(func) { var fullScore = !curScore.selection.elements.length if (fullScore) { cmd("select-all") curScore.startCmd() } for (var i in curScore.selection.elements) if (curScore.selection.elements[i].pitch) func(curScore.selection.elements[i]) if (fullScore) { curScore.endCmd() cmd("escape") } }
Moving these calls out of the if-block should do it. This looks like a more generic function. So there might be other plugins affected.
Maybe try asking in discord (#development)? People ask dev questions there
Thanks. Yes, I know the discord channels. I was hesitating to ask there, because then I'd have to closely watch the channel, since answers can easily get buried in the stream of messages... I was wondering if there maybe already is an open issue or forum thread about (potentially) missing features of the plugin API and/or the plans for the plugin API? For example, I remember reading somewhere, that the plugin editor won't be included in the initial release of v4.
Moving these calls out of the if-block should do it. This looks like a more generic function. So there might be other plugins affected.
See PR ~#12245~ #13063 It seems MuseScore 3 does not need this change (but it doesn't harm there either) I've checked the other plugins, they seem to not need this
@Jojo-Schmitz Are you sure you linked the right PR?
Yes, I' sure to have linked to the wrong one ;-) I meant #13063
Please see #13585 for an in-depth analysis of the problem by @cbjeukendrup.
Actually, "Color notes" works, but neither "new retrograde" nor "mirror intervals" do.
If any specific plugin isn't working, can you log it individually? I think these should be working for release or removed until they do. Cheers!
(PR to fix the enum issue coming soon; probably that fixes the whole plugin.)
@MarcSabatella @heuchi Please check https://github.com/musescore/MuseScore/pull/13669! :)
Yay! The courtesy accidental plugins now seem to work. To me that's huge. New retrograde works too, albeit with a weird glitch in which the selection oddly seems messed up after running it.
But, it seems to have broken something about mirror intervals and the tuning plugins. In current builds, they show a dialog, and you can make settings and hit Apply, which closes the dialog but doesn't otherwise do anything. In the artifact from this PR, hitting Apply doesn't close the dialog. So I have to cancel out, and then it still doesn't do anything.
@MarcSabatella Thanks for catching that! I have fixed it in the plugins themselves. Unfortunately, there's a tiny compatibility break here: we can't use Ms
for enums anymore, because now all enums are in one namespace, which causes name clashes for some enums. For example, CHORD
is both an ElementType
and an ANCHOR
. So, Ms.CHORD
is now ambiguous and doesn't work anymore, and anything from Ms.…
causes a lot of warnings. Therefore I decided to retire it. Do you estimate that this affects a lot of user plugins, and/or can we live with it?
I don't have a good handle on that, @jeetee might. But I would also say, it's almost to be expected that plugins will need some sort of update to work going between major versions. If that's the worst of it, and there is a clear and simple way to update older plugins, I suspect there will be some grumbling but it will gradually die out as the plugins get updated.
I don't think many plugins used the Ms.
version for enums at all. In 3.x I (and most that I'm aware of) already used Element.CHORD
for comparing with element.type
(cfr. the older walk.qml#L85 tech demo plugin)
I can't even recall Ms.<enumValue>
ever being used, but that might just as well be my memory playing up 😅
Fixed in #13669
Describe the bug I can enable and run the courtesy accidental plugins, but none of them do anything
To Reproduce Steps to reproduce the behavior:
Result Nothing happens
Expected behavior The B should receive a courtesy natural
Screenshots
Platform information
Additional context The other courtesy accidentals plugins (remove, configure) do not seem to work either. But other plugins do.