Changing Text-Style from the Command-Line
Hello,
I have a use-case, where I need to convert a MusicXML to a PNG-file, for which I use the export-function of MuseScore. I need to call the function from the command-line, and my issue regards editing the style of text-elements in the output-file. More specifically i want to get rid of the title which defaults to the xml-filename, since it is very large for my purposes.
I am aware of the -S function, but it does not affect the Title-Text in anyway. Even though i created a .mss file where the title appears white and with a font-size of '2', when exported with -S, the title does not adopt the style.
Somewhat unrelated, but if someone happens know: Where is the .mss file referenced from when called from the command line. The default-folder of Musescore, the local folder, or perhaps a full-path is needed?
Apologies, if this question has been asked somewhere else before, but I did not manage to find an answer regarding this issue. Thanks in advance!
Comments
ISTR some issue with .mss files read from command line not working at all?
Edit: see #269491: Text styles not applied by command line option -S
In reply to ISTR some issue with .mss… by Jojo-Schmitz
It seems to not work at all.
Perhaps it is related to the issue, but I I tried spacing each part extremely close to one another, but it did not adopt that change either.
I call the command line from the music 21 library in python, where i edited the subConverter.py to work as follows:
maybe you can tell me what I'm doing wrong.
In reply to It seems to not work at all… by Tobias Geib
And also #269491: Text styles not applied by command line option -S
In reply to And also #269491: Text… by Jojo-Schmitz
So, i was able to come up with a solution for my use-case, if anyone reading this might have this specific issue as well, even though the solution is not related to musescore.
In short: I was able to remove the title in my export, by editing the temporary xml-file created by music21, to remove the title, which is then handled to the musescore.exe.
The path to the xml-file can be retrieved in the SubConverter.py at
in the .write() method.
I hope posting this is appropriate, since it is rather off-topic.
In reply to And also #269491: Text… by Jojo-Schmitz
This reported issue is partly fixed. Many style settings are taken over correctly now.
Alas it is not fixed for a number of text styles like font and size of title, font size of chords and some more.
In reply to This reported issue is… by SqueezeBoxer
@Tobias: a more convenient workaround is:
select an example of the affected text (title, chord, lyrics...), choose "select all similar elements" then go to the inspector and click "reset to style"
(My wording may not be completely correct. I post as I can remember it without access to a running MuseScore)
In reply to @Tobias: a more convenient… by SqueezeBoxer
Thank you very much, but I have to call musescore's export function with the respective styling from the command line, so therefore i cannot interact with the GUI-Interface. Maybe I misunderstand your description, but it seems I can't apply this workaround.
In reply to Thank you very much, but I… by Tobias Geib
I'm afraid you understood it right: my workaround needs opening the GUI.
My use case was adapting the layout of a whole fakebook to a layout saved as .mss style template. A batch file applied the style template to all the scores. Afterwards I opened all 200+ MSCZ files in MuseScore and did that "reset to style" to the texts that were not updated correctly (together with some proof reading of the scores).
In reply to I'm afraid you understood it… by SqueezeBoxer
Thank you regardless.
Maybe this method will be helpful for other users with a similar use case.
In reply to Thank you regardless… by Tobias Geib
to answer your question from the beginning:
"Somewhat unrelated, but if someone happens know: Where is the .mss file referenced from when called from the command line. The default-folder of Musescore, the local folder, or perhaps a full-path is needed?"
I specified the path to the .mss file with the -S option. Putting the .mss in the same folder as the MSCZ worked as well as specifying a full path or a relative path like .\MyStyle.mss or ..\MyStyle.mss
For further clarification I attached my batch file. It applies a style to all MSCZ files in a directory.
To use it it is required to edit the path to Musescore and the mss file and rename it to .bat.
At the time when I wrote and used it, I had to use a nightly build to include the relevant fixes. MuseScore 2.2.1 should also work, but I didn't try it yet.