[Home] [Up]

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.

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 programming by use of “\includes”. e.g.:

\include "english.ly"

The main part of the file is in a “\score” block.

Put notes in the file like this:

\version "n.n.n"
\include "english.ly"
notes = { a b c % notes here
}
\score {
        \new Staff {
                \notes
        }
}

or use:

\include "notes.ly"

Then run lllypond:

$ lilypond filename.ly

and you’re done. I’ve left out a lot.

So why not do just that?

You should. 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.

There is no syntax for note names that I like.

C is named in all kinds of ways. keys.sed changes these:

bw or bbb, bb, b or h, bs, and bx

into lilypond’s English. All it amounts to is that I can’t stand “bf” instead of “bb”. Of course there are many other shortcuts in another filter, “shortcuts.sed”.

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 the natural note, but you don’t use it if it doesn’t help. I don’t use it in F or G major, where there is only one or .

A script to do the filtering is convenient.

This is all on the command line:

$ cat (or type) notes.ly | runsed ~~
~~ filter.sed1 filter.sed2 ... > temp.ly

I used xsel to echo selected text through runsed into “temp.ly” and then had

\include "temp.ly"

in the score.

These are in my “bin” directory: [ runsed ] [ keys.sed ]


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