make all symbols accessible to plugins

• Jun 10, 2020 - 08:41
Reported version
3.4
Type
Plugins
Frequency
Once
Severity
S5 - Suggestion
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

Currently symbols (from the "symbols" palette) are invisible to plugins. Making them accessible to plugins would suddenly make all accidentals available for microtonal tuning plugins and would make other symbols available to various other kinds of useful plugins. In other words, many symbols would no longer be purely cosmetic, but could – by means of plugins – actually serve their intended purposes.

See the following forum thread for discussion leading to this suggestion:
https://musescore.org/en/node/306456


Comments

Symbols attached to a particular note can be found in its elements list (briefly mentioned here):

// suppose a note is selected
var note = curScore.selection.elements[0];
var noteEl = note.elements;
 
for (var i = 0; i < noteEl.length; ++i)
    console.log(noteEl[i].name, noteEl[i].symbol);

However for this to be useful an access to SymId enumeration is indeed necessary. It should probably be possible to do it in a similar way to what has been recently applied to the style settings enumeration. I can prepare a pull request on this, not sure whether it can make it into 3.5 version at this stage.

Status active PR created

See https://github.com/musescore/MuseScore/pull/6205

A large number of different symbols available seems to cause issues: the first time accessing SymId enumeration will cause a noticeable delay with the proposed implementation. However this will happen only once per MuseScore session, and it seems to be the only way to expose enumerations with lower-case enumerator names (Qt doesn't like them for some reason) with a traditional property-based interface (like SymId.accidentalDoubleSharpTwoArrowsDown).

Fix version
3.5.0