Creating a chord in the current score
Hi!
I am trying to create a chord, add new notes to it, and then insert it in the current score, at the user's cursor position. (if possible)
Here is what I have, so far:
https://github.com/aalex/jazzChord/blob/master/jazzChord.qml#L58
In the documentation, it says that one should be able to create a new Chord. https://musescore.org/fr/plugin-development/chord-object
I have this error message in the console:
58:-1: ReferenceError: Chord is not defined
Any idea why? How can I create a chord, and insert notes to it? (I would rather use the Harmony type, too, so that I can insert a Cb instead of a B, depending on the tonal context)
Thank you!
Comments
It's a shame the plugin API doesn't provide a straightforward way to add multi-note chords to a score. I don't know if things have changed in MuseScore 3, but I suspect rousselmanu's toolkit might be helpful:
https://github.com/rousselmanu/msc_plugins/blob/master/addChord.qml
In reply to It's a shame the plugin API… by PaulSC
Thank you! We need a common library of JavaScript functions for the plugins.