Est. 1996 Intermediate

LilyPond

A declarative, text-based music engraving language that compiles plain-text scores into beautifully typeset sheet music and MIDI.

Created by Han-Wen Nienhuys and Jan Nieuwenhuizen

Paradigm Declarative, Domain-Specific (music engraving); extensible with Scheme
Typing Not applicable (declarative markup); the Scheme extension layer is dynamically typed
First Appeared 1996 (project start); version 1.0 in 1998
Latest Version 2.26.0 (reportedly April 2026); 2.27.x development series

Overview

LilyPond is a declarative, text-based music engraving language. Rather than placing notes on a staff with a mouse, a user writes a plain-text description of the music — pitches, durations, lyrics, dynamics, and structure — and the LilyPond program compiles that description into publication-quality sheet music (typically PDF or SVG) and, optionally, a MIDI performance. Its guiding ambition is to produce engraving that rivals the finest hand-set classical scores, while keeping the source as readable, portable, and version-controllable as ordinary program code.

Because the input is a text file processed by a compiler, LilyPond fits naturally alongside programming languages: scores can be diffed, merged, generated by scripts, and checked into version control. It is free software released under the GNU General Public License and is part of the GNU Project.

History and Origins

LilyPond grew out of an earlier collaboration. In 1995, Han-Wen Nienhuys and Jan Nieuwenhuizen began working together on MPP, a preprocessor built on top of MusiXTeX (itself a music-notation package for Donald Knuth’s TeX system). Dissatisfied with that approach, they abandoned MPP and started the LilyPond project in 1996. According to the project’s own lore, the name is connected to the Rosegarden project and to an acquaintance associated with the name “lily,” though accounts vary and a definitive etymology is not well documented.

The first official release, version 1.0, arrived in 1998 (reportedly on July 31). It was a landmark: it introduced Feta, LilyPond’s own music font (whose name reflects LilyPond’s running joke of naming its fonts after cheeses), and it was a major step in LilyPond’s move away from MusiXTeX toward doing its own engraving rather than delegating to TeX — a transition completed in later releases.

A second major milestone came with version 2.0 in 2003 (reportedly September 24), which delivered a much simplified input syntax and a far more complete set of facilities for notating diverse musical styles. The 2.x line has remained the basis of the language ever since, with even-numbered minor versions (2.18, 2.20, 2.22, 2.24, 2.26) designating stable releases and odd-numbered series used for development.

Design Philosophy

LilyPond is shaped by a clear aesthetic and engineering stance:

  • Beauty of engraving first. The project’s stated goal is to produce printed music as good as the best engraving from the age of hand-set type. Spacing, beaming, slur shapes, and collision avoidance are tuned to look musical, not merely correct.
  • Content separated from presentation. A LilyPond file describes what the music is; the program decides how to lay it out. This mirrors the way markup languages separate document content from typesetting.
  • Text as the source of truth. Because scores are plain text, they are diffable, scriptable, and friendly to version control — a sharp contrast to binary, GUI-driven notation editors.
  • Programmability through Scheme. Almost any aspect of the output can be customized, because LilyPond embeds a full programming language for extension and overrides.

Key Features

  • Declarative music input. Notes are written compactly — for example, pitches like c d e f g, with durations attached as numbers (c4 for a quarter note, c8 for an eighth) — inside structures such as \relative, \score, and \new Staff.
  • High-quality automatic engraving. LilyPond automatically handles beaming, spacing, line breaking, and collision resolution, while still allowing manual override.
  • Scheme extensibility. LilyPond uses Scheme, interpreted by GNU Guile, as its extension language; users can script and override engraving behavior in depth.
  • Multiple output formats. It produces PDF, SVG, PNG, and PostScript, plus MIDI for audio playback. Version 2.26 reportedly added an optional Cairo rendering backend covering all of these formats.
  • Document integration. The lilypond-book tool embeds typeset musical examples into LaTeX, HTML, Texinfo, and DocBook documents — widely used for textbooks and academic papers.
  • Specialized notation. Beyond common practice notation, it supports lyrics, chord names, figured bass, tablature, early-music and Gregorian notation, and many other idioms.

