PruneStack - a plugin to prune vertically stacked (block-voiced) notes

• Sep 16, 2016 - 08:07

Here's a first video demo of a plugin I'm working on:


In the demo, I have an example piano sketch with 4-part block voicing of a melodic top line. The assumption here is that copy/paste and Explode, while incredible tools, not exactly efficient in this case, specifically, where I want control over which "levels" of the vertical stack harmony I want to move to a specific instrument.

As you can see, once I have the Flute part, the 1st Trumpet part is also complete - so that's a case where copy/paste makes sense for that single line.

Where (I think) a tool like PruneStack shines is that it (potentially) helps to eliminate some of the manual note selection and clicking that one must do to manually "prune" out notes from a copy/paste operation. Since my workflow is often to go from a sketch where there may be many stacked chords in any given region of my score, a tool like PruneStack makes sense to me, and hopefully others.

Again, this is a work in progress. I'm seeking general feedback at this point. The UI isn't ideal but it's a start. Once I get some feedback and I have more time to refine this and possibly add more features I will make the code available for others to use and to improve upon!


In reply to by Isaac Weiss

The script is currently not handling jagged chord stacks yet but that's a good suggestion and it should be possible.

In that scenario notes outside the vertical chord stack size for pruning would simply be ignored.

So if you had two chords:

Ab C Eb G

...if you specified to prune the 2nd and 3rd notes from the stack you'd be left with:

Ab G

...if you specified to prune the 3rd and 4th notes from the stack you'd be left with:

Ab C Eb

...I like that approach! The entry of a "Stack Size" value might be sort of irrelevant then.

Again, my current approach assumes a symmetric vertical stack but I like the jagged approach much better and will update my script when I get the chance!

Here's a link to the current version in BitBucket:

The current status:
* handles different size chords!
* slightly better UI
* a bit more robust...trying to prevent crashes as they annoy me too!
* It's working pretty good for me.

Interested to see if any folks want to improve on this. Some features I'd like to see:

* ability to set a selected level within a chord stack to a different layer! (tried this in an earlier version but wasn't working for me!)
* better UI...fonts are currently too small, could use a better layout, etc.
* handler if user closes the window with anything but the Close button

I"ve updated the UI a bit...made some minor tweaks. MuseScore is really nice to be able to add plugins. I'd seen the "Plugin Creator" menu item for a long time but never really "got it" until that last month or so...

I've been dabbling with some sort of functionality in this plugin to move ONLY the selected notes in a chord stack level to another voice...that would be useful (for me at least)...I don't currently have that one working but it's sort of stubbed out...

The source/script is here if anyone has any suggestions or feedback:


Attachment Size
PruneStack-002.png 231.77 KB

In reply to by stevel05

As for the's not perfect! It should probably make better use of some more advanced UI concepts so that it scales nicer on various resolution screens...but it's a work in progress...

I'm not new to programming, but Qt and QML were new to me...I downloaded the Qt Creator IDE (community edition) to understand how to lay things out...that's how I was able to mock up something up initially...the UI evolved a bit from there...

So again, many improvements with the UI are possible but they will have to come when I have more time to dabble...currently just x/y plotting of UI elements...but Qt and QML are pretty neat...didn't know much about them until recently despite using MuseScore for over three years now!


In reply to by rob@birdwellmu…

There is always something else to do. Whether writing music or programs :).

I'm the same as you, been programming for years, but just found Qt and QML, so it should be OK when I understand how it all links together.

I'm also new to MuseScore, I downloaded a version a while ago but never gave it the time to get to know it. I like it too now I'm beginning to find my way around.

Thanks for sharing your plugin. I don't have an immediate use for it, but it's very handy to have in the arsenal. And the more current code there is to look through, the easier it will be to get up to speed writing plugins.


Hey Rob,
I noticed that I wanted to have the functionality to change [level x] of chords to a particular voicing, and it seemed like Prune plugin would be thing but it doesn't quite do it. The pruning function works just fine, but instead of Prune and change to voice-x, I figured just "change to voice-x" would be better and apparently there's a way to "deselect" elements in such a way that makes this functionality very easy. And now there's a select element with "add" functionality. At any rate, here's the result on this post:

Not sure if you're interested or not, but figured why not :)

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