[Home] [Up] | http://www.openguitar.com | Revision: Sep 4 2010

LilyPond and Its Data Entry

David Raleigh Arnold

What is LilyPond?

LilyPond is a GNU, meaning free, music typesetter. It has many excellences, and it can be customized to a great degree, but discovering how to do something can be a very unpleasant experience. You can get help from the mailing list, which can be reached at the web site.

How Do You Use It?

Prepare a file

Make a filename.ly, which tells the program what to do with the data you are going to provide. filename.ly may include other input by use of “\includes”. e.g.:


\include "english.ly"

The details are in the documentation at [LilyPond Site] and there is a nice introduction at [LilyPond Guide] which I hope will be or is being adequately maintained.

I recommend that you put your notes for the various voices in separate files.

I have two types of editing tools. One is run on selected text within your text editor, such as nedit.

The other type is a filter which may be run every time you bring up lilypond. "keys.sed" is an example of a filter which enables you to enter note names according to the key you choose, which is the way music is normally written and read.

Then run lllypond with your local script:


$ ./local-script filename.ly

and you get a PDF or your choice of several other output formats

So why bother with filters?

You shouldn't at first. Get a bit familiar with the software. Visit the site, get lilypond and its documentation, get through the tutorial.

I am not happy with two things about the syntax of note entry, so I developed editing tools to do things my way. Other editing tools speed up editing greatly or reduce typing.

There is no syntax for note names that I like.

Note names are too long or not intuitive enough: bis, fis, beses, bff

LilyPond doesn't shorten note names according to the key.

This annoys a lot more people. keys.sed will change c to cs according to the key you choose. That is the way you read all music with key signatures. Shouldn't the note entry be the same, with the chromatic sign assumed if it’s in the key signature? Of course then you need an “n” for a natural sign once in a while.

A script to do the filtering is convenient.

A bash script or dos/windows batchfile in your project directory can filter, send to lilypond for compilation, and display the pdf file produced. I recommend making a separate show.ly file which compiles and displays any single voice. Then you can bring up the whole thing later with each part or voice already checked. Errors will be easier to find and the whole editing process will be a bit faster.

Another Input Language

There are other programs than LilyPond which use similar syntaxes, and some of the syntax already existed in printed books about music before there was any such thing as computer music typesetting. It is only one small step from quasi LilyPond syntax to a syntax suitable to give instructions to humans in teaching music theory, or for writing about music.


a,, b'' cs df ex2 fff4 g8 |
4/4 :||:  Db13(b9)/ab


a,, b'' c d ex2 f4 g8 │
4/4 :││:  D13(9)/a


[Home] [Up]
©2010 David Raleigh Arnold - http://www.openguitar.com