Plugins cannot add chords and can add notes only in very limited ways
The problem came up in #283179: (some of the) missing objects/properties in the plugin framework in this post by Bacchushlg and currently affects all 3.x versions of MuseScore.
A plugin cannot add chords (i.e. more than one note at the same time).
A plugin can currently only add notes using Cursor.addNote, which has several problems. I created a simple demonstration plugin to show these:
- The TPC cannot be set immediately. So adding a D flat major scale looks like this
- Using a second pass (or rewinding the cursor after addNote and advancing to where it was) can give the correct result. However, this doesn't work for transposing instruments. For a Clarinet in Bb we get this when in concert pitch view:
- This clarinet part now has this in transposed view (concert pitch off):
The TPCs now no longer match but worse yet, the notes are just wrong (although they play back the same as the transposed view – a major second higher than shown).