lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

script for running convert-ly on multiple files


From: Jonathan Kulp
Subject: script for running convert-ly on multiple files
Date: Sun, 24 Aug 2008 07:40:47 -0500
User-agent: Thunderbird 2.0.0.16 (X11/20080724)

Dear Lilyponders,

I thought I'd share a script I wrote for running the convert-ly process on batches of files. I realize a script like this is trivial for experienced users, but I'd been doing conversions one file at a time myself until I learned how to do this kind of script, and I figured there were probably others like me who could benefit. It's an enormous relief being able to convert dozens of files in one command. I've tried it out on a few orchestral pieces with lots of \include files from Mutopia and it works very well. It won't fix problems with the original files but it does update the syntax. Two of the three orchestral pieces I converted compiled perfectly after the conversion. Give it a try if you like, but heed the warning in the comments if you're running it on your own files. (Before I inserted the "sleep 1" command, it would occasionally save empty files, but I haven't had a problem since putting that in). Save the script in your ~/bin directory, make it executable, and run it.

Best,

Jonathan

--------------------------------------------------

#!/bin/bash

#*************************************************#
# This script updates the syntax of all lilypond  #
# files in current directory.                     #
#                                                 #
# WARNING: This will also overwrite source files! #
# Be sure to make a backup copy of all of the     #
# source files before running this script, just   #
# in case of problems.  Or, comment out the line  #
# that performs the "mv $LILYFILE-new" command.   #
#*************************************************#

for LILYFILE in *.ly
do
  echo "updating syntax on $LILYFILE..."
  convert-ly $LILYFILE > $LILYFILE-new
  sleep 1
  mv $LILYFILE-new $LILYFILE
done


--
Jonathan Kulp
http://www.jonathankulp.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]