Musecore plugin QML bindings documentation

• Jun 7, 2025 - 10:59

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

In reply to 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:

  • general concepts, class model and object hierarchy of a score in MuseScore, i.e. what a score consists of, presumingly staves, each staff being made up of this and that, discretisation choices into ticks, all of that.
  • exposure of said concepts in an API for plugins to use, ideally not in the original C++ syntax, but how the plugin QML code would use it in an IDE.

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 as MuseScore.invoke(Command.SelectAll) instead the error-prone cmd("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.

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.

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