GNU LilyPond

From Wikipedia, the free encyclopedia

(Redirected from LilyPond)
Jump to: navigation, search
GNU LilyPond
Latest release: 2.10.33 / September 20, 2007
Preview release: 2.11.35 / November 21, 2007
OS: Cross-platform
Genre: Music engraving
License: GNU General Public License
Website: www.lilypond.org

GNU LilyPond is a free software program for engraving sheet music for all common operating systems; it is written in C++ and assembled by a Scheme library (GNU Guile) which also allows user customization and extension[1]. It uses a simple text notation for music, which is then compiled into PDF (via PostScript), SVG or other formats. LilyPond can also automatically generate MIDI files from music specified in the LilyPond format.

Unlike some commercial proprietary programs 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.

One of LilyPond's major goals is to produce scores that are engraved following the traditional layout rules of the era when scores were engraved by hand.

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.

First measures of Adeste Fideles, generated by LilyPond.
First measures of Adeste Fideles, generated by LilyPond.

Contents

Text after a percent sign (%) is a comment. Double percent signs are used here for readability.

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.


#!lilypond firebreathers.ly -*- coding: utf-8; -*-
%% Theme to "Fire Breathers", a homebrew NES game perpetually 
%% under development.  Composed by Urpo Lankinen.

%% Note: The composer has made this source code available 
%% to Wikipedia under the GFDL license.  Some previous versions
%% of this code may also be available under CC BY-SA license.

%% This file uses Finnish note names (for example, where 
%% Americans use "F#" and "Bb", Finns use "Fis" and "B"). 
%% Dutch note names are used by default.
\include "suomi.ly"

%% Optional language upgrade helper.
\version "2.6.0"

%% The header block defines the titles and texts.
\header {
    title = "Theme to ``Fire Breathers!''"
    instrument = "For the 2A03 or SID"
    composer = "Urpo Lankinen"
    enteredby = "Urpo Lankinen"
    updatedby = "Jan Nieuwenhuizen"
    date = "June 2005"
}

Melody = \relative c'' {
   \clef treble
   \time 3/4
   \key a \minor

   %% The piece starts with a quarter-note partial bar, "\partial 4"
   %% tells so to LilyPond.
   \partial 4
   a4 | e'4.( d8[ c]) r8 | d4.( c8[ h]) r8 | a2. | e2
   a4 | e'4.( d8[ c]) r8 | d4.( e8[ f]) r8 | e2. | r2
   e4 |  f4.( e8[ d]) r8 | d4.( c8[ h]) r8 | a2. | e2
   a4 | e'4.( d8[ c]) r8 | d4.( c8[ h]) r8 | a2. ~ a2 r4 | \bar "|."
}

%% This is the second voice.
SecondVoice = \relative c {
   \clef bass
   \time 3/4
   \key a \minor

   \partial 4
    r4 | e2.              | d2.             | a2. | e2
    a4 | e'2.             | d2       f4     | e2. | r2.
       |  f2.             | d2.             | a2. | e2
    a4 | e'2.             | d2       h4     | a2. ~ a2 r4 | \bar "|."
}


%% Melodies, lyrics and chords can be assigned to a variable and then
%% be *reused* elsewhere.  Here are three different accompaniment
%% patterns, which are used throughout the accompaniment melody.
AccompA = \relative c { a4 e'8 a, e' a, | }
AccompB = \relative c { g4 d'8 g, d' g, | }
AccompC = \relative c { e,4 h'8 e, h' e, | }

Accompaniment = {
   \clef bass
   \time 3/4
   \key a \minor

   \partial 4
    r4 | \AccompA \AccompB \AccompA \AccompA
        \AccompA \AccompB \AccompA \AccompA
        \AccompC \AccompC \AccompA \AccompA
        \AccompA \AccompB \AccompA | a2 r4 | \bar "|."
}

%% The top level music definition.
<<
  \new Staff \Melody
  \new Staff \Accompaniment
  \new Staff \SecondVoice
>>

Rendered output

Meta has a page about this at:

  1. ^ "LilyPond is linked to GUILE, GNU's Scheme library for extension programming. The Scheme library provides the glue that holds together the low-level routines and separate modules which are written in C++."[1]
Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.