Automatic Part Extraction, or plugin enhancements

• Jan 22, 2012 - 04:58


Here's a feature request. I'd like to have automatic part extraction, which would work like this:

If no Parts are defined, assume one per instrument. If there are Parts defined, then use those. For each Part, create and save a file in a format selected by the user, possibly with a page style and settings defined by the user (default musescore settings would also be an option). The available formats would at least include mscz and pdf, but all export formats would be preferred. The files would be created in a subdirectory of the directory where the current score resides named the same as the current score. The file names would be named -. Parts that have the same instrument name would be automatically numbered by score order.

So, for example: suppose the user has a score file called MyMusic.mscz that contains two flute staves, one clarinet staff and one oboe staff. There are no parts already defined. The user clicks "Auto extract parts". A dialog pops up, and the user selects PDF, and Musescore Default for the page style and settings. The user clicks 'OK', and the MyMusic folder is created, containing MyMusic-Flute1.pdf, MyMusic-Flute2.pdf, MyMusic-Clarinet.pdf, MyMusic-Oboe.pdf.

This would be better than the current part extraction because 1) the user wouldn't have to create parts beforehand and 2) the user wouldn't have to go into each extracted part and save it in the desired location and format, possibly changing the page settings and style along the way.

I acknowledge that this is a super-basic way to do it, with not a whole lot of configuration available to the user, but I personally would find it very useful, and I think others would as well.

Barring the direct implementation of the feature, I'm willing to write a plugin to do this, but after attempting to tonight, I think there are some features that would need to be added to the plugin API first:

1. The ability to apply page settings and styles upon part extraction.
2. The ability to invoke the 'create part' functionality on a Part or staff, which would return the new Score object so the plugin could save it.


1. The ability to copy a staff from one score to another, including all staff text
2. The ability to load page styles and settings from a file, and apply them to a score.
3. The ability to copy whole-score objects from one score to another, eg tempo markings.

I think that would do it; someone more knowledgable than I, feel free to correct me.



I think these are some great ideas! As you may know, 2.0 will come with it one major improvement in this area: linked parts. So that kind of changes things - no more need to explicitly generate MSCZ files for each part. Buit of course, a plugin to export PDF's for all parts would be great. Right now, there is already a plugin to generate PDF's for all MSCZ files in a folder (see the plugin repository link at right of this page). For 2.0, it would probably make sense to extend this to optionally generate PDF's for all parts as well.

As for an interim solution right now, I think you've identified the issues that get in the way.

In reply to by Marc Sabatella

Yep, I've tried out that plugin - batch export I think it's called - and it works great if you've already got a folder full of part files. My problem is that, so far, I only create parts when I'm ready to send them out to players, and I haven't been tweaking them a lot. So, when I sent out four movements of a suite with 6-10 parts in each movement last week... it took a while. :-)

I haven't tried 2.0 out yet; linked parts certainly sounds like a big improvement. I guess my hope for that would be that the plugin API has access to "Save part as..." or however it's implemented. That'd make the plugin very easy to write!

In reply to by azumbrunn

Page turn optimizing sounds like an interesting problem to try to solve...

But first, I acknowledge that you use Musescore differently than I do. Myself, I will find it quite useful, since 1) most of the parts I've worked with so far are less than 1 page, 2) as I mentioned above, I already have spent an annoying amount of time creating parts, and then saving them individually... for 8-10 parts per piece... for 4 (short) pieces... when I could've had the computer do it in less than a second, 3) I usually export longer pieces to lilypond and use that for the final print, and 4) I intend to be the one to implement it, assuming the patch is accepted. :-)

I'm open to suggestions on a better implementation than I'm planning. I've considered a "Save all parts as..." file menu item instead of making it part of the parts dialog, since new features are going into 2.0 anyway, but I haven't looked into that yet. That way you could make all your tweaks, and then export all at once.

(Actually, I suspect you could get fairly close with page turn optimization with a few basic rules... I'll throw it on my personal 'things to think about' backlog)

In reply to by emeraldimp

In my case, page turn optimization is the least of the problems with automatic part extraction. I've printed hundreds of parts extracted from scores over the years (MuseScore, Finale, and Notator), and if I've ever done so without going through and adjusting line breaks, shifting text markings around to avoid collisions, adjusting enharmonic spellings of accidentals and so forth, it couldn't have been more than a handful of times. There is virtually no chance I would ever print an extracted part without spending a minute or so on cleanup.

On the other hand, once I've done that cleanup, an automatic printing routine would be lovely. Currently, the batch export plugin handles this, but as noted, this approach won't work directly for 2.0's linked parts.

Both in 1.1 and 2.0, though, the basic model for me would be, run plugin to generate the parts, then go over them manually to tweak things, then run a plugin to print the parts.

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