Architecture

LilyPond is mostly written in C++, with Scheme (run on GNU Guile) as its extension language and a substantial body of supporting Python tooling. The codebase is large; project documentation has described it as comprising hundreds of thousands of lines of C++ alongside large amounts of Scheme and Python. Internally, LilyPond parses the input into a representation of musical events, then runs a series of engravers that build graphical objects, which a layout engine spaces and renders.

Evolution

Since the 2.0 rewrite, LilyPond has advanced steadily through its stable series. Version 2.18.0 (December 29, 2013) and 2.22.0 (January 10, 2021) each consolidated years of engraving refinements and Scheme improvements. Version 2.24.0 (reportedly December 2022) accompanied a significant modernization of the build and extension toolchain, including a move toward Python 3. The most recent stable line, 2.26.0 (reportedly released in April 2026), introduced the optional Cairo backend, which can generate output through the Cairo graphics library and improves rendering — SVG output in particular — while the 2.27.x series opens the next development cycle. For production work, the project recommends the current stable release.

Current Relevance

LilyPond occupies a distinctive niche. It is the tool of choice for users who prize engraving quality and text-based, scriptable workflows over the immediacy of a graphical editor. It powers the Mutopia Project’s library of free scores, underpins scholarly and critical editions, and is widely used to typeset musical examples in books and papers. A healthy ecosystem has grown around it, including the Frescobaldi editor, the OpenLilyLib collection of reusable libraries, and numerous online services that compile LilyPond snippets on demand. Development remains active, coordinated through the GNU Project and a volunteer community.

Why It Matters

LilyPond demonstrates that the principles of programming — declarative source, separation of content from presentation, version control, and extensibility — apply just as powerfully to music notation as to documents and software. By treating a musical score as compilable source code and pairing that idea with an engraving engine designed to emulate the best traditional typesetting, LilyPond bridges two worlds: it gives musicians the visual standards of hand-engraved scores and gives programmers a familiar, automatable, plain-text workflow. It stands as one of the most successful and enduring examples of a domain-specific declarative language built for an artistic craft.

Timeline

1995
Han-Wen Nienhuys and Jan Nieuwenhuizen begin collaborating on MPP, a MusiXTeX preprocessor for typesetting music.
1996
The pair abandon MPP and start the LilyPond project; according to project lore, the name was inspired in part by the Rosegarden project.
1998
Version 1.0 is released in 1998 (reportedly on July 31), introducing the custom Feta music font and marking a major step in LilyPond's move away from MusiXTeX.
2003
Version 2.0 is released in 2003 (reportedly on September 24), bringing a greatly simplified input syntax and broader support for many styles of notation.
2013
Version 2.18.0 is released on December 29 as a new stable series, consolidating years of engraving and Scheme improvements.
2021
Version 2.22.0 is released on January 10, continuing the modern stable line of the engraver.
2022
Version 2.24.0 is released (December), part of the migration to a Python 3 build toolchain and Guile-based extension updates.
2026
Version 2.26.0 is reportedly released in April 2026, adding an optional Cairo backend for generating PDF, SVG, PNG, and PostScript output, while the 2.27.x development series begins.

Notable Uses & Legacy

Mutopia Project

A long-running effort to distribute free, public-domain sheet music; scores are typeset and maintained using LilyPond source files.

Frescobaldi

A dedicated cross-platform LilyPond text editor with score preview, point-and-click navigation, and music-entry helpers, serving as the most popular graphical front end.

OpenLilyLib

A community collection of reusable LilyPond libraries and tools for advanced engraving, scholarly editions, and extending the language with Scheme.

Critical and scholarly editions

Musicologists and editors use LilyPond to produce critical editions and urtext scores, taking advantage of its fine-grained control over engraving and its plain-text, version-controllable sources.

Textbooks and academic publishing

Authors embed LilyPond fragments in documents (for example via lilypond-book with LaTeX or HTML) to integrate professionally typeset musical examples directly into prose.

Language Influence

Influenced By

MusiXTeX TeX Scheme

Running Today

Run examples using the official Docker image:

docker pull
Last updated: