@section Overview
This document@footnote{This document has been revised for
-LilyPond 1.2.} describes the the GNU LilyPond input format, which is
-a language for defining music. We call this language @emph{Music
-Definition Language} or @emph{Mudela}, for short.@footnote{If anybody
-comes up with a better name, we'd gladly take this. Gourlay already
-uses a ``Musical Description Language,'' ISO standard 10743 defines a
-``Standard Music Description Language.'' We're not being original
-here.}
+LilyPond 1.2.} describes the the GNU LilyPond input format
-@emph{Mudela} is a language that allows you to
+with @emph{Lilypond}-input you can
@itemize @bullet
@item create musical expressions by combining pitches, durations
you can enter them in manageable chunks.
@end itemize
-@emph{Mudela} aims to define a piece of music completely, both from
+@emph{Lilypond} input aims to define a piece of music completely, both from
typesetting and from a performance point of view.
Specify the version of LilyPond that a file was written for. The
argument is a version string in quotes, for example @code{"1.2.0"}.
This is used to detect invalid input, and to aid
-@code{convert-mudela}, a tool that automatically upgrades input files.
+@code{convert-ly}, a tool that automatically upgrades input files.
@node modes, , , Reference Manual
-To simplify entering notes, lyrics, and chords, @emph{Mudela} has three
+To simplify entering notes, lyrics, and chords, @emph{Lilypond} has three
special input modes on top of the default mode. In each mode, words
are identified on the input. If @code{"word"} is encountered, it is
treated as a string. If @code{\word} is encountered, it is treated as
@item Normal mode.
@cindex mode!normal
- At the start of parsing, @emph{Mudela} is in Normal mode. In Normal
+ At the start of parsing, @emph{Lilypond} is in Normal mode. In Normal
mode, a word is an alphabetic character followed by alphanumeric
characters. If @code{word} is encountered on the input it is
treated as a string.
@cindex types and identifiers
-@emph{Mudela} has a limited set of types:
+@emph{Lilypond} has a limited set of types:
@itemize @bullet
@item integers
@item score definitions (@code{\score}@keyindex{score} blocks)
@end itemize
-Type is a syntactical property: @emph{Mudela} has no real type system,
+Type is a syntactical property: @emph{Lilypond} has no real type system,
so there is no support for generic expressions, functions, or user
defined types. For the same reason, it is not possible to mix reals
and integers in arithmetic expressions, and ``type
identifier, you use `@var{name}=@var{value}' and to refer to an
identifier, you preceed its name with a backslash:
`@code{\}@var{name}'. Identifier assignments must appear at top level
-in the @emph{Mudela} file. Semicolons are forbidden after assignments
+in the @emph{Lilypond} file. Semicolons are forbidden after assignments
appearing at top level but they are obligatory after assignments
appearing in the @code{\paper} block, see Section XREF-paper [FIXME].
@cindex music expressions
-Music in @emph{Mudela} is entered as a music expression. Notes, rests,
+Music in @emph{Lilypond} is entered as a music expression. Notes, rests,
lyric syllables are music expressions (the atomic
expressions)
@cindex atomic music expressions
(`@code{,}@indexcode{,}') characters. Each @code{'} raises the pitch by one
octave; each @code{,} lowers the pitch by an octave.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c' d' e' f' g' a' b' c''
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
cis' dis' eis' fis' gis' ais' bis'
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
ces' des' es' fes' ges' as' bes'
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
cisis' eisis' gisis' aisis' beses'
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
ceses' eses' geses' ases' beses'
-@end mudela
+@end lilypond
Whenever a C-sharp is desired, you must specify a C-sharp. LilyPond
will determine what accidentals to typeset depending on the key and
accidental within parentheses can be obtained by adding the question
mark `@code{?}@indexcode{?}' after the pitch.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
cis' d' e' cis' c'? d' e' c'!
-@end mudela
+@end lilypond
@cindex duration
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes \relative c'' {
a\longa a\breve
} %}
}
}
-@end mudela
+@end lilypond
@end quotation
@quotation
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes \relative c'' {
r\longa r\breve
}
}
}
-@end mudela
+@end lilypond
@end quotation
If the duration is omitted then it is set equal to the previous
assumed. The duration can be followed by a dot (`@code{.}@indexcode{.}')
to obtain dotted note lengths.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
a'4. b'4.
-@end mudela
+@end lilypond
You can alter the length of duration by writing
`@code{*}@var{fraction}' after it. This will not affect the
you need to know exactly how the backend works. Example:
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\relative c'' { c4
\context Staff \outputproperty
#(make-type-checker 'Note_head)
#'extra-offset = #'(5.0 . 7.5)
<c8 e g> }
-@end mudela
+@end lilypond
This selects all note heads occurring at current staff level, and sets
the extra-offset of those heads to (5,7.5), shifting them up and
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes {
\cadenzaOn
linewidth = -1.0;
}
}
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[]
+@lilypond[]
\score {
\notes {
\cadenzaOn
linewidth = 4.5 \in;
}
}
-@end mudela
+@end lilypond
@end quotation
The three clef symbols can also be obtained using the names `@code{G}',
A beam is specified by surrounding the beamed notes with brackets
`@code{[}@indexcode{[}' and `@code{]}@indexcode{]}'.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
[a'8 a'] [a'16 a' a' a']
-@end mudela
+@end lilypond
Some more elaborate constructions:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
[a'16 <a' c''> c'' <a' c''>]
\times 2/3 { [e'8 f' g'] }
-@end mudela
+@end lilypond
Beaming can be generated automatically; see section XREF-autobeam [FIXME].
XREF-tremolo [FIXME]).
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\repeat "tremolo" 8 { c16 d16 }
\repeat "tremolo" 4 { c16 d16 }
-@end mudela
+@end lilypond
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c'4:32
-@end mudela
+@end lilypond
@cindex --@@@code{-}@code{-}
If you try to tie together chords which have no common pitches, a
warning message will appear and no ties will be created.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
e' ~ e' <c' e' g'> ~ <c' e' g'>
-@end mudela
+@end lilypond
respectively. Here is a chart showing symbols above notes, with the
name of the corresponding symbol appearing underneath.
-@mudela[]
+@lilypond[]
\score {
< \notes {
}
}
-@end mudela
+@end lilypond
In addition, it is possible to place arbitrary strings of text or
@TeX{} above or below notes by using a string instead of an
supported) and single characters shorthands exist for a few
common symbols
-@mudela[]
+@lilypond[]
\score {
\notes {
}
}
-@end mudela
+@end lilypond
Dynamic marks are specified by using an identifier after a note:
`@code{c4-\ff}' (the dash is optional for dynamics: `@code{c4 \ff})'.
first note in the slur. This makes it possible to put a note in
slurs from both sides:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
f'()g'()a' [a'8 b'(] a'4 g'2 )f'4
-@end mudela
+@end lilypond
@cindex crescendo
bound to notes, if you want to get several marks during one note, you
must use spacer notes.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c'' \< \! c'' d'' \decr e'' \rced
< f''1 { s4 \< \! s2 \> \! s4 } >
-@end mudela
+@end lilypond
@example
You can attach a (general) span request to a note using
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
c'4-\spanrequest \start "slur"
c'4-\spanrequest \stop "slur"
-@end mudela
+@end lilypond
The slur syntax with parentheses is a shorthand for this.
used, or the value of the @code{tremoloFlags}@indexcode{tremoloFlags} property if there was
no last value.
-@mudela[verbatim,fragment,center]
+@lilypond[verbatim,fragment,center]
c'2:8 c':32
-@end mudela
+@end lilypond
expressions any way you like. This simple example shows how three
chords can be expressed in two different ways:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\notes \context Staff {
\cadenzaOn
<a c'> <b d' > <c' e'>
< { a b c' } { c' d' e' } >
}
-@end mudela
+@end lilypond
@cindex context selection
@c @keyindex{context}
If you try to use a chord as the first thing in your score, you might
get multiple staffs instead of a chord.
-@mudela[verbatim,center]
+@lilypond[verbatim,center]
\score {
\notes <c''4 e''>
\paper {
linewidth = -1.;
}
}
-@end mudela
+@end lilypond
This happens because the chord is interpreted by a score context.
Each time a note is encountered a default Voice context (along with a
Staff context) is created. The solution is to explicitly instantiate
a Voice context:
-@mudela[verbatim,center]
+@lilypond[verbatim,center]
\score {
\notes\context Voice <c''4 e''>
\paper {
linewidth = -1.;
}
}
-@end mudela
+@end lilypond
Entering scales is straightforward in relative mode.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\relative c' {
c d e f g a b c c,
}
-@end mudela
+@end lilypond
And octave changing marks are used for intervals greater than a fourth.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\relative c'' {
c g c f, c' a, e'' }
-@end mudela
+@end lilypond
If the preceding item is a chord, the first note of the chord is used
to determine the first note of the next chord. But other notes
within the second chord are determined by looking at the immediately
preceding note.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\relative c' {
c <c e g>
<c' e g>
<c, e' g>
}
-@end mudela
+@end lilypond
The pitch after the @code{\relative} contains a notename. To parse
the pitch as a notename, you have to be in note mode, so there must
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\transpose c'' {
\chords {
c1 c:3- c:7 c:8
}
}
-@end mudela
+@end lilypond
@end quotation
The second type of modifier that may appear after the `@code{:}' is a
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\transpose c'' {
\chords {
c1:m c:min7 c:maj c:aug c:dim c:sus
}
}
-@end mudela
+@end lilypond
@end quotation
notes to be subtracted are listed after a `@code{^}' character,
separated by dots.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\transpose c'' {
\chords {
c1^3 c:7^5.3 c:8^7
}
}
-@end mudela
+@end lilypond
Chord inversions can be specified by appending `@code{/}@indexcode{/}' and
the name of a single note to a chord. This has the effect of
note in the chord. If the specified note is not in the chord, a
warning will be printed.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\transpose c''' {
\chords {
c1 c/e c/g c:7/e
}
}
-@end mudela
+@end lilypond
Bass notes can be added by `@code{/+}@indexcode{/+}' and
the name of a single note to a chord. This has the effect of
adding the specified note to the chord, lowered by an octave,
so it becomes the lowest note in the chord.
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
\transpose c''' {
\chords {
c1 c/+c c/+g c:7/+b
}
}
-@end mudela
+@end lilypond
Throughout these examples, chords have been shifted around the staff
using @code{\transpose}.
which 3 notes have the length of 2, so the notes are 2/3 of
their written length:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
g'4 \times 2/3 {c'4 c' c'} d'4 d'4
-@end mudela
+@end lilypond
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\relative c'' {
\grace c8 c4 \grace { [c16 c16] } c4
\grace { \property Grace.flagStyle = "" c16 } c4
}
-@end mudela
+@end lilypond
@end quotation
At present, nesting @code{\grace}@keyindex{grace} notes, e.g.
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
c'1
\repeat volta 2 { c'4 d' e' f' }
\repeat volta 2 { f' e' d' c' }
-@end mudela
+@end lilypond
@end quotation
With alternative endings:
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
c'1
\repeat volta 2 {c'4 d' e' f'}
\alternative { {d'2 d'} {f' f} }
-@end mudela
+@end lilypond
@end quotation
Folded repeats look like this:@footnote{Folded repeats offer little
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
c'1
\repeat fold 2 {c'4 d' e' f'}
\alternative { {d'2 d'} {f' f} }
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\context Staff {
\relative c' {
\partial 4;
}
}
-@end mudela
+@end lilypond
@end quotation
If you don't give enough alternatives for all of the repeats, then
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\context Staff {
\relative c' {
\repeat volta 3 { \partial 4; e | c2 d2 | e2 f2 | }
}
}
-@end mudela
+@end lilypond
@end quotation
It is possible to nest @code{\repeat}. This is not entirely
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
\context Staff {
\clef "F";
{ \key e \major; c d e f }
\transpose cis'' { \key e \major; c d e f }
}
-@end mudela
+@end lilypond
@end quotation
If you want to use both @code{\transpose} and @code{\relative}, then
@quotation
-@mudela[verbatim,fragment]
+@lilypond[verbatim,fragment]
\addlyrics
\transpose c'' {
\property Voice.automaticMelismata = ##t
\context Lyrics \lyrics {
do4 re mi fa }
-@end mudela
+@end lilypond
@end quotation
You should use a single rhythm melody, and single rhythm lyrics (a
@quotation
-@mudela[verbatim,fragment]
+@lilypond[verbatim,fragment]
\addlyrics
\transpose c'' {
c8 () cis d8. e16 f2
< { do4 re mi fa }
{ do8 re mi fa } >
-@end mudela
+@end lilypond
@end quotation
It is valid (but probably not very useful) to use notes instead of
@quotation
-@mudela[fragment,verbatim]
+@lilypond[fragment,verbatim]
<
\context ChordNames {
\chords{a b c} \notes{<d f g> <e g b>}
}
>
-@end mudela
+@end lilypond
@end quotation
LilyPond examines chords specified as lists of notes to determine a
name to give the chord. By default, LilyPond will not try to
identify chord inversions:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
<
\context ChordNameVoice \notes {
<e'1 g' c''>
<e'1 g' c''>
}
>
-@end mudela
+@end lilypond
If you want inversions to be recognized, you must set the property
@code{ChordNames.chordInversion}@indexcode{ChordNames.chordInversion}:
-@mudela[fragment,verbatim,center]
+@lilypond[fragment,verbatim,center]
<
\property Score.chordInversion = ##t
\context ChordNameVoice \notes {
<e'1 g' c''>
}
>
-@end mudela
+@end lilypond
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
<
\notes \transpose c'' {
>
}
-@end mudela
+@end lilypond
@end quotation
You may want a continuous line after the syllables to show melismata.
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
<
\notes \relative c'' {
>
}
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
<
\notes \transpose c'' {
>
}
-@end mudela
+@end lilypond
@end quotation
@quotation
-@mudela[verbatim]
+@lilypond[verbatim]
\score {
\notes \relative c'' {
c4 <d4 \context Staff = "another" e4> f
}
}
-@end mudela
+@end lilypond
@end quotation
In this example, the @code{c} and @code{d} are printed on the
doesn't result in this:
-@mudela[]
+@lilypond[]
\score {
\notes \relative c'' {
}
}
-@end mudela
+@end lilypond
For the @code{c4}, a default @code{Staff} (with a contained
@code{Voice}) context is created. After the @code{c4} ends, no