GNU LilyPond is a computer program for music engraving. One of LilyPond's major goals is to produce scores that are engraved with traditional layout rules, reflecting the era when scores were engraved by hand.
Unlike some commercial, proprietary music engraving software, such as Finale and Sibelius, LilyPond does not contain its own graphical user interface for the creation of scores. It does, however, have the same aim of producing output comparable to professionally-engraved scores. Some graphical music notation programs, such as Rosegarden, NoteEdit and Canorus, can export files directly to LilyPond format. LilyPond can also automatically generate MIDI files from music specified in the LilyPond format. The Mutopia project, which distributes free content sheet music, uses LilyPond to typeset its music, as does Musipedia, a collaborative music encyclopedia. WikiTeX, a MediaWiki interface, supports editing LilyPond notation directly in wiki articles.
LilyPond is written in C++ and assembled by a Scheme library (GNU Guile) which allows for user customization and extension. It uses a simple text notation for music, which is then compiled into PDF (via PostScript) or other formats.
In LilyPond, notes are entered in note, pitch and length format; pitch is represented with series of single quotes or commas, each representing an octave up or down from the base. For example,
a'4 is an A, one octave up from the base, of quarter note length. As a curious syntactical rule, all other modifiers - even ones containing parentheses, which by usual writing rules should go before the note - are added after the note, so
d8[c] is an eighth-note pair with a beam as signified by the brackets.
LilyPond has two modes of entering the note pitches: Absolute and relative. In absolute mode, note pitches are always given, for each note, relative to the base; in relative mode, when the melody stays within limits, notes with unspecified pitch are assumed to be "near" the last note, and pitch markers are used only when the interval from the preceding note is more than a fourth. This example uses the relative mode.
The only character encoding that LilyPond understands is UTF-8. This allows for the combination of Danish, Hebrew, Korean, etc. in the same file. The first line in the file tells emacs that this file should always be read and written as UTF-8. If one uses other editors than emacs, it is necessary to make sure that they use UTF-8 too; otherwise anything but ASCII will break.