Add "Unroll Repeats" to command line options
Hi,
I'm using MuseScore for a learning app. I create panoramic no-repeats scores from regular files. It would be great if you could add this option to the command line interface.
Otherwise I have to write and improve my own unroll method which is not ideal and there are so many repeat symbols.
Comments
I think you can run a plugin via the command line options, so perhaps a doable workaround is to have a plugin that executes unroll and saves/export the result?
In reply to I think you can run a plugin… by jeetee
Yes, I was looking through the source code of plugins.
There are many issues: a plugin needs to be enabled first, seems like such a plugin needs to run the QT UI and I use server-side headless execution, although with a trick: xvfb-run
musescore.run=xvfb-run -a -e /dev/stdout /usr/local/bin/musescore-portable
So far I could unroll the repeats with cmd('unroll-repeats') but how do I save the result?
When I run cmd('file-save') I'm getting an error ("Open Temp File frost_unrolled.mscz.temp failed: Bad file descriptor").
How do I "save as" ? There is cmd('file-save-as') but how do I pass a parameter?
Too many questions and no guarantee it's going to work on the server.
In reply to Yes, I was looking through… by octavian.app
I think (but this is a guess) you might be able to find the unrolled score inside the
scores
list and then usewriteScore
on it, by looking at https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/class…In reply to I think (but this is a guess… by jeetee
Nah... My plan is to enhance my unroll method and wait for MuseScore to add this feature to the command line interface. I already use --dump-midi-out, --trim-image 0 -o with svg export and it works like a charm. So I'll wait for --unroll-repeats.
In reply to I think (but this is a guess… by jeetee
I created my own custom build :) Maybe it's not perfect, but it does what I need. Long live open source.
https://github.com/musescore/MuseScore/compare/3.6.2...geniot:MuseScore…
In reply to I created my own custom… by octavian.app
Guess I'll 'steel' that code and add it to https://github.com/musescore/MuseScore/pull/9000
In reply to Guess I'll 'steel' that code… by Jojo-Schmitz
Just be careful and merge selectively, I disabled many things to speed up my custom build.
In reply to Just be careful and merge… by octavian.app
Noticed that.
If you PM me your (GitHub) email adress, I'd attribute it to you properly
What about porting this to master?