LilyPond on Leopard
For my musical notation needs, I use LilyPond.
LilyPond is to music as LaTeX is to writing. I prefer to edit LilyPond files in Vim and compile them with lilypond at the command line. However, on OS X LilyPond.app is a front end to the compiler. An IDE of sorts. Not a spectacular one, in my opinion, but it does have one thing going for it: when you click on a note in the PDF preview, it takes you that note in your LilyPond source file in the IDE.
On Leopard, LilyPond is severely broken. The IDE will “start”, but there is no menu. Further, if you are on Intel, when you try to run it at the command line, it just keels over and does nothing. It so happens that the workaround to this problem and using LilyPond without the IDE are almost identical solutions, so I’ll describe them as one and the same.
First, and this is the only difference between Leopard brokenness and just wanting to run on the command-line, you want the powerpc version of LilyPond.app, not the Intel version. So go over to the download page and get the ppc version (the one that says it’s for G3, G4, G5 Macs).
lilypond and its friends are in Lilypond.app/Contents/Resources/bin. You could add this to your PATH, but some of the binaries in there are things that I have installed elsewhere (e.g. with MacPorts), and I don’t want them overriding my PATH. Likewise, I want lilypond to be able to find the binaries it expects, and since they’re taking up disk space anyway let’s help it along. So I wrote a script. A LilyPond launcher if you will. I call it ly and put it in my path, and then I call e.g. ly lilypond foo.ly. Here’s the code:
#! /bin/sh
APP=/Applications/LilyPond.app
PATH=$APP/Contents/Resources/bin:$PATH
exec "$@"
Customize APP to point wherever you want to keep LilyPond.app. This will load up the environment that will give lilypond the best chance of success. You can run any of the binaries in that directory with ly, but the most common case is to run lilypond. So I recommend putting this in your .bashrc:
alias lilypond='ly lilypond'
The first time you run the ppc version of LilyPond, or anything else, on an Intel machine, it will seem to take forever while Rosetta fires up. Be patient. Subsequent invocations are quick enough.
February 28th, 2008 at 05:50
I love and very much enjoy using LilyPond. It has much flexibility that I get to play around with my tunes.
May 25th, 2008 at 02:45
Hi Hans,
I work on a Java program to generate jazz chords. The output is a Lilypond file.
Well, I manage to open/compile the *.ly file from the shell (i.e. the way you describe), but I don’t manage it to do this from inside the Java program using the Runtime class. (Although I am able to execute other applications…?)
I started working on a Mac/Leopard recently, so I am not very familiar with the shell commands and setting the paths, etc.
I would appreciate it, if you have any idea to help me,
thanks
Niko Maly
May 26th, 2008 at 19:47
I’m sorry I am no help to you. I’m not familiar with doing this in Java. I bet the issue has to do with setting up the environment correctly, though.
March 9th, 2009 at 19:20
Correction: why it takes forever the first time isn’t Rosetta (does it with an Intel download too). Whatever it is, it does eventually finish and thereafter runs quickly.