A General-Purpose Makefile for Batch Processing MuseScore Files

Anonymous
• Jul 6, 2012 - 17:42

Hi,

Attached is an early version of a general purpose Makefile for automatically generating various forms of document from .mscz sources.

Just copy the Makefile into a directory containing MuseScore files and type 'make help' to see what types of file can be automatically generated. Currently the script should generate FLAC, MIDI, mxl, xml, PDF and OGG files. eg. 'make pdf' will invoke MuseScore to convert all .mscz files in the current directory into .pdf files.

N.B. I had to rename the Makefile to Makefile.txt to upload it here - you should rename it to just Makefile in order to use it.

There are loads of ways of doing this kind of thing, the nice thing about using Make is that it will regenerate whatever is appropriate after any source (.mscz in this case) file change.

I expect I'll refine this more over the next few weeks.

Hope someone else finds it useful - I use it on Ubuntu 12, it should work on any platform that supports GNU Make.

Steve

Attachment Size
Makefile.txt 2.11 KB

Comments

Definitely nice, especially for Linux users who are more accustomed to running command line utilities like "make". Meanwhile, as for the "loads of ways of doing this kind of thing", note there is also the Batch Export plugin available via the repository that is quite similar.

In reply to by Marc Sabatella

As Marc mentioned, the Batch Export plugin should do this too. See also the discussion that lead to that plugin, I started doing this with make as well.
That plugin meanwhile evolvend into a batch converter...

There are some serious restriction and disadvantages to the make method though:

  • make is not usually available on Windows and make it available there is not exactly lightweight, so that solution is not as univerally usable as the plugin
  • make can't deal properly with filenames containing blanks, the plugin doesn't have that problem
  • make doesn't come with a gui, like the plugin
  • the pligun is translated in several languages
  • make doesn't cater for files that can be input and output, like midi, xml, mxl (make clean wipes them), the plugin does take this into account

One advantage, the make method works in the current nightly builds, the plugin does not. But there's hope this can get fixed before the final 2.0 hits the street ;-)

Pleaser give the plugin a try on Linux, if it doesn't work there, tell Marc and me and we'll try to fix that.
Also feedback about possible improvements are welcome

SteveMerrony
Jul 7, 2012 - 12:03

In reply to by Jojo-Schmitz

Hi,

Your plugin sounds really useful, but I seem to have talked myself into using the 2.0 series now - so the plugin is a bit of a moot point at the moment :-/

Some thoughts though:

  • make is not usually available on Windows and make it available there is not exactly lightweight, so that solution is not as univerally usable as the plugin
     -  Linux through-and-through here :-)
  • make can't deal properly with filenames containing blanks, the plugin doesn't have that problem
      -  True - could be fixed, but then if you use spaces in filenames then you probably have other problems ;-)
  • make doesn't come with a gui, like the plugin
      -  For my use case this is an advantage, I want to run a bunch of updates unattended on a nightly basis
  • the pligun is translated in several languages
  • make doesn't cater for files that can be input and output, like midi, xml, mxl (make clean wipes them), the plugin does take this into account
      -  True - I should be clear that I assumed MuseScore is the ultimate source

      Nevertheless, I look forward to using the plugin when it gets into the 2.0 series, it will definitely be a boon.

In reply to by SteveMerrony

I've tried to fix the 'blanks in filernames' problem and after much googling I gave up, seems the general consensus was that make can't do this in any usefull form. So I'm still using _ instead, even thoughthe plugin doesn't need it.

Another advantage of the plugin: in can travers a whole directory tree.

Actuylla the lack of being able to use this plugin currently keeps me from using 2.0...

But yes, for the currently nightly builds a makefile is the way tro go. You may want to have a look at my makefile in that other thread I mentioned, and combine some of its ideas into your's?

SteveMerrony
Aug 3, 2012 - 12:24

In reply to by Jojo-Schmitz

Hi,

I've continued to refine the Makefile as I use it quite a lot.

Here is a new version with the following changes...

Performance: add quiet flags (c.20% faster on test machine)
New Feature: 'backup' target
New Feature: 'book' target
New Feature: LilyPond, PostScript & SVG generation
New Feature: look for style (.mss) file and apply it to LilyPondPDF/PS/XML generation
Improvement: better help (make help)

As before, I had to rename it to Makefile.txt to upload it to this site - rename it to Makefile before you try to use it.

Caveats: it's aimed at GNU users, it doesn't handle filenames containing spaces.

Attachment Size
Makefile.txt 4.22 KB

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