Jump to content

LilyPond

From Wikipedia, the free encyclopedia
(Redirected fromGNU LilyPond)

LilyPond
Developer(s)David Kastrup, Werner Lemberg, Han-Wen Nienhuys, Jan Nieuwenhuizen, Carl Sorensen, Janek Warchoł,et al.[1]
Initial release1 August 1997;27 years ago(1 August 1997)
Stable release
2.24.4[2]Edit this on Wikidata / 21 July 2024
Preview release
2.25.21[3]Edit this on Wikidata / 27 October 2024
Repository
Written inC++,Scheme,Metafont,PostScript,Python[4]
Operating system
Size20–100 MB
Standard(s)EPS,MIDI,MusicXML,PDF,PS,SVG
Available inCatalan, Dutch, English, French, German, Hungarian, Italian, Japanese, Spanish
TypeMusic software,scorewriter
LicenseGPL-3.0-or-later[6]
Websitelilypond.orgEdit this on Wikidata

LilyPondis acomputer programandfile formatformusic 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.

LilyPond iscross-platform,and is available for several commonoperating systems;released under the terms of theGNU General Public License,LilyPond isfree softwareand part of theGNU Project.

History

[edit]

The LilyPond project was started in 1996 by Han-Wen Nienhuys and Jan Nieuwenhuizen, after they decided to abandon work on MPP (MusiXTeXPreProcessor), a project they began collaborating on in 1995.[7][8]Its name was inspired both by theRosegardenproject and an acquaintance of Nienhuys and Nieuwenhuizen named Suzanne, a name that means lily in Hebrew (שׁוֹשַׁנָּה).[9]

Version 1.0

[edit]

LilyPond 1.0 was released on July 31, 1998, highlighting the development of a custom music font, Feta, and the complete separation of LilyPond from MusiXTeX.[10]

Version 2.0

[edit]

LilyPond 2.0 was released on September 24, 2003, announcing a simplified syntax model and a much more complete set of facilities for notating various styles of music.[11]

Design

[edit]
Screenshot of LilyPond running on Linux

LilyPond is mostly written inC++and usesScheme(interpreted byGNU Guile) as its extension language, allowing for user customization.[12]It has a relatively largecodebase;as of March 10, 2017, the source includes over 600,000 lines of C++, 140,000 lines of Scheme, and 120,000 lines ofPython code.[13]

It uses a simple text notation for music input, which LilyPond interprets and processes in a series of stages.[14]In the final stage,music notationis output toPDF(viaPostScript) or other graphical formats, such asSVGorPNG.LilyPond can also generateMIDIfiles that correspond to the music notation output.

LilyPond is atext-based application,so it does not contain its owngraphical user interfaceto assist with score creation. (However, a text-editor based "LilyPad" GUI for Windows and MacOS is included by default on these systems.) It does, however, have a flexible input language that strives to be simple, easing thelearning curvefor new users. LilyPond adheres to theWYSIWYMparadigm;the workflow for typesetting music notation with LilyPond is similar to that of preparing documents withLaTeX.

LilyPond supports experimentalmusical notation.Its guitar facilities supportalternative tunings,such asmajor-thirds tuning.[15]

Software features

[edit]
Beethoven'sSymphony No. 5music sheet printed from a digitally engraved PDF file produced by LilyPond; released by theMutopia Project

LilyPond's primary goal is to produce output comparable to professionally engraved scores instead of output that looks mechanical and computer-generated. An essay from the LilyPond website, written by LilyPond developers, explains some typographical issues addressed by LilyPond:[16]

  • Optical font scaling:depending on the staff size, the design of the music font is slightly altered; this is a feature thatDonald Knuth'sComputer Modernfont is known for. As a result, note heads become more rounded, and staff lines become thicker.
  • Optical spacing:stem directions are taken into account when spacing subsequent notes.
  • Special ledger line handling:ledger linesare shortened when accidentals are nearby, thus enhancing readability.
  • Proportional spacing:notes can be positioned in such a way thatexactlyreflects their duration. For example, with this setting, the space between consecutivequarter notesis four times greater than between consecutivesixteenth notes.[17]

Overview of input syntax

[edit]

The native input language for LilyPond is comprehensive, and consists of manycommandsneeded for expressing any sort of articulation, dynamic, meter, etc. It is similar to that ofTeX.The ability to embed Scheme code within a LilyPondsource filepermits arbitrary extensions to the input language and assists withalgorithmic composition.Some general syntactic features are listed below.

  • Single-linecommentsbegin with a percent sign%.[18]
  • Notesare represented inpitch-durationformat:pitchis specified withHelmholtz pitch notation,anddurationis specified with anumeralbased system. The semantics of thepitch-durationformat change depending on the active input mode; this is explained in depth in the LilyPond manual. For example, in absolute mode,a'4is an A, one octave up from the base A (A3 inscientific pitch notation), of quarter note length.[19]
  • Commands usually begin with a backslash (such as\time,or\slurUp). The function of the command in question determines where the command is placed; for example, if the command is used to indicate a fixeddynamicon a specific note, it is placedafterthe note.[20]
  • Some common commands are represented symbolically to ease typing. One example is withslurs,where(and)indicate the beginning and ending of a slur, respectively.[21]Another example is with manualbeaming,where[and]indicate the extent of the beam.[22]

