Lilypond in Leopard
So my Mac Book is not working again and back at the shop. I don’t want to talk about it…
It was working long enough, though, for me to play with some of my favorite apps in Mac OS 10.5. I have recently been using Lilypond to write music, and it is a little strange in 10.5. Lilypond is a kind of text based syntax for generating sheet music and corresponding midi files, and I have found that while it’s got a pretty steep learning curve for a non-programmer, it offers far more flexibility that any other free option out there. Plus I just like plain text files and open source software.
The strange thing about Lilypond is that the way it’s used in different operating systems and versions. On Windows, you install the program, then create your text file with an .ly extension. Double click on this file, and LilyPond generates the corresponding PDF and midi files. On Mac OS 10.3, there is a whole GUI front end, with a (rather lame) text editor and a menu option to compile. I personally liked the Windows implementation personally.
On Mac OS 10.5, there is a whole set of hoops you have to jump through, which is kind of lame. You have to keep your lilypond files in a specific directory, and use an AppleScript just to get everything to compile. Very strange. I think the reason is that there is only command line support for the app in 10.5, and you have to quit out of Preview and Quicktime, presumably due to conflicts with the PDF and midi generation. Maybe I will modify the AppleScript to make it a little more usable for my own workflow.
The big win here, though, is that I found out that one of my new favorite Mac text editors, Smultron, supports Lilypond markup out of the box. This program is definitely looking like the Mac version of TextPad I have been looking for.
nathan,
i think you’re probably referring to ivo’s LilyPondScript thingy. I don’t know if smultron supports external scripts like texshop does, but if so, have a look here: http://simon.bailey.at/blog/lilyleopard/
after that you don’t have to jump through any more hoops. :) in leopard, preview automagically reloads changed pdf files, quicktime doesn’t do this though.
if you have any questions, feel free to drop me a line.
regards,
sb
Simon,
It’s funny, I actually ran across your site when I was trying to figure out an alternate solution to LilyPond on Leopard. I haven’t used TexShop, but I am sure Smultron supports external scripts – I just haven’t had a chance to delve into that yet.
In the LilyPondScript thing, it seems that it quits out of QuickTime and Preview – is this a requirement to run LilyPond from the command line? I haven’t tried running the command without it (I am a little gunshy now that I have my Mac up and running finally), but including that, I have been jumping through the following reduced number of hoops:
1. Edit the .ly files in Smultron
2. Keep Terminal.app open and in the same directory as the .ly file
3. After making changes in the text editor and saving, I switch over to Terminal and run a function I set up in my .profile:
lily () { quit "QuickTime Player"; quit "Preview"; lilypond $1 }*…so basically I go into Terminal and Type “
lily (filename)” and everything works just fine.Let me know if you think you have an easier way to handle this that’s text editor independent, and thanks for helpful comment here and post at your place.
* Please note – I am not at my mac right now, so I put in this line from memory. If you copy and paste it, it may not work for you without some adjustments – as always, your mileage may vary.