Best way to write a plugin

• Dec 9, 2021 - 07:54

sorry for the simple question, I find it hard to get proper docs, I don't even know where I should look.

Using the plugin creator is a joke, it doesn't give any help with syntax, errors, formatting etc.

which editor should I use to write plugins?

thanks


Comments

In reply to by Jojo-Schmitz

>> QtCreator maybe
Pretty expensive !!
I'm using Notepad++ with the javascript text-styling.

Here are my sources of info:
* QML 5: https://doc.qt.io/qt-5/qmltypes.html
* MuseScore score elements organisation: https://musescore.org/en/developers-handbook/references/musescore-inter…
* MuseScore API: https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/class…
* Note pitch values: https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/pitch…
* Tonal pitch: https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/tpc.h…
* Everything about tick length: https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/tickl…
* All Known "cmd(xxx)" actions(*): https://raw.githubusercontent.com/musescore/MuseScore/3.x/mscore/shortc…

(*) required when you want to achieve some command not supported by the API (such as "Copy", "Paste", ...)

New musescore plugin developer here as well, 3 weeks into the game and hope my setup will inspire you:
Syntax & Formatting: I personally use Sublime Text. Install qml syntax highlighting plugin in Sublime Text's package manager. It makes writing qml so much faster and visually comfortable.
Testing: then I use MuseScore's Plugin Creator to test out my code.
Debugging: I add a lot of console.log() in my plugin for debugging purpose (the log will be printed in Plugin Creator's console, that's why plugin creator is very useful). It acts like the breakpoints in other IDE's debugging tools.
Docs: official docs are just like dictionary, it's very informative but it only has few code examples and won't teach you too much methodical things. From my experience, the best way to learn how to write a specific function is by learning other people's code. Try to imagine what kind of existed plugins that potentially has the similar function that you want to write, then search for it, find and study the code excerpts. The community has created plenty of cool tricks so definitely dig into it! I hope this post is helpful for you and have fun!

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