Generate PDFs for parts using command-line

• Apr 1, 2021 - 20:49

I am writing a script that will generate parts for a large number of scores and automatically sort the part-pdf-files into separate folders for each instrument.

Is it possible to generate individual PDFs for the parts of a score using the MuseScore command line arguments?

I have read the description of the command line arguments and done a bit of experimentation, but failed to find something that worked.

musescore --export-score-parts -o my_file.pdf myscore.mscz

generates one big PDF. I need separate PDFs for each part.

The command-line argument --score-parts is described as:
Generate parts data for the given score and save them to separate mscz files
I.e. it is supposed to generate a new mscz file for each part (which I guess I could then convert to a PDF). But it does not happen. When I try this, it just prints a lot of stuff on the screen. No mscz files appears anywhere.

You would think that the command-line argument --score-parts-pdf would be what I am looking for, but it is described as:
Generate parts data for the given score and export it as a single JSON document to stdout
And indeed it also prints a lot of stuff on the screen, some of which looks like JSON. No PDF files are generated anywhere, as far as I can tell.


Comments

In reply to by AndreasKågedal

I had great success in MS v3.6 generating parts in individual files using the -j .json method. I could generate a complete set of conductor and parts scores, then I used pdfinfo and pdfunite to add blank pages to build a book the reads correctly with each part's scores grouped in individual chapters. I use Ubuntu 22.04 Linux and run the conversions from a bash shell script. It only takes 6 minutes to convert 65 files with 90 minutes of MP3 runtime, which I find remarkable. I have a 3.6GHz Ryzen 5 PC clone with 32GB RAM.

In MS v4.1.1, I can only get parts to render using the -P -o options. Those converted parts are included in the PDF with the complete score, which is not good for me. The resulting book is not organized as desired. All the parts for one player should be separable from the rest of the scores. I haven't figured how to do this reorganization short of breaking up the PDF and re-organizing it by hand.

Additionally, in v4.1.1, the .json can only have one conversion per record and the parts conversion never seems to work at all.

Not working in v4.1.1 but works in v3.6:

[
{
"in": "/home/musical/Documents/MuseScore/Scores/1-03_-01j.mscz",
"out": "../Support/OUT_prod/1-03_-01j.pdf",
"out": ["../Support/OUT_prod/parts/1-03_-01j_", ".pdf" ]
}
{
"in": "/home/musical/Documents/MuseScore/Scores/1-03_-01j.mscz",
"out": ["../Support/OUT_prod/parts/1-03_-01j_", ".pdf" ]
}
]

Also not working in v4.1.1:

[
{ "in": "/home/musical/Documents/MuseScore/Scores/1-03_-01j.mscz",
"out": [
"../Support/OUT_prod/1-03_-01j.mp3",
"../Support/OUT_prod/1-03_-01j.pdf"
]
}
]

Works in v4.1.1:

[
{
"in": "/home/musical/Documents/MuseScore/Scores/1-03_-01j.mscz",
"out": "../Support/OUT_prod/1-03_-01j.pdf"
},
{
"in": "/home/musical/Documents/MuseScore/Scores/1-03_-01j.mscz",
"out": "../Support/OUT_prod/1-03_-01j.mp3"
}
]

The .json conversions on MP3 and single PDF are working for me, but must be single records whereas in v3.6, it appeared to benefit from a single "in:" load and several conversions. In v4.1.1, every "in:" can only have on line of "out:".

Also, v4.1.1 prints a single page PDF unless I have Page view selected, and I am getting MP3 files with muted instruments (imported from v3.6 and possibly a little shaky still) playing and not muted in the .json converted MP3 even though the export using the menu produces an MP3 with the muting rendered properly.

It's great software, and I'm grateful for it, but there are a lot of time-consuming issues hitting on automation and differences with v3.6 behavior.

I will see if any of the above can find a home in GitHub https://github.com/musescore/MuseScore/issues/. Thanks for listening.

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