LilyPond's interface withPangorequires the inputcharacter encodingto beUTF-8.[23]One benefit of this is that more than one language can be included in the same source file.

Example of LilyPond input file

[edit]
\version"2.22.2"

\include"english.ly"

\header{
title=\markup{"Excerpt from"\italic"fibonacci"}
composer="Patrick McCarty"
% copyright = \markup \fontsize #-5
% {
% Copyright © 2009.
% Typeset with GNU LilyPond.
% Released into public domain by the composer.
% }
}

\paper{
paper-height=4.6\in
paper-width=8.5\in
indent=#0
system-count=#2
}

\score{
\newPianoStaff="pianostaff"<<
\newStaff="RH"\relativec'{
\accidentalStyleScore.piano
\clef"treble"
\time2/4
\setScore.currentBarNumber=#51
\tempo"Slow and steady"4=60
<egs,>4\acciaccatura{cs16[ds]}<egs,>4|% m. 51
<dsgs,>4\acciaccatura{e16[ds]}<csgs>4|% m. 52
<csgs>4\acciaccatura{ds16[cs]}<cg>4|% m. 53
<csgs>4\acciaccatura{ds16[e]}<esbsgs>4|% m. 54

<egs,>4\acciaccatura{cs16[ds]}e16fgsa|% m. 55
<gsc,>8\acciaccatura{as16[gs]}
<esb>8~<esb>16dsbas|% m. 56

b16d8bf32f'g16afbfc|% m. 57
<dfdf,>16(caf)<e'e,>(dsb)<g'g,>(ds|% m. 58

\time3/4
<gsgs,>16)\noBeamd,16fgs
a16efb
c16d,(fgs|% m. 59

a16b)e,(f
gs16bc)f,(
gs16asbc)|% m. 60
}

\newDynamics="Dynamics_pf"{
s4\p\<s4|% m. 51
s4s4|% m. 52
s4\mp\>s4|% m. 53
s4s4\!|% m. 54
s4\ps4|% m. 55
s1*2/4|% m. 56
s4\<s4|% m. 57
s4s4|% m. 58
\overrideDynamicText.extra-spacing-width=#'(-0.75.0.75)
s16\mfs16\ps8s4s4|% m. 59
s2.|% m. 60
}

\newStaff="LH"\relativec,{
\clef"bass"
\time2/4
cs4.cs8|% m. 51
cs4.d8|% m. 52
f4.a8|% m. 53
f4.d8|% m. 54

cs4.cs8|% m. 55
d4ds|% m. 56
gs4.bf,8|% m. 57
f'4b,|% m. 58

\time3/4
d4.d8~d4|% m. 59
ef2f4|% m. 60
}
>>
}

Corresponding output

[edit]

Rendered output

More complex output

[edit]

Lilypond can also create extensively customised output. An example is the short extract of aKarlheinz Stockhausenpiano piece below.

Excerpt from “Klavierstück II” by Stockhausen as a rendering example

Collaboration with other projects

[edit]
FirstmeasuresofAdeste Fideles,generated by LilyPond.

Several graphicalscorewriters—such asRosegarden,NoteEdit,Canorus,Denemo,andTuxGuitar—can export files directly to LilyPond format. Other graphical applications serve as front ends to LilyPond, includingFrescobaldiand the LilyPondTool plugin forjEdit.Denemointegrates thePDFoutput of LilyPond in its display, allowing some editing operations on the final typeset score.

TheMutopia Project,which distributesfree contentsheet music, uses LilyPond to typeset its music, as does Musipedia, a collaborative music encyclopedia.

Emacs'org-modecontains support for embedding LilyPond scores into documents.[24]

OOoLilyPond, aLibreOfficeextension provides support for calling LilyPond to embed scores into documents.[25]

Integration into MediaWiki

[edit]

Lilypond is available inMediaWikivia theScore extensioncode. This, for example, transforms the notation

<scoresound="1">\relativec'{
\keyd\major
fis4fisgaagfiseddefisfis4.e8e2}</score>

into

\relative c' {  
\key d \major
fis4 fis g a a g fis e d d e fis fis4. e8 e2 }

The above is an excerpt from Ludwig van Beethoven’s 9th Symphony, commonly known as "Ode to Joy". More complex scores, including lyrics, are also possible within MediaWiki wikis.SeePastime with Good Companyfor an example of this.

Integration into text usinglilypond-book

[edit]

Integration of LilyPond musical elements into various document formats (bothTeX-based systems such asLaTeXandTexinfo,and alsoDocBookandHTMLpages) is natively supported through the companion programlilypond-book,developed and maintained by the LilyPond community.[26]This allows users to embed musical elements within texts, such as musicology, song booklets, work sheets for teaching, and school examinations.

