extensions to plug-in architecture

• Mar 5, 2011 - 17:20

I have been accumulating a list of things I thought I might be able to accomplish via plug-ins, but am finding that for various reasons, I can almost but not quite get there in each case. I suppose I'm stating the obvious, but I think a little work put into extending the plug-in architecture could go a long way. I for one would be able to start producing some plug-ins for 1.0 right now, even though I'm not ready to dive into main application source.

Here is the list of plug-in ideas I was toying with - some of which you may recognize from feature requests I've made or commented on:

- automatically add courtesy accidentals
- pitch respell algorithm that operates on a selection, conforms to any chordname info, and accepts user preferences for things like spelling of B# versus C when the former is technically correct
- toggle enharmonic spelling of selected note
- insert rests in empty voice to use as points of attachment for mid-measure chord symbols (and another plug-in to delete these rests when done)
- facility to rename any/all staves of a score, and perhaps set other attributes like transposition, within one dialog
- double/halve length of notes in a selection
- explode selected chords on one staff into single note lines on multiple staves
- implode selected single note lines on separate staves into chords on one staff
- explode/implode for multiple voices within a staff (as source or destination)
- copy/paste specific items within a selection (like just the chords, or just staff texts, dynamics, and hairpins, or just specific voices)
- create cues (select passage in one staff, small size non-playing notes with appropriate labels automatically created in another)
- create slash notation (either stemless slashes one-per-beat, or "rhythmic notation")

Some of these things are probably better done in the main application source in the long run, but a lot of these seem like perfect opportunities for a plug-in, even if just as in interim solution. However, I don't think any can be done as I'd like. Mostly, it's the same few limitations I keep running into:

- setting voice for a cursor has no apparent effect, even with a rewind(), so I can only work with voice 1
- setting userAccidental for a note has no apparent effect, so working with pitch spelling is crippled
- need ability to access a single selected note
- need to access existing items other than notes or rests (eg, chordnames, text elements, hairpins, articulations)
- need to be able to create more of these items (hairpins, articulations, etc)
- need ability to access (read/write) more note/rest properties (velocity, notehead, stem, etc)
- need ability to access (read/write) more staff properties (long/short names, transposition)
- need ability to access (read/write) clipboard
- would love ability to run a plug-in via a keyboard shortcut

Some of this might be present but undocumented (or in the case of voices and userAccidental, it could be user error). Pretty much anything on that list of limitations I can cross off would allow me to knock off at least one of my proposed plug-ins, so if it is just a matter of missing documentation or user error, I'm hoping someone can fill me in. Otherwise, consider this my wishlist for extensions to the plug-in architecture.


Comments

I've since figured out that the "voice" property isn't as ineffective as I thought. As long as I don't try to set the cursor via a selection, I can read the contents of different voices, and I can set properties on existing notes. But adding new notes or rests in any voice but 1 tends to crash MuseScore, and I still can't figure out how to access voices within a selection.

Do you still have an unanswered question? Please log in first to post your question.