Add page and system breaks via command line
We should add a command line option to freeze the layout of a score by adding manual page and system breaks in places where automatic breaks occur. For example:
mscore --freeze-layout score1.mscx score2.mscz
mscore --freeze-layout infile.mscx -o outfile.mscz
This is useful to enable other programs to read MuseScore files and work out where the pages and systems go without having to do expensive layout calculations. It also provides a way to "lock-in" the layout of a score before opening it in a newer version of MuseScore that uses a different layout algorithm, which would otherwise result in page and system breaks occurring in different places.
Use case: Music Braille converters need to know where page breaks occur so that they can provide print page references to facilitate blind and sighted musicians working together. High quality converters cannot depend solely on MusicXML because the specification lacks certain features necessary for Braille, hence they must use MuseScore's internal format.
Comments
Are you saying such converters exist, or are being worked on? Would they be superior to the built-in Braille export within MuseScore that was just merged from Andrei a week or so ago?
Anyhow, we do have a built-in facility to lock current breaks, so the code is there, exposing it via command line should be simple enough. Actually, we'd probably first want to factor the code out to make it accessible as an independent command - right now it requires use of a dialog to select this.
@Marc Sabatella, a Vietnamese non-profit called Sao Mai Center for the Blind is working on adding music capabilities to their Sao Mai Braille (SMB) program, which currently produces literary Braille from text documents. They hope to use MuseScore files directly just like they already use Microsoft Word documents.
When I make scores to be converted to braille for hhpmusic I always use hard system and page breaks for the reasons explained by Peter. He exports them to musicxml then converts them to braille using a program developed for this purpose.
It is even an option in the Edit > Preferences > Export dialog to export all (implicit) system and page breaks explicitly. So the functionality exists already, just needs a command line option to force it on.
As far as I understand this option currently works only with MusicXML export so that would need to be adjusted to other formats too.
However it seems to be possible to automate this with a plugin. I have created such an example plugin (attached to this comment) to put layout breaks where needed. This plugin at its current state requires MuseScore 3.6 (as the previous versions lack
nextMeasureMM
property and thus would make it difficult to handle multi-measure rests), doesn't handle excerpts and seems to work best with scores that are already saved with the latest MuseScore version (as layout may change after saving a score otherwise). Existing layout breaks are replaced — maybe this behavior needs to be changed for section breaks. However it seems to be able to do what is needed here, and it works with a command line. To use it that way you need to put the plugin to Plugins directory and execute something likeTrue, musicxml only, bit that is what the braille converter needs anyhow?
If I understood @shoogle's post correctly, the intention is to eventually start using MuseScore format directly in some of those converters.
Maybe. But for MusicXML we have everything in place already, that's all I wanted to mention
@dmitrio95, correct. A good Braille converter must use MSCX rather than MusicXML due to the following limitations in MusicXML:
Thanks to @hhpmusic for telling me about the above limitations which are important to Braille conversion.
1 to 5 are inherit limitations (i.e. missing from the MusicXML specification); they are not the fault of MuseScore's exporter. Most of these should be addressed in the MNX specification when that finally arrives.