Plugins cannot add chords and can add notes only in very limited ways

• Feb 28, 2019 - 10:18
Reported version
3.x-dev
Type
Plugins
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
Yes
Workaround
No
Project

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:

  1. The TPC cannot be set immediately. So adding a D flat major scale looks like this
    AddNotesNoTPC.png
  2. 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:
    AddNotesClarConcertP.png
  3. This clarinet part now has this in transposed view (concert pitch off):
    AddNotesClarTransposed.png
    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).
Attachment Size
testAddNote.qml 1.54 KB