Lilypond Language Reference
***************************

Notes and Note Modifiers
************************

Notes
=====

Typesetting a note is done by defining its pitch, duration and any additional markup.  In general:

PITCH[DURATION][NOTE_MODIFIERS]

Details for pitch, duration and modifiers are each covered separately.

Pitch
=====

BASENOTE[FLAT|SHARP][OCTAVE]

Typesets a note at a given pitch.  Values for basenote are a through g, r for typesetting a rest, or s for including a non-printing space, or skip.  Rests and skips consist of the basenote only. A FLAT is designated by appending es to the basenote, and a SHARP by appending is.  The language for this syntax is Dutch, but a variety of translations are available.  See Note Entry (GNU LilyPond).

The OCTAVE consists of a sequence of  ' or , characters.  When entering absolute pitches, the default, no octave mark indicates the octave below middle c.  Each ' character raises the note by one octave, and each , character lowers the note by one octave.  The ' and , may not be mixed. When entering relative pitches (see \relative) no octave mark indicates the note should be typeset in the octave which puts its pitch nearest to the preceeding note.  The octave marks then raise or lower the pitch by octaves relative to this pitch.

For more information on rests and skips see \rest, and \skip.

Duration
========

[NUMBER][.]

The duration of a note is appended to the note pitch and must come before other note modifiers.  The NUMBER must be an integer power of 2 and represents a fraction of a whole note.  So, for example, 4 represents 1/4 of a whole note: one quarter note.  One or more periods may follow the duration.  Each period typesets one dot after the note and has the same meaning as in standard music notation.

Note Modifiers
==============

[ and ]
-------

Appending [ to a note causes beaming to begin at that note.  A manual beam is terminated by appending ] to a subsequent note.

( and )
-------

Appending ( to a note causes a slur to begin at that note.  The slur ends at the note marked with ).

-, ^, and _
-----------

Keywords
********

<< >>
=====

<< VOICE CONTEXT [VOICE CONTEXT...] >>

This seems to work subtley differently in \notes, \voice, \staff and \score contexts.  Need to investigate...

|
=

MUSIC EXPRESSION | MUSIC EXPRESSION

Causes the lilypond program to display a warning if it has not calculated that a bar line should be typeset at the location of this token.

~
=

note1 ~ note2

Produces a tie between notes1 and note2.

\acciaccatura
=============

\acciaccatura NOTE1 NOTE2

Produces an acciaccatura where NOTE1 is a grace note.  Also creates a slur from NOTE1 to NOTE2.  While the following regular note, NOTE2, is not technically required, the command is of dubious use without it.

Introduced in version x.

See \appoggiatura.

\accepts
========

\accepts CONTEXT

Redefines an existing context (see \context) with the properties from custom context.  For example, if you have defined a custom context like

\context {
    \name CustomContext
    \override Stem #'transparent = ##t
}

you may redefine an existing context with these properties with

\context {
    \StaffContext              % An existing context
    \accepts CustomContext     % Modifications
}

Introduced in version x.

See \denies.

\addlyrics
==========

\addlyrics  MUSIC LYRICS.

Introduced in version x.

\addquote
=========

Introduced in version x.

\alias
======

Introduced in version x.

\alternative
============

Introduced in version x.

\apply
======

Introduced in version x.

\applycontext
=============

Introduced in version x.

\applyoutput
============

Introduced in version x.

\appoggiatura
=============

Introduced in version x.

\autoBeamOff
============

\autoBeamOff
============

\autochange
===========

Introduced in version x.

\bar
====

Introduced in version x.

\book
=====

Introduced in version x.

\breathe
========

Introduced in version x.

\change
=======

Introduced in version x.

\chords
=======

Introduced in version x.

\clef
=====

Introduced in version x.

\consists
=========

Introduced in version x.

\consistsend
============

Introduced in version x.

\context
========

Introduced in version x.

\default
========

Introduced in version x.

\denies
=======

Introduced in version x.

\drums
======

Introduced in version x.

\description
============

Introduced in version x.

\figures
========

Introduced in version x.

\grace
======

Introduced in version x.

\grobdescriptions
=================

Introduced in version x.

\header
=======

Introduced in version x.

\key
====

Introduced in version x.

\lyrics
=======

Introduced in version x.

\lyricsto
=========

Introduced in version x.

\mark
=====

Introduced in version x.

\markup
=======

Introduced in version x.

\midi
=====

Introduced in version x.

\name
=====

Introduced in version x.

\new
====

Introduced in version x.

\newlyrics
==========

Introduced in version x.

\noBeam
=======

Introduced in version x.

\notes
======

Introduced in version x.

\octave
=======

Introduced in version x.

\once
=====

Introduced in version x.

\override
=========

Introduced in version x.

\paper
======

Introduced in version x.

\partcombine
============

Introduced in version x.

\partial
========

Introduced in version x.

\quote
======

Introduced in version x.

\relative
=========

Introduced in version x.

\remove
=======

Introduced in version x.

\repeat
=======

Introduced in version x.

\rest
=====

Introduced in version x.

\revert
=======

Introduced in version x.

\score
======

Introduced in version x.

\sequential
===========

Introduced in version x.

\set
====

Introduced in version x.

\simultaneous
=============

Introduced in version x.

\skip
=====

Introduced in version x.

\tag
====

Introduced in version x.

\tempo
======

Introduced in version x.

\time
=====

Introduced in version x.

\times
======

Introduced in version x.

\transpose
==========

Introduced in version x.

\transposition
==============

Introduced in version x.

\type
=====

Introduced in version x.

\unset
======

Introduced in version x.

\with
=====

Predefined Commands
*******************

These are words defined outside of the lilypond core language, but which are typically defined at startup by reading the standard initalization files.  The location of these files is installation dependant, but the default location is /usr/local/share/lilypond/<version>/ly.

Formal Grammer
**************