Porting 3.x plugins to Musescore 4
As the final release of Musescore is coming closer every moment I installed a few of my favourite MU3 plugins in MU4 only te see that most of them don't work.
I have some experience in programming in Javascript and C# and have some spare time. So I would like to try to upgrade a few plugins. I found some useful information about creating plugins for 3.x.
Is there already information available about creating plugins for MU4?
Comments
https://musescore.org/en/node/337468
In reply to https://musescore.org/en… by msfp
Nevertheless, some plugins are ported to 4.0.
e.g. Batch export, element analyser
The new 4.X API could be months away, and i imagine that some plugins could work with little modifications.
In reply to Nevertheless, some plugins… by graffesmusic
Batch Export isn't working though
In reply to Batch Export isn't working… by Jojo-Schmitz
I admit i didn't test this, but the extended version described in https://musescore.org/en/node/334993 seems to be ported to MS4, as seen here:
https://github.com/lgvr123/batch_export/releases/tag/4.1.0
In reply to I admit i didn't test this,… by graffesmusic
Not (yet) the same as https://musescore.org/en/project/batch-convert (but a heavily modified fork instead, see also https://github.com/Jojo-Schmitz/batch_export/pull/17) and I suspect it doesn't work in 4.x either, as the API for opening files is simply missing currently.
In reply to Not the same as https:/… by Jojo-Schmitz
Ok, thanks for the info
In reply to I admit i didn't test this,… by graffesmusic
Hi,
Some of my plugins are working nicely under MS4 (e.g. Solo Analyser and Element Analyser, some are only displaying more or less correctly (e.g. Batch Export - now merged into Jojo's version), some are not even showing up in the plugins' list !! (e.g. Scale Workout Builder).
I've personally stopped investigating why for now.
There is a couple of things to look at (or wait for):
* the data and score representations through the API to be updated, stabilized,
* the gui that doesn't look nice (e.g. most texts are getting truncated as "Parenth..." instead of "Parenthood" (in ElementAnalyser)).
For anyone willing to port its plugins to MS4, here are my suggestions:
1. Have your plugin and all its dependencies (if any) in its own subfolder (example),
2. In the top folder, place your README.md file (if any)
3. Consider adding a
.gitattributes
file in the top folder for preventing all the "non plugin files" to be incorporated in your releases4. At the level of the code, add the new MS4 properties conditionally (example).
title
is definitely recommended.thumbnailName
andcategoryCode
are nice to have.5. If you add a logo, place it in the plugin subfolder.
In reply to https://musescore.org/en… by msfp
Hi,
thank you for sharing! I've written a plugin for MS3 (https://github.com/kspgh/sight-reading-trainer) that now is not working anymore. If I use it, it crashes MS4 without even and exit message... ->please don't understand this as a blame anyone!! :-)
It sounds to me, like it makes sense to wait a while until the new way of creating plugins is available. As you plan to make Musescore Plugin's much more powerful, I guess you will also create/improve many tools and documentation.
Would you confirm this?
BR, Karsten
In reply to Hi, thank you for sharing! I… by karsten.spries…
See https://musescore.org/en/node/337468#Tips-for-adapting-plugins-for-4.x, esp.the
Qt.quit();
stuff.That was wrong in MuseScore 3 already, but now leads to crashes
In reply to See https://musescore.org/en… by Jojo-Schmitz
Thank you for the hint. Was not aware of that. I commented //Qt.quit(); ->now it does not crash anymore. Unfortunately it still does not work.
Is there a way to show the console output from the script such that I get an idea where it does not work?
In reply to Thank you for the hint. Was… by karsten.spries…
None that I know of
In reply to None that I know of by Jojo-Schmitz
You could use the various
log
methods or write log to some external file using theFileIO
objectIn reply to You could use the various… by parkingb
Thanks so much for answering.
I think I'll wait until the new concept for Plugin's is ready. Maybe there is much more possible then.
In an ideal case I'd like to write a sight reading trainer plugin, that could use available scores and if a student plays e.g. on a midi keyboard, the plugin could measure which notes were right/wrong, to early or late.
Probably thats too much of complexity for me but lets see. :-)
In reply to Thanks so much for answering… by karsten.spries…
Musescore is probably not the right tool for this... I've been able to write a pseudo interface between Java and Musescore. So it could replicated with any language you are more familiar with.
In reply to Thanks so much for answering… by karsten.spries…
There was a MS 2.3 for out there for a project called PianoTutor which you might want to look into.
In reply to There was a MS 2.3 for out… by jeetee
https://musescore.org/en/node/325910 ? and/or https://www.instructables.com/MuseScoreArduinoLEDsMIDI-Piano-Tutor/ ?
In reply to https://musescore.org/en… by Jojo-Schmitz
Thanks so much guys. :-) I'll look at the info you've provided.
In reply to None that I know of by Jojo-Schmitz
ok, thanks. so I wait till debugging is possible again.
Now that Musescore 4.0 is released, is there a planning for the 4.1 with all the stuff related to the API 🙃 ?