How to render empty staves in CLI pdf export?

• Jun 22, 2025 - 03:51

Hello friends,

I'm attempting to script MuseScore 4 to convert musicxml files to pdf via the Linux command line, eg:

mscore --score-parts-pdf ./foo.musicxml | jq -r .fullScoreBin | base64 --decode | base64 --decode > foo.pdf

(duplicate base64 call is because of issue #27531)

Unfortunately, MuseScore 4 automatically hides empty staves on import/export, and I would like them to always be shown in the resulting pdfs.

Is there a way to override this setting, either by passing a CLI option, editing a config file, or some other way?

The example I'm using is this musicxml file, taken from the MusicXML example sets

Finally, a feature request, I believe that when importing any file that isn't .mscz/.mscx, empty staves should never be hidden by default.

Thanks in advance!


Comments

Might be different in Linux, but in Windows I think MuseScore is just opening your score as it was saved.

I opened it and unhid the staves. Then saved it. It opened in both MuseScore and Sibelius without hidden staves.

In reply to by bobjp

Thanks for your response! It didn't occur to me to try to just re-export it. If I do that and open the new file, no staves are hidden, so I wonder if there is a musicxml import/export bug?

mscore --export-to ActorPreludeSample-2.musicxml ActorPreludeSample.musicxml

This workaround works for me. Thank you again for your help!

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