Integration into LaTeX

[edit]

For integration into theLaTeXdocument preparation system, lyLuaTeX has been developed as a LuaLaTeX package to embed musical elements within texts. It includes features for matching layout and appearance of the musical elements with the surrounding text document.[27]Music elements may consist of music symbols, song lyrics, guitar chords diagrams, lead sheets, music excerpts, guitar tablatures, or multi-page scores.

Comparison to other scorewriters

[edit]

FinaleandSibeliusare twoproprietaryscorewriters often compared to LilyPond. Andrew Hawryluk, a LilyPond user, wrote a series of articles comparing output quality between Finale and LilyPond.[28]

Another scorewriter with comparable features to LilyPond isSCORE,but SCORE relies on manual positioning more than Lilypond does.

See alsoComparison of scorewriters.

See also

[edit]

References

[edit]
  1. ^"Authors".LilyPond Development team.RetrievedMarch 21,2015.
  2. ^ Error: Unable to display the reference from Wikidata properly. Technical details:
    • Reason for the failure of{{Cite web}}:The Wikidata reference contains the propertydownload URL(P4945),which is not assigned to any parameter of this template.
    • Reason for the failure of{{Cite Q}}:The Wikidata reference contains the propertydownload URL(P4945),which is not assigned to any parameter of this template.
    Seethe documentationfor further details.
  3. ^ Error: Unable to display the reference from Wikidata properly. Technical details:
    • Reason for the failure of{{Cite web}}:The Wikidata reference contains the propertydownload URL(P4945),which is not assigned to any parameter of this template.
    • Reason for the failure of{{Cite Q}}:The Wikidata reference contains the propertydownload URL(P4945),which is not assigned to any parameter of this template.
    Seethe documentationfor further details.
  4. ^"Source tarball".lilypond.org.RetrievedMarch 4,2016.
  5. ^"Downloads for LilyPond 2.18.2".lilypond.org.RetrievedMarch 4,2016.
  6. ^"LICENSE - lilypond.git - GNU LilyPond".git.savannah.gnu.org.
  7. ^"GNU LilyPond Learning Manual: Preface".RetrievedDecember 23,2017.
  8. ^"MusiXTeX PreProcessor README".GitHub.RetrievedMarch 31,2010.
  9. ^Kroger, Pedro (2004)."Re: The origin of the name lilypond".lilypond-user mailing list.lists.gnu.org.RetrievedMarch 19,2014.
  10. ^Nienhuys, Han-Wen (July 31, 1998)."GNU LilyPond 1.0 released".gnu-music-discuss(Mailing list).RetrievedFebruary 16,2010.
  11. ^Nienhuys, Han-Wen (September 24, 2003)."LilyPond 2.0 – make beautiful music prints".info-lilypond(Mailing list).RetrievedFebruary 16,2010.
  12. ^"LilyPond programming languages".RetrievedMarch 21,2015.
  13. ^"GNU LilyPond Music Typesetter – Code Analysis".RetrievedJuly 25,2017.
  14. ^"Overview of LilyPond architecture".RetrievedMarch 21,2015.
  15. ^Griewank, Andreas (January 4, 2010)."Tuning guitars and reading music in major thirds".Matheon Preprints.695.Berlin, Germany: DFG research center "MATHEON, Mathematics for key technologies".RetrievedJanuary 14,2020.
  16. ^"LilyPond - Essay on automated music engraving".RetrievedDecember 23,2017.
  17. ^"Proportional notation".RetrievedMarch 21,2015.
  18. ^"LilyPond Learning Manual: 1.2.2 Working on input files".RetrievedMarch 21,2015.
  19. ^"LilyPond Notation Reference: 1.1.1 Writing pitches".RetrievedMarch 21,2015.
  20. ^"LilyPond Notation Reference: 1.3.1 Expressive marks attached to notes".RetrievedMarch 21,2015.
  21. ^"LilyPond Notation Reference: 1.3.2 Expressive marks as curves".RetrievedMarch 21,2015.
  22. ^"LilyPond Notation Reference: 1.2.4 Beams".RetrievedMarch 21,2015.
  23. ^"LilyPond Notation Reference: 3.3.3 Text encoding".RetrievedMarch 21,2015.
  24. ^"org-babel lilypond language module".December 17, 2018.RetrievedNovember 30,2019– via GitHub.
  25. ^Klaus Blum (April 18, 2017)."OOoLilyPond: Creating musical snippets in LibreOffice documents".RetrievedOctober 12,2017.[permanent dead link]
  26. ^LilyPond community (1996–2020)."LilyPond Usage manual".
  27. ^Peron, Fr. Jacques; Liska, Urs; Springuel, Br. Samuel (May 27, 2019)."LyLuaTeX 1.0f"(PDF).Comprehensive TeX Archive Network (CTAN).RetrievedApril 16,2020.
  28. ^Hawryluk, Andrew."Finale and LilyPond".RetrievedFebruary 15,2010.
[edit]