Diving head first into the LilyPond

In an earlier post I wrote that I selected Denemo to try out music notation on Linux. I played around with it a bit (admittedly not overly long), but I found it lacking for my needs. Not that I dislike the software, it is just not far enough along to be of everyday use. A lot of the features I need are not yet implemented and some are still buggy. I think the Denemo project shows great promise, but it will take some time before I could see myself using it on a daily basis. So for now I am looking for a new notation solution. Care to follow me along?...

Alternatives

There are a number of alternative applications I could use. For example Rosegarden, which -like Denemo- also uses LilyPond for its output, and it seems a bit farther along than Denemo. But Rosegarden is primarily a MIDI workstation for which I have no use currently so this is overkill. Then there is Canorus, the successor of NoteEdit. As far as I can see, this is at a similar stage as Denemo: promising but still too far in development to be of everyday use. All these programs have one thing in common: they all use LilyPond for the actual layout and printing. And with all you can edit the LilyPond code afterward to adapt it to your own needs or standards. But this of course requires knowledge of LilyPond.

Cutting out the middle man

So I figured I might as well skip the graphical front-ends and dive straight into LilyPond hacking. For those of you who don't know LilyPond: you type a textual description of your music in a text editor, using LilyPond's specific syntax. Next you save the file and use LilyPond compile it into PostScript. This means that you can't see a graphical rendition of your work until you compile the PostScript file and load it into a viewer. This is an example of LilyPond code, showing the assembly of a big band saxophone group:

%%% saxophone definitions %%%
asxOne = { \set Staff.instrumentName = #"alto sax 1" \clef treble \scoresettings \asxOneNotes }
asxTwo = { \set Staff.instrumentName = #"alto sax 2" \clef treble \scoresettings \asxTwoNotes }
tsxOne = { \set Staff.instrumentName = #"tenor sax 1" \clef treble \scoresettings \tsxOneNotes }
tsxTwo = { \set Staff.instrumentName = #"tenor sax 2" \clef treble \scoresettings \tsxTwoNotes }
bsx	 = { \set Staff.instrumentName = #"baritone sax" \clef treble \scoresettings \bsxNotes }
%%% saxophone grouping %%%
saxes = {
	\new StaffGroup <<
		\new Staff {\transpose es c' \asxOne}
		\new Staff {\transpose es c' \asxTwo}
		\new Staff {\tsxOne}
		\new Staff {\tsxTwo}
		\new Staff {\transpose es, c' \bsx}
	>>
}

As you can see, there are a lot of commands and variables needed in order to produce music notation. To use LilyPond you have to know its syntax. As I started using LilyPond, I found out that many of the commands make perfect sense. It is not that complicated to produce a simple piece of music in LilyPond. But alas, my everyday work consists of more elaborate scores, using multiple instruments. A score using less than 15 instruments is fairly uncommon for me. And this is where using LilyPond gets a bit more difficult. I soon found out that you can't start inputting music and sort out the issues afterward. For example creating a big band score needs some serious forethought and quite a bit of knowledge of the LilyPond syntax. I found that cleverly structuring the LilyPond input file makes inputting music far easier, not to mention correcting mistakes!

Real life experience

At this point I haven't used LilyPond for any of my projects. The aim of all this was to test in order to see if notating music in LilyPond directly is doable. My conclusion at this point is that it certainly is. At this point I still need to tweak a lot of things in order to get the music to look like I want it to, but I think that as soon as I am satisfied with my templates, I will start using LilyPond for real projects - starting with the smaller ones of course!

Personally I have found it difficult to do creative work in LilyPond: transcribing music is fairly intuitive. It is obvious that LilyPond is created by musicians. But for creative work I really miss the graphical feedback. This is not necessarily a bad thing. I can do my sketching on manuscript paper like I used to do in the years B.F. (Before Finale) and from that point I can transcribe the music with LilyPond. I did this with a few small fragments and I found that I enjoyed it! Of course at this moment the speed of working suffers, but that is merely because I am not yet fluent in LilyPond. This will improve with use. And hey, it takes a while to work fast in Finale (or any other notation package) as well. Another aspect of this is your text editor. My personal favourite is Vim. There are plug-ins specifically targeted at editing LilyPond for Vim (as for Emacs and JEdit), that should speed up the work as well, but I haven't looked into them yet.

Conclusions

If you are serious about creating music notation with Linux, it pays to get to know LilyPond. Even if you use one of the graphical front-ends, you still need to tweek the LilyPond code in order to get it to look polished. Because LilyPond is created by musicians I found it not too hard to learn, but as with any power-tool, you can't expect professional results on the first try. On the other hand, with a little bit of effort you can produce really beautifyl looking notation. As the graphical front-ends mature, using LilyPond will become easier I guess, but for now I think writing LilyPond code directly is the best option.

Related articles