Batch-editing score style on roughly 100 scores.

• Apr 7, 2021 - 21:19

I have a collection of scores that I notated with MuseScore 3.5 and earlier. I recently upgraded to 3.6 and did my first score with the new fonts Edwin and Leland. I'm making a fakebook out of these scores, using xelatex and \includepdf. So MuseScore is responsible for turning the style of each score, and turning each score into a PDF and LaTeX is responsible for ordering the scores, numbering the pages, and generating a table of contents.

With the new engraving defaults, new scores will look different from the old ones. I'd like to make them all consistent, by either bulk-editing them to use the old fonts, or bulk-editing them to use the new fonts. While I'm at it, I have problems with page size, because MuseScore never remembers that my default page size should be US Letter -- so I'd like to fix this with a bulk edit.

Is there a way to bulk-edit the styles of about 100 scores?


Comments

Probably the bulk edit could be done by creating an MSS file, then using command line conversion. I've never tried it so you'd need to do some experimentation.

But, for the default page size - MuseScore takes this from your default printer's default paper size. It normally works OK, but for whatever not on Linux, which I'll guess maybe you're on since a) you mention this as a problem, and b) you mention LaTex, which probably few people outside the Linux world use. On Linux, even with a default printer set to Letter default, this doesn't work, the default is A4. At least on many Linux systems.

Best workaround I've found is to create an MSS file containing only the page size settings (including the margin settings) and make that your default style in Edit / Preferences / Score.

To create an MSS file, set up a score the way you want and use Format / Save Style. Attached is my letter-sized MSS file, which I've edited to remove everything else so you get whatever the defaults are already.

Attachment Size
letter-score.mss 544 bytes

In reply to by Marc Sabatella

Your assessment that I'm on linux is correect.

This is mostly working for me, but I'm ran into several difficulties.

  1. The manpage says that I can use the -S or --style flags to specify the mss file. However, apparently Qt wants to use --style to specify a user interface style instead, so only -S works. The manpage should be updated, and the --style flag should possibly be renamed.

  2. xelatex thought that some of the PDFs generated by Musescore 3.6.2 were corrupt. xelatex was not kind enough to tell me which ones, however. I was able to work around that problem by post-processing them with gs, as described at https://stackoverflow.com/a/44564933

  3. I'm having trouble with scores that were originally written in Musescore 1.x, and later converted directly to Musescore 3. In these scores, applying the .mss file doesn't fix the title or lyrics fonts. "Format -> Reset Text Style Overrides" in the GUI doesn't help either. Hitting "Remove Custom Formatting" in the inspector does, but I ahve to select all of the lyrics first, so it would be quite tedious to fix even within a single score. Any ideas how to solve this problem in bulk? Example score

In reply to by Ken Bloom

  1. As far as I can see there's no --styleoption on Qt, see https://doc.qt.io/qt-5/qguiapplication.html#supported-command-line-opti…
  2. Can't comment on that
  3. MuseScore 1 indeed tedend to 'embed' font face and size into the texts. Your sample score however stems from MuseScore 3.2.3 (got last saved with it), not from MuseScore 1.x. But indeed it does seem to have a 1.x history of sorts. No way to automatically get rid of those, you might be able to save them as mscx and then process these files to remove that customer formatting using some Linux text tools, like sed and awk, removing stuff like <font face="Times New Roman"/> (and <font face="MScore1"/> too). It is not just the lyrics, also tilete, subtitle and instrument names, and some more too, like Volta text. Esp. annoying to get rid of are these font settings in Instrument names and volta texts (or any other line texts): there's no "remove custom formatting' button in the inspector for those

In reply to by Jojo-Schmitz

Regarding #1:

When I run

musescore -o Adon_Olam_2.mscz --style style.mss Adon_Olam_2.mscz

the following appears on my console.

QApplication: invalid style override 'style.mss' passed, ignoring it.
        Available styles: Breeze, Oxygen, Windows, Fusion
Creating main window…
Reading translations…
convert Adon_Olam_2.mscz...
        to Adon_Olam_2.mscz
... success!

(I've removed the angle brackets since I can't get them to format properly in the forum)

When I run

musescore -o Adon_Olam_2.mscz -S style.mss Adon_Olam_2.mscz

the following appears on my console.

Creating main window…
Reading translations…
convert Adon_Olam_2.mscz...
        using style style.mss
        to Adon_Olam_2.mscz
... success!

https://wiki.archlinux.org/index.php/qt mentions the -style flag, and I'm using Manjaro linux with Qt 5.15.2

Regarding #3, I was hoping for a plugin with that I could use with -j, but uncompressing and using general text processing or xml processing tools is much easier.

    for x in **/*.mscz; do musescore $x -o ${x/mscz/mscx}; done
    xml edit --inplace --delete '//ChordList' **/*.mscx
    xml edit --inplace --delete '//font' **/*.mscx
    for x in **/*.mscx; do musescore $x -o ${x/mscx/mscz}; done

In reply to by Ken Bloom

Starenge that Qt itself does now document a -style option, so this might be an Arch/Manjaro Linux speciality, however -style is not the same as --style so either that documentation is wrong or that option has a bug (in Manjaro or Qt).
Also a MuseScore build with Qt 5.15.2 won't be the official version as it comes from musesscore.org, where it'd be the AppImage for Linux, which uses Qt 5.9. So unless the AppImage fails on a `--style? option, there's no bug to fix nor handbook- or manual page to change, not on the musescore side of things.

Anyway, there's -S to the rescue...
That xml edit seems a nifty tool!

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