plugins and accidentals
I'd like to have a way to automatically add cautionary accidentals and I tried to figure out how a plugin could do this, however, plugins seem to not be able to
- know if a note actually has a (necessary) accidental
- add a cautionary accidental (userAccidental) to a note
I'm new to MuseScores' plugin framework, so the question is: do I miss something?
Comments
I don't think so, at least not for 1.2. This was actually one of the very first things I tried doing a plugin for, and I hit the same road blocks. Would love to hear that the new 2.0 QML framework improves on this, but I just haven't had the time to check it out.
In reply to I don't think so, at least by Marc Sabatella
As per http://musescore.org/en/plugin-development/note-object it should be possible, check userAccidental and tpc/pitch
Maybe my notenames plugin could be used for this?
In reply to As per by Jojo-Schmitz
The problem is to know if there's a written accidental in front of the note, because this depends on the current key signature: A C# for example would not have a written accidental in A major.
There is however no way for the plugin to know the current key signature.
In reply to The problem is to know if by heuchi
keysig is accessible in the plugin framework, see http://musescore.org/en/plugin-development/score-object and the latest version of lasconic's retograde plugin
(timesig is said to be accessible too, but is not, at least I couldn't get it to work)
In reply to keysig is accessible in ght by Jojo-Schmitz
keysig, however, is a global parameter. There is no way to ascertain the *current* key signature in music containing key signature changes or transposing instruments.
And while the userAccidental note property appears to work for *reading*, it does not appear to work for *writing*. At least, it did not as of 1.0 when I tried it last.
In reply to I don't think so, at least by Marc Sabatella
I just found a new problem:
There seems to be no way for a plugin to know on which staff a note actually is written. Eg. a note of a piano right hand staff could be moved to the left hand staff with CTRL-SHIFT-DOWN.
Is there already a place where this kind of feature requests for the plugin system are collected? Or might I just open a new feature request?
EDIT: Maybe this is not really necessary, since the Score.parts list could be used to find the number of staves an instrument has, and/or to build a table indicating to which instrument a staff belongs. This would avoid the above problem, for the plugin could work simultaneously on all staves of the same instrument.
In reply to New problem (EDIT: maybe not) by heuchi
The plugin framework is under a complete overhaul for next version. Plugin developers will have access to many more new elements. Check a nightly to get an idea.