Musecore plugin QML bindings documentation
Hello,
as I am new in writing musescore plugins in QML and JavaScript, I would appreciate some kind of documentation of the QML bindings, and not the C++ class documentation such as https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/index… . The reason is that in general, rather than using magic numbers in code, it is preferable to use the symbols declared in bindings. For instance, instead of using a notehead code 18
it is preferable to write Notehead.Group.HEAD_LA
, or ElementType.NOTE
instead of 29
.
In the same vein I would love to see an object hierarchy that represents a score (not only the API class hierarchy). I reckon there will be various ways in which that is possible. For instance, I would have thought that a score contains (among other things) staves, each staff contains measures, and each measures perhaps chords or notes, etc. But I might be completely wrong.
Kind regards,
peter
Comments
pls see and update wiki at
https://musescore.org/en/handbook/developers-handbook/plugins-3x (musescore 3)
https://musescore.org/en/node/337468 and https://github.com/musescore/MuseScore/wiki/Extensions-overview (musescore 4)
In reply to pls see and update wiki at… by msfp
Hello @msfp, thanks for the links; I have already had a look at those before, but I still haven't found what I am looking for. What I am after would be something along the lines of:
Once I get a better understanding of matters in MuseScore, I am happy to produce some technical prose, including diagrams and what not. I also need to understand differences in the MuseScore version and the API versioning which I haven't quite figured out. Talking of the API, I would wish for something like the following.
If the author of a plugin states
import MuseScore 3.5
at the beginning of the script, there would be constructs such asMuseScore.invoke(Command.SelectAll)
instead the error-pronecmd("select-all")
, a) using incomplete English words and b) second string literals. Ditto for all sorts of calls, arguments, enumerations, all typed and using complete English words. We are in 2025 after all.Just for the records, browsing the git repository, two links are interesting for those who want to understand some basic concepts:
- https://musescore.org/en/developers-handbook/references/design-implemen…
- https://musescore.org/en/developers-handbook/references/musescore-inter…
And of course, there is always the source.
When developing MuseScore plugins using an IDE, QtCreator in my case, then writing an
import MuseScore
will allow the IDE to work out what types are available, assuming that they would be exposed in some API description. To that end, it probably needs to know where to find them.That said, if I install MuseScore, do these bindings come with it, and if so where are they installed into?
Failing that, do I need to install some kind of dev-package containing the bindings that allow to develop agains, e.g. like header files for C++ packages?
Or am I completely wrong here?
Cheers, peter.