A plugin to transpose a score from the command line
Hello alltogether!
I have searched for a possibility to transpose a score from the command line, but have had no luck.
What I want to do is to maintain jazz lead sheets mainly for C, Bb and Eb automatically with a make file, something like this Makefile snippet:
Bb/%_Bb.mscz: %.mscz
-TAB- mscore -p transpose -2 $<
Eb%_Eb.mscz: %.mscz
-TAB- mscore -p transpose +3 $<
For the curiosity: I play the alto flute myself and therefore also need to transpose to G.
Maybe it would be better to implement this as a regular command line option?? The advantage with a plugin, would be that one could change the title of the score to indicate that it is transposed for e.g. Bb instruments.
Now to the problem: I haven't found a method "transpose" that could be applied to a score. Is this found somewhere else? Also, how do I access cli parameters, as in this case -2 and +3? I do realize that the minus sign might be unsuitable, as it probably will be caught by the mscore program itself and never be passed to the script.
With a little bit of advice on these topics, I would probably be able to write the plugin myself. But if someone already has a solution, it would be great!
Thanks: Håkan
Doing this with a makefile has the problem that spaces in filenames don't work at all
I've been doing this to created pdf from mscz, but are now using the batch export plugin, which does a much better and easier job
So go for doing it in a plugin...
Well, I do use the Makefile to export to .pdf too, but as I never use file names with spaces, it is not a problem for me:-)
You might like my Makefile then
I've thought of doing something like this, too, not as an automatic makefile type of thing but just for the current score. I ended up putting it off as there was no way way to get at the current score's filename, and because transposing from within the framework is not complete. It seems you can change individual pitches, but there is no way to get at the chordnames. Also, I would have wanted to do some enharmonic "correction" of the transposition using the TPC mechanism, but that didn't seem to work, and I gather there are significant changes to how that works in 2.0.
Since I've already gone ahead and implemented a makefile-like solution for the batch export plugin (in that it figures out what needs to be done and what doesn't for that purpose; it's not an actual "make" implementation), it does seem it would be pretty easy to adapt that plugin to do a transposition - *if* you could get the transposition to work.
I can think of any number of situations where getting at the chordnames would be useful, but I also recognize that figuring put a way to represent those chords, and a way of returning chords not attached to a note, would be challenges to overcome, and again, this all changes for 2.0. So while I'd still eventually love to get at those chordnames, a "transpose" method that would be attached to the score objector perhaps the cursor (to work on a range), might be simpler to actually implement in the framework as well as be simpler for plugins to use.