Need Plugin Example - How to Delete Note(s) from a Chord in MuseScore 3.x
Can anyone provide a snippet in QML for how to delete one or more notes from a chord? (from the current selection.) I was able to do this with my PruneStack plugin for 2.x but the code that conditionally "deletes" (or prunes) selective notes from an array of chord stacks no longer works in 3.x. (All of the other functionality does, so I'm just blocked on the specific way to "delete" notes from chords in 3.x.)
I'm assuming this is due some changes to the API.
Here's my PruneStack plugin in github - again, this code works in MuseScore 2.x and I would love to get it working for 3.x at some point! For me, this plugin is useful in those cases where "exploding" a stack of notes isn't always possible or ideal and when one simply wants to "prune" out one or more levels of notes from a blocked voice melodic line.
https://github.com/birdwellmusic/PruneStack
Thanks for any help/tips MuseScore community/developers!
Comments
While the add/remove functions still exist on the Chord cpp end ( https://github.com/musescore/MuseScore/blob/master/libmscore/chord.h#L1… ) they have not yet been moved/ported into the 3.x Plugin API wrapper ( https://github.com/musescore/MuseScore/blob/master/mscore/plugin/api/el… ) and are thus indeed unavailable currently.
Feel free to enter this into the issue tracker.
In reply to While the add/remove… by jeetee
Hi,
Could you please describe what exact properties/features are missing for your QML that were available in 2.0?
-Dale
In reply to Hi, Could you please… by DLLarson
On line 176 of the 2.x QML version (see below), the chord's "remove" method was available
...e.g., chord.remove(...)
Working in MuseScore 2.x
https://github.com/birdwellmusic/PruneStack/blob/master/prunestack-2x.q…
See TODO: comments - chord.remove(...) doesn't seem to be exposed yet for 3.x.
https://github.com/birdwellmusic/PruneStack/blob/master/prunestack-3x.q…
I have submitted an issue tracker for this:
https://musescore.org/en/node/291790
In reply to On line 176 of the 2.x QML… by rob@birdwellmu…
Hi,
You had an additional "broken" feature tagged...
>endTick = curScore.lastSegment.tick + 1; // TODO: broken in 3x
What is the problem with this?
In reply to Hi, You had an additional … by DLLarson
possibly - not related to this, but something I flagged as that line may not be correct. At the time it was throwing an error. It may be a simple matter of following the pattern that other QML scripts use for selection...
In reply to possibly - not related to… by rob@birdwellmu…
Ok... Thanks.
Looking at the 3.0 internal Chord::remove() implementation, it looks nearly the same as the 2.0 version so that's good. I'll dig deeper on it. It should be EZ unless I run into a gap in the undo system.
>I will submit an issue track for this (unless of course there's another way to achieve this in 3.x) - thanks!
Please do! That will allow tracking the GIT pull request against the issue.
-Dale
In reply to On line 176 of the 2.x QML… by rob@birdwellmu…
You mean #291790: Port the add/remove functions that exist on the Chord cpp end into the 3.x Plugin API wrapper ;-)
(notated as [#291790])