Can this be done in a plugin?

• Nov 5, 2013 - 10:03

Here's a topic I started about colouring notes. I thought maybe someone can give me a quick answer whether this is possible or not in the old and/or in the new plugin framework.
What I want to do is select a bunch of noteheads in a score (click at first notehead, then ctrl+click at the rest), then run the plugin, which will colour the first note bright red (#ff0000), the next selected notehead a bit darker, next one yet a bit darker until the final one would be almost black (#080000 something).
For this the plugin needs to know the number of noteheads marked. And it needs the access to change the colour of the notehead.


Comments

In reply to by Jojo-Schmitz

It may be better in the new / upcoming framework, but in the current one, it wouldn't be able to work exactly as described, because the notion of "selection" in the plugin framework is limited to contiguous regions - eg, that which would display with a blue rectangle. Discontiguous selections made via Ctrl+Click are not accessible.

In reply to by Jojo-Schmitz

Then I must say I'm surprised how bad the frameworks work. I mean, I can ctrl+click a bunch of notes and run the MuseScore built-in functions to operate on them. Like colouring them. But the plugin framework doesn't reach the same selections as the built-in functions.
Do you mean to tell that the plugins can't see any other selections than those that are marked with a rectangle?

Seems a good idea to think loud on this forum, before start banging head against a brick wall.

Since my idea is to colour different voices in fugues, I would depend on that each voice be written in its own voice in MuseScore. Here's one section from one DWC fugue.

dwc.png

I've clicked on first note of the theme, then shift+clicked on the last note to get the selection (blue note heads, voice 1). At the same time I got notes of another voice selected (green note heads, voice 2).

Now I want to run my plugin, which would only colour the blue notes. Will the plugin framework let me find the voice 1 notes, count them and colour them? Will the cross stave thing cause problems? Seems if I do a treble stave selection, all cross stave notes in bass stave will be selected.

Attachment Size
dwc.png 13.3 KB

In reply to by jotti

I would say yes: both the old and the new plugin frameworks allow you to parse the selection shown in the image and separate the different voices.

Cross-staff should not be a problem, as it is mostly a visual thing: for instance, the B in the first (shown) measure DOES belong to voice 1 of bass staff, even if it is shown in the treble staff, as it becoming selected when you selected the bass staff demonstrates.

As for the plugin framework's inability to deal with Ctrl-click selections: yes, it is a limitation. The plugin framework still has significant limitations; it is mostly a matter of priorities: making the main programme stable and reliable is currently the top priority of the dev team.

Thanks,

M.

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