This file documents GNU LilyPond.
Copyright 1999–2007 by the authors
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections. A copy of the license is included in the section entitled “GNU Free Documentation License”.
This is the Notation Reference (NR) for GNU LilyPond version 2.11.58. For more information about how this fits with the other documentation, see About the documentation.
More information can be found at http://www.lilypond.org/. The website contains on-line copies of this and other documentation.
We want to dedicate this program to all the friends that we met through music.Han-Wen and Jan
This chapter explains how to create musical notation.
This section discusses how to specify the pitch of notes. There are three steps to this process: input, modification, and output.
This section discusses how to input pitches. There are two different ways to place notes in octaves: absolute and relative mode. In most cases, relative mode will be more convenient.
A pitch name is specified using lowercase letters a
through g
. The note names c
to b
are
engraved in the octave below middle C.
\clef bass c d e f g a b c d e f g
Other octaves may be specified with a single quote ('
)
or comma (,
) character. Each '
raises the
pitch by one octave; each ,
lowers the pitch by an
octave.
\clef treble c' c'' e' g d'' d' d c \clef bass c, c,, e, g d,, d, d c
Music Glossary: Pitch names.
Snippets: Pitches.
When octaves are specified in absolute mode it is easy to accidentally put a pitch in the wrong octave. Relative octave mode reduces these errors since most of the time it is not necessary to indicate any octaves at all. Furthermore, in absolute mode a single mistake may be difficult to spot, while in relative mode a single error puts the rest of the piece off by one octave.
\relative startpitch musicexpr
In relative mode, each note is assumed to be as close to the previous note as possible. This means that the octave of each pitch inside musicexpr is calculated as follows:
'
or ,
can be
added to respectively raise or lower a pitch by an extra octave,
relative to the pitch calculated without an octave mark.
''
and ,,
will alter the pitch by two
octaves.
c
.
Here is the relative mode shown in action:
\relative c { \clef bass c d e f g a b c d e f g }
Octave changing marks are used for intervals greater than a fourth:
\relative c'' { c g c f, c' a, e'' c }
A note sequence without a single octave mark can nevertheless span large intervals:
\relative c { c f b e a d g c }
If the preceding item is a chord, the first note of the chord is
used as the reference point for the octave placement of a
following note or chord. Inside chords, the next note is always
relative to the preceding one. Examine the next example
carefully, paying attention to the c
notes.
\relative c' { c <c e g> <c' e g'> <c, e, g''> }
As explained above, the octave of pitches is calculated only with the note names, regardless of any alterations. Therefore, an E-double-sharp following a B will be placed higher, while an F-double-flat will be placed lower. In other words, a double-augmented fourth is considered a smaller interval than a double-diminished fifth, regardless of the number of semitones that each interval contains.
\relative c'' { c2 fis c2 ges b2 eisis b2 feses }
Music Glossary: fifth, interval, Pitch names.
Notation Reference: Octave checks.
Snippets: Pitches.
Internals Reference: RelativeOctaveMusic.
The relative conversion will not affect \transpose
,
\chordmode
or \relative
sections in its argument.
To use relative mode within transposed music, an additional
\relative
must be placed inside \transpose
.
If no startpitch is specified for \relative
,
then c'
is assumed. However, this is a deprecated
option and may disappear in future versions, so its use is
discouraged.
Note: New users are sometimes confused about accidentals and
key signatures. In LilyPond, note names are the raw input; key
signatures and clefs determine how this raw input is displayed.
An unaltered note like c means ‘C natural’,
regardless of the key signature or clef. For more information,
see Accidentals and key signatures.
|
A sharp pitch is made by adding is
to the note
name, and a flat pitch by adding es
. As you
might expect, a double sharp or double flat
is made by adding isis
or eses
. This syntax is
derived from Dutch note naming conventions. To use other names
for accidentals, see Note names in other languages.
ais1 aes aisis aeses
A natural will cancel the effect of an accidental or key signature. However, naturals are not encoded into the note name syntax with a suffix; a natural pitch is shown as a simple note name:
a4 aes a2
Quarter tones may be added; the following is a series of Cs with increasing pitches:
ceseh1 ces ceh c cih cis cisih
Normally accidentals are printed automatically, but you may also
print them manually. A reminder accidental can be forced by
adding an exclamation mark !
after the pitch. A
cautionary accidental (i.e., an accidental within parentheses) can
be obtained by adding the question mark ?
after the
pitch. These extra accidentals can also be used to produce
natural signs.
cis cis cis! cis? c c c! c?
Accidentals on tied notes are only printed at the beginning of a new system:
cis1 ~ cis ~ \break cis
Preventing extra naturals from being automatically added
In accordance with standard typesetting rules, a natural sign is
printed before a sharp or flat if a previous accidental on the same
note needs to be canceled. To change this behavior, set the
extraNatural
property to "false" in the Staff
context.
\relative c'' { aeses4 aes ais a \set Staff.extraNatural = ##f aeses4 aes ais a }
Music Glossary: sharp, flat, double sharp, double flat, Pitch names, quarter tone.
Learning Manual: Accidentals and key signatures.
Notation Reference: Automatic accidentals, Annotational accidentals, Note names in other languages.
Snippets: Pitches.
Internals Reference: Accidental_engraver, Accidental, AccidentalCautionary, accidental-interface.
There are no generally accepted standards for denoting quarter-tone accidentals, so LilyPond's symbol does not conform to any standard.
There are predefined sets of note names for various other
languages. To use them, include the language-specific init file.
For example, to use English notes names, add
\include "english.ly"
to the top of the input file.
The available language files and the note names they define are:
Language | Note names | sharp | flat | double sharp | double flat
|
---|---|---|---|---|---|
nederlands.ly | c d e f g a bes b | -is | -es | -isis | -eses
|
arabic.ly | do re mi fa sol la sib si | -d | -b | -dd | -bb
|
catalan.ly | do re mi fa sol la sib si | -d/-s | -b | -dd/-ss | -bb
|
deutsch.ly | c d e f g a b h | -is | -es | -isis | -eses
|
english.ly | c d e f g a bf b | -s/-sharp | -f/-flat | -ss/-x/-sharpsharp | -ff/-flatflat
|
espanol.ly | do re mi fa sol la sib si | -s | -b | -ss | -bb
|
italiano.ly | do re mi fa sol la sib si | -d | -b | -dd | -bb
|
norsk.ly | c d e f g a b h | -iss/-is | -ess/-es | -ississ/-isis | -essess/-eses
|
portugues.ly | do re mi fa sol la sib si | -s | -b | -ss | -bb
|
suomi.ly | c d e f g a b h | -is | -es | -isis | -eses
|
svenska.ly | c d e f g a b h | -iss | -ess | -ississ | -essess
|
vlaams.ly | do re mi fa sol la sib si | -k | -b | -kk | -bb
|
In Dutch, aes
is contracted to as
, but both forms
are accepted in LilyPond. Similarly, both es
and
ees
are accepted. This also applies to
aeses
/ ases
and
eeses
/ eses
. Sometimes only these
contracted names are defined in the corresponding language files.
a2 as e es a ases e eses
Some music uses microtones whose alterations are fractions of a ‘normal’ sharp or flat. The note names for quarter-tones defined in the various language files are listed in the following table. Here the prefixes semi- and sesqui- mean ‘half’ and ‘one and a half’, respectively. For the other languages, no special names have been defined yet.
Language | Note names | semi-sharp | semi-flat | sesqui-sharp | sesqui-flat
|
---|---|---|---|---|---|
nederlands.ly | c d e f g a bes b | -ih | -eh | -isih | -eseh
|
arabic.ly | do re mi fa sol la sib si | -sd | -sb | -dsd | -bsb
|
deutsch.ly | c d e f g a b h | -ih | -eh | -isih | -eseh
|
english.ly | c d e f g a bf b | -qs | -qf | -tqs | -tqf
|
italiano.ly | do re mi fa sol la sib si | -sd | -sb | -dsd | -bsb
|
portugues.ly | do re mi fa sol la sib si | -sqt | -bqt | -stqt | -btqt
|
Music Glossary: Pitch names.
Snippets: Pitches.
This section discusses how to modify pitches.
In relative mode, it is easy to forget an octave changing mark. Octave checks make such errors easier to find by displaying a warning and correcting the octave if a note is found in an unexpected octave.
To check the octave of a note, specify the absolute octave after
the =
symbol. This example will generate a warning
(and change the pitch) because the second note is the absolute
octave d''
instead of d'
as indicated by the octave
correction.
\relative c'' { c2 d='4 d e2 f }
The octave of notes may also be checked with the
\octaveCheck
controlpitch command.
controlpitch is specified in absolute mode. This checks
that the interval between the previous note and the
controlpitch is within a fourth (i.e., the normal
calculation of relative mode). If this check fails, a warning is
printed, but the previous note is not changed. Future notes are
relative to the controlpitch.
\relative c'' { c2 d \octaveCheck c' e2 f }
Compare the two bars below. The first and third \octaveCheck
checks fail, but the second one does not fail.
\relative c'' { c4 f g f c4 \octaveCheck c' f \octaveCheck c' g \octaveCheck c' f }
Snippets: Pitches.
Internals Reference: RelativeOctaveCheck.
A music expression can be transposed with \transpose
. The
syntax is
\transpose frompitch topitch musicexpr
This means that musicexpr is transposed by the interval between the pitches frompitch and topitch: any note with pitch frompitch is changed to topitch and any other note is transposed by the same interval. Both pitches are entered in absolute mode.
Consider a piece written in the key of D-major. It can be transposed up to E-major; note that the key signature is automatically transposed as well.
\transpose d e { \relative c' { \key d \major d4 fis a d } }
If a part written in C (normal concert pitch) is to be played on the A clarinet (for which an A is notated as a C and thus sounds a minor third lower than notated), the appropriate part will be produced with:
\transpose a c' { \relative c' { \key c \major c4 d e g } }
Note that we specify \key c \major
explicitly. If we
do not specify a key signature, the notes will be transposed but
no key signature will be printed.
\transpose
distinguishes between enharmonic pitches: both
\transpose c cis
or \transpose c des
will
transpose up a semitone. The first version will print sharps and
the notes will remain on the same scale step, the second version
will print flats on the scale step above.
music = \relative c' { c d e f } \new Staff { \transpose c cis { \music } \transpose c des { \music } }
\transpose
may also be used in a different way, to input
written notes for a transposing instrument. The previous examples
show how to enter pitches in C (or concert pitch) and
typeset them for a transposing instrument, but the opposite is
also possible if you for example have a set of instrumental parts
and want to print a conductor's score. For example, when entering
music for a B-flat trumpet that begins on a notated E (concert D),
one would write:
musicInBflat = { e4 ... } \transpose c bes, \musicInBflat
To print this music in F (e.g., rearranging to a French horn) you
could wrap the existing music with another \transpose
:
musicInBflat = { e4 ... } \transpose f c' { \transpose c bes, \musicInBflat }
For more information about transposing instruments, see Instrument transpositions.
Transposing music with minimum accidentals
This example uses some Scheme code to enforce enharmonic modifications for notes in order to have the minimum number of accidentals. In this case, the following rules apply:
In this manner, the most natural enharmonic notes are chosen.
#(define (naturalize-pitch p) (let* ((o (ly:pitch-octave p)) (a (* 4 (ly:pitch-alteration p))) ; alteration, a, in quarter tone steps, for historical reasons (n (ly:pitch-notename p))) (cond ((and (> a 1) (or (eq? n 6) (eq? n 2))) (set! a (- a 2)) (set! n (+ n 1))) ((and (< a -1) (or (eq? n 0) (eq? n 3))) (set! a (+ a 2)) (set! n (- n 1)))) (cond ((> a 2) (set! a (- a 4)) (set! n (+ n 1))) ((< a -2) (set! a (+ a 4)) (set! n (- n 1)))) (if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7)))) (if (> n 6) (begin (set! o (+ o 1)) (set! n (- n 7)))) (ly:make-pitch o n (/ a 4)))) #(define (naturalize music) (let* ((es (ly:music-property music 'elements)) (e (ly:music-property music 'element)) (p (ly:music-property music 'pitch))) (if (pair? es) (ly:music-set-property! music 'elements (map (lambda (x) (naturalize x)) es))) (if (ly:music? e) (ly:music-set-property! music 'element (naturalize e))) (if (ly:pitch? p) (begin (set! p (naturalize-pitch p)) (ly:music-set-property! music 'pitch p))) music)) naturalizeMusic = #(define-music-function (parser location m) (ly:music?) (naturalize m)) music = \relative c' { c4 d e g } \score { \new Staff { \transpose c ais \music \naturalizeMusic \transpose c ais \music \transpose c deses \music \naturalizeMusic \transpose c deses \music } \layout { } }
Notation Reference: Instrument transpositions.
Snippets: Pitches.
Internals Reference: TransposedMusic.
The relative conversion will not affect \transpose
,
\chordmode
or \relative
sections in its argument.
To use relative mode within transposed music, an additional
\relative
must be placed inside \transpose
.
This section discusses how to alter the output of pitches.
The clef may be altered. Middle C is shown in every example.
\clef treble c2 c \clef alto c2 c \clef tenor c2 c \clef bass c2 c
Other clefs include:
\clef french c2 c \clef soprano c2 c \clef mezzosoprano c2 c \clef baritone c2 c \break \clef varbaritone c2 c \clef subbass c2 c \clef percussion c2 c \clef tab c2 c
Further supported clefs are described under Ancient clefs.
By adding _8
or ^8
to the clef name, the
clef is transposed one octave down or up, respectively,
and _15
and ^15
transpose by two octaves.
The clef name must be enclosed in quotes when it contains
underscores or digits.
\clef treble c2 c \clef "treble_8" c2 c \clef "bass^15" c2 c
Tweaking clef properties
The command \clef "treble_8"
is equivalent to setting
clefGlyph
, clefPosition
(which controls the vertical
position of the clef), middleCPosition
and
clefOctavation
. A clef is printed when any of the properties
except middleCPosition
are changed.
Note that changing the glyph, the position of the clef, or the
octavation does not in itself change the position of subsequent notes
on the staff: the position of middle C must also be specified to do
this. The positional parameters are relative to the staff center line,
positive numbers displacing upwards, counting one for each line and
space. The clefOctavation
value would normally be set to 7, -7,
15 or -15, but other values are valid.
When a clef change takes place at a line break the new clef symbol is
printed at both the end of the previous line and the beginning of the
new line by default. If the warning clef at the end of the previous
line is not required it can be suppressed by setting the Staff
property explicitClefVisibility
to the value
end-of-line-invisible
. The default behavior can be recovered
with \unset Staff.explicitClefVisibility
.
The following examples show the possibilities when setting these properties manually. On the first line, the manual changes preserve the standard relative positioning of clefs and notes, whereas on the second line, they do not.
{ % The default treble clef c'1 % The standard bass clef \set Staff.clefGlyph = #"clefs.F" \set Staff.clefPosition = #2 \set Staff.middleCPosition = #6 c'1 % The baritone clef \set Staff.clefGlyph = #"clefs.C" \set Staff.clefPosition = #4 \set Staff.middleCPosition = #4 c'1 % The standard choral tenor clef \set Staff.clefGlyph = #"clefs.G" \set Staff.clefPosition = #-2 \set Staff.clefOctavation = #-7 \set Staff.middleCPosition = #1 c'1 % A non-standard clef \set Staff.clefPosition = #0 \set Staff.clefOctavation = #0 \set Staff.middleCPosition = #-4 c'1 \break % The following clef changes do not preserve % the normal relationship between notes and clefs: \set Staff.clefGlyph = #"clefs.F" \set Staff.clefPosition = #2 c'1 \set Staff.clefGlyph = #"clefs.G" c'1 \set Staff.clefGlyph = #"clefs.C" c'1 \set Staff.clefOctavation = #7 c'1 \set Staff.clefOctavation = #0 \set Staff.clefPosition = #0 c'1 % Here we go back to the normal clef: \set Staff.middleCPosition = #0 c'1 }
Notation Reference: Ancient clefs.
Snippets: Pitches.
Internals Reference: Clef_engraver, Clef, OctavateEight, clef-interface.
Note: New users are sometimes confused about accidentals and
key signatures. In LilyPond, note names are the raw input; key
signatures and clefs determine how this raw input is displayed.
An unaltered note like c means ‘C natural’,
regardless of the key signature or clef. For more information,
see Accidentals and key signatures.
|
The key signature indicates the tonality in which a piece is played. It is denoted by a set of alterations (flats or sharps) at the start of the staff. The key signature may be altered:
\key pitch mode
Here, mode should be \major
or \minor
to get a
key signature of pitch-major or pitch-minor,
respectively. You may also use the standard mode names, also
called church modes: \ionian
, \dorian
,
\phrygian
, \lydian
, \mixolydian
,
\aeolian
, and \locrian
.
\key g \major fis1 f fis
Preventing natural signs from being printed when the key signature changes
When the key signature changes, natural signs are automatically printed
to cancel any accidentals from previous key signatures. This may be
prevented by setting to "false" the printKeyCancellation
property in the Staff
context.
\relative c' { \key d \major a4 b cis d \key g \minor a4 bes c d \set Staff.printKeyCancellation = ##f \key d \major a4 b cis d \key g \minor a4 bes c d }
Non-traditional key signatures
The commonly used \key
command sets the keySignature
property, in the Staff
context.
To create non-standard key signatures, set this property directly. The format of this command is a list:
\set Staff.keySignature = #`(((octave . step) . alter) ((octave
. step) . alter) ...)
where, for each element in the list,
octave
specifies the octave (0 being the octave from middle C to
the B above), step
specifies the note within the octave (0 means
C and 6 means B), and alter
is ,SHARP ,FLAT ,DOUBLE-SHARP
etc. (Note the leading comma.)
Alternatively, for each item in the list, using the more concise format
(step . alter)
specifies that the same alteration should hold in
all octaves.
Here is an example of a possible key signature for generating a whole-tone scale:
\relative c' { \set Staff.keySignature = #`(((0 . 3) . ,SHARP) ((0 . 5) . ,FLAT) ((0 . 6) . ,FLAT)) c4 d e fis aes4 bes c2 }
Music Glossary: church mode, scordatura.
Learning Manual: Accidentals and key signatures.
Snippets: Pitches.
Internals Reference: KeyChangeEvent, Key_engraver, Key_performer, KeyCancellation, KeySignature, key-cancellation-interface, key-signature-interface.
Ottava brackets introduce an extra transposition of an octave for the staff:
a'2 b \ottava #1 a b \ottava #0 a b
The ottava
function also takes -1 (for 8va bassa),
2 (for 15ma), and -2 (for 15ma bassa) as arguments.
Ottava text
Internally, the set-octavation
function sets the properties
ottavation
(for example, to "8va"
or "8vb"
)
and middleCPosition
. To override the text of the bracket, set
ottavation
after invoking set-octavation
.
{ \ottava #1 \set Staff.ottavation = #"8" c''1 \ottava #0 c'1 \ottava #1 \set Staff.ottavation = #"Text" c''1 }
Music Glossary: octavation.
Snippets: Pitches.
Internals Reference: Ottava_spanner_engraver, OttavaBracket, ottava-bracket-interface.
When typesetting scores that involve transposing instruments, some parts can be typeset in a different pitch than the concert pitch. In these cases, the key of the transposing instrument should be specified; otherwise the MIDI output and cues in other parts will produce incorrect pitches. For more information about quotations, see Quoting other voices.
\transposition pitch
The pitch to use for \transposition
should correspond to
the real sound heard when a c'
written on the staff is
played by the transposing instrument. This pitch is entered in
absolute mode, so an instrument that produces a real sound which
is one tone higher than the printed music should use
\transposition d'
. \transposition
should
only be used if the pitches are not being entered in
concert pitch.
Here are a few notes for violin and B-flat clarinet where the parts have been entered using the notes and key as they appear in each part of the conductor's score. The two instruments are playing in unison.
\new GrandStaff << \new Staff = "violin" { \relative c'' { \set Staff.instrumentName = "Vln" \set Staff.midiInstrument = "violin" % not strictly necessary, but a good reminder \transposition c' \key c \major g4( c8) r c r c4 } } \new Staff = "clarinet" { \relative c'' { \set Staff.instrumentName = \markup { Cl (B\flat) } \set Staff.midiInstrument = "clarinet" \transposition bes \key d \major a4( d8) r d r d4 } } >>
The \transposition
may be changed during a piece. For
example, a clarinetist may switch from an A clarinet to a B-flat
clarinet.
\set Staff.instrumentName = "Cl (A)" \key a \major \transposition a c d e f \textLengthOn s1*0^\markup { Switch to B\flat clarinet } R1 \key bes \major \transposition bes c2 g
Music Glossary: concert pitch, transposing instrument.
Notation Reference: Quoting other voices, Transpose.
Snippets: Pitches.
There are many different conventions on how to typeset accidentals. LilyPond provides a function to specify which accidental style to use. This function is called as follows:
\new Staff << #(set-accidental-style 'voice) { ... } >>
The accidental style applies to the current Staff
by
default (with the exception of the styles piano
and
piano-cautionary
, which are explained below). Optionally,
the function can take a second argument that determines in which
scope the style should be changed. For example, to use the same
style in all staves of the current StaffGroup
, use:
#(set-accidental-style 'voice 'StaffGroup)
The following accidental styles are supported. To demonstrate each style, we use the following example:
musicA = { << \relative c' { cis'8 fis, d'4 <a cis>8 f bis4 | cis2. <c, g'>4 | } \\ \relative c' { ais'2 cis, | fis8 b a4 cis2 | } >> } musicB = { \clef bass \new Voice { \voiceTwo \relative c' { <fis, a cis>4 \change Staff = up cis' \change Staff = down <fis, a> \change Staff = up dis' | \change Staff = down <fis, a cis>4 gis <f a d>2 | } } } \new PianoStaff { << \context Staff = "up" { #(set-accidental-style 'default) \musicA } \context Staff = "down" { #(set-accidental-style 'default) \musicB } >> }
Note that the last lines of this example can be replaced by the following, as long as the same accidental style should be used in both staves.
\new PianoStaff { << \context Staff = "up" { %%% change the next line as desired: #(set-accidental-style 'default 'Score) \musicA } \context Staff = "down" { \musicB } >> }
default
This is the default typesetting behavior. It corresponds to
eighteenth-century common practice: accidentals are remembered to
the end of the measure in which they occur and only in their own
octave. Thus, in the example below, no natural signs are printed
before the b
in the second measure or the
last c
:
voice
The normal behavior is to remember the accidentals at
Staff
-level. In this style, however, accidentals are
typeset individually for each voice. Apart from that, the rule is
similar to default
.
As a result, accidentals from one voice do not get canceled in
other voices, which is often an unwanted result: in the following
example, it is hard to determine whether the second a
should be played natural or sharp. The voice
option should
therefore be used only if the voices are to be read solely by
individual musicians. If the staff is to be used by one musician
(e.g., a conductor or in a piano score) then modern
or
modern-cautionary
should be used instead.
modern
This rule corresponds to the common practice in the twentieth
century. It prints the same accidentals as default
, with
two exceptions that serve to avoid ambiguity: after temporary
accidentals, cancellation marks are printed also in the following
measure (for notes in the same octave) and, in the same measure,
for notes in other octaves. Hence the naturals before
the b
and the c
in the second measure of
the upper staff:
modern-cautionary
This rule is similar to modern
, but the ‘extra’
accidentals (the ones not typeset by default
) are typeset
as cautionary accidentals. They are by default printed with
parentheses, but they can also be printed in reduced size by
defining the cautionary-style
property of
AccidentalSuggestion
.
modern-voice
This rule is used for multivoice accidentals to be read both by
musicians playing one voice and musicians playing all voices.
Accidentals are typeset for each voice, but they are
canceled across voices in the same Staff
. Hence,
the a
in the last measure is canceled because the
previous cancellation was in a different voice, and
the d
in the lower staff is canceled because of the
accidental in a different voice in the previous measure:
modern-voice-cautionary
modern-voice
, but with the extra
accidentals (the ones not typeset by voice
) typeset as
cautionaries. Even though all accidentals typeset by
default
are typeset with this rule, some of them are
typeset as cautionaries.
piano
This rule reflects twentieth-century practice for piano notation.
Its behavior is very similar to modern
style, but here
accidentals also get canceled across the staves in the same
GrandStaff
or PianoStaff
, hence all the
cancellations of the final notes.
This accidental style applies to the current GrandStaff
or
PianoStaff
by default.
piano-cautionary
piano
but with the extra accidentals
typeset as cautionaries.
neo-modern
modern
, but they are printed
again if the same note appears later in the same measure – except
if the note is immediately repeated.
neo-modern-cautionary
neo-modern
, but the extra
accidentals are printed as cautionary accidentals.
dodecaphonic
no-reset
default
but with accidentals lasting
‘forever’ and not only within the same measure:
forget
no-reset
: Accidentals are not
remembered at all – and hence all accidentals are typeset
relative to the key signature, regardless of what came before in
the music. Unlike dodecaphonic
, this rule never prints
any naturals.
Dodecaphonic-style accidentals for each note including naturals
In early 20th century works, starting with Schoenberg, Berg and Webern (the "Second" Viennese school), every pitch in the twelve-tone scale has to be regarded as equal, without any hierarchy such as the classical (tonal) degrees. Therefore, these composers print one accidental for each note, even at natural pitches, to emphasize their new approach to music theory and language.
This snippet shows how to achieve such notation rules.
webernAccidentals = { % the 5s are just "a value different from any accidental" \set Staff.keySignature = #'((0 . 5) (1 . 5) (2 . 5) (3 . 5) (4 . 5) (5 . 5) (6 . 5)) \set Staff.extraNatural = ##f #(set-accidental-style 'forget) } \score { { \webernAccidentals c'4 dis' cis' cis' c'4 dis' cis' cis' c'4 c' dis' des' } \layout { \context { \Staff \remove "Key_engraver" } } }
Snippets: Pitches.
Internals Reference: Accidental, Accidental_engraver, GrandStaff and PianoStaff, Staff, AccidentalSuggestion, AccidentalPlacement, accidental-suggestion-interface.
Simultaneous notes are considered to be entered in sequential
mode. This means that in a chord the accidentals are typeset as
if the notes in the chord happen one at a time, in the order in
which they appear in the input file. This is a problem when
accidentals in a chord depend on each other, which does not happen
for the default accidental style. The problem can be solved by
manually inserting !
and ?
for the
problematic notes.
The term ambitus (pl. ambitus) denotes a range of pitches for a given voice in a part of music. It may also denote the pitch range that a musical instrument is capable of playing. Ambitus are printed on vocal parts so that performers can easily determine if it matches their capabilities.
Ambitus are denoted at the beginning of a piece near the initial clef. The range is graphically specified by two note heads that represent the lowest and highest pitches. Accidentals are only printed if they are not part of the key signature.
\layout { \context { \Voice \consists "Ambitus_engraver" } } \relative c'' { aes c e2 cis,1 }
Adding ambitus per voice
Ambitus can be added per voice. In this case, the ambitus must be moved manually to prevent collisions.
\new Staff << \new Voice \with { \consists "Ambitus_engraver" } \relative c'' { \override Ambitus #'X-offset = #2.0 \voiceOne c4 a d e f1 } \new Voice \with { \consists "Ambitus_engraver" } \relative c' { \voiceTwo es4 f g as b1 } >>
Ambitus with multiple voices
Adding the Ambitus_engraver
to the Staff
context creates
a single ambitus per staff, even in the case of staves with multiple
voices.
\new Staff \with { \consists "Ambitus_engraver" } << \new Voice \relative c'' { \voiceOne c4 a d e f1 } \new Voice \relative c' { \voiceTwo es4 f g as b1 } >>
Music Glossary: ambitus.
Snippets: Pitches.
Internals Reference: Ambitus_engraver, Voice, Staff, Ambitus, AmbitusAccidental, AmbitusLine, AmbitusNoteHead, ambitus-interface.
There is no collision handling in the case of multiple per-voice ambitus.
This section suggests ways of altering note heads.
Note heads may be altered:
c4 b a b \override NoteHead #'style = #'cross c4 b a b \revert NoteHead #'style c4 d e f
There is a shorthand for diamond shapes which can only be used inside chords:
<c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic>
To see all note head styles, see Note head styles.
Snippets: Pitches.
Notation Reference: Note head styles, Chorded notes.
Internals Reference: note-event, Note_heads_engraver, Ledger_line_engraver, NoteHead, LedgerLineSpanner, note-head-interface, ledger-line-spanner-interface.
The ‘easy play’ note head includes a note name inside the head. It is used in music for beginners. To make the letters readable, it should be printed in a large font size. To print with a larger font, see Setting the staff size.
#(set-global-staff-size 26) \relative c' { \easyHeadsOn c2 e4 f g1 \easyHeadsOff c,1 }
Notation Reference: Setting the staff size.
Snippets: Pitches.
Internals Reference: note-event, Note_heads_engraver, NoteHead, note-head-interface.
In shape note head notation, the shape of the note head corresponds to the harmonic function of a note in the scale. This notation was popular in nineteenth-century American song books. Shape note heads can be produced:
\aikenHeads c, d e f g a b c \sacredHarpHeads c, d e f g a b c
Shapes are typeset according to the step in the scale, where the
base of the scale is determined by the \key
command.
Applying note head styles depending on the step of the scale
The shapeNoteStyles
property can be used to define various note
head styles for each step of the scale (as set by the key signature or
the "tonic" property). This property requires a set of symbols, which
can be purely arbitrary (geometrical expressions such as
triangle
, cross
, and xcircle
are allowed) or based
on old American engraving tradition (some latin note names are also
allowed).
That said, to imitate old American song books, there are several
predefined note head styles available through shortcut commands such as
\aikenHeads
or \sacredHarpHeads
.
This example shows different ways to obtain shape note heads, and demonstrates the ability to transpose a melody without losing the correspondence between harmonic functions and note head styles.
fragment = { \key c \major c2 d e2 f g2 a b2 c } \score { \new Staff { \transpose c d \relative c' { \set shapeNoteStyles = #'#(do re mi fa #f la ti) \fragment } \relative c' { \set shapeNoteStyles = #'#(cross triangle fa #f mensural xcircle diamond) \fragment } } }
To see all note head styles, see Note head styles.
Snippets: Pitches.
Notation Reference: Note head styles.
Internals Reference: note-event, Note_heads_engraver, NoteHead, note-head-interface.
Improvisation is sometimes denoted with slashed note heads, where the performer may choose any pitch but should play the specified rhythm. Such note heads can be created:
\new Voice \with { \consists "Pitch_squash_engraver" } { e8 e g a a16( bes) a8 g \improvisationOn e8 ~ e2 ~ e8 f4 f8 ~ f2 \improvisationOff a16( bes) a8 g e }
\improvisationOn
, \improvisationOff
Snippets: Pitches.
Internals Reference: Pitch_squash_engraver, Voice, RhythmicStaff.
This section discusses rhythms, rests, durations, beaming and bars.
Durations are designated by numbers and dots.
Durations are entered as their reciprocal values. For example, a
quarter note is entered using a 4
(since it is a 1/4 note),
and a half note is entered using a 2
(since it is a 1/2
note). For notes longer than a whole you must use the
\longa
(a double breve) and \breve
commands.
Durations as short as 64th notes may be specified. Shorter values
are possible, but only as beamed notes.
\time 8/1 c\longa c\breve c1 c2 c4 c8 c16 c32 c64 c64
Here are the same durations with automatic beaming turned off.
\time 8/1 \autoBeamOff c\longa c\breve c1 c2 c4 c8 c16 c32 c64 c64
A note with the duration of a quadruple breve may be entered with
\maxima
, but this is supported only within ancient music
notation. For details, see Ancient notation.
If the duration is omitted, it is set to the previously entered duration. The default for the first note is a quarter note.
a a a2 a a4 a a1 a
To obtain dotted note lengths, place a dot (.
) after the
duration. Double-dotted notes are specified by appending two
dots, and so on.
a4 b c4. b8 a4. b4.. c8.
Some durations cannot be represented with just binary durations and dots; they can be represented only by tying two or more notes together. For details, see Ties.
For ways of specifying durations for the syllables of lyrics and ways of aligning lyrics to notes, see Vocal music.
Optionally, notes can be spaced strictly proportionately to their duration. For details of this and other settings which control proportional notation, see Proportional notation.
Dots are normally moved up to avoid staff lines, except in polyphonic situations. Predefined commands are available to force a particular direction manually, for details see Direction and placement.
\autoBeamOff
,
\dotsUp
,
\dotsDown
,
\dotsNeutral
.
Music Glossary: breve, longa, note value, Duration names notes and rests.
Notation Reference: Automatic beams, Ties, Writing rhythms, Writing rests, Vocal music, Ancient notation, Proportional notation.
Snippets: Rhythms.
Internals Reference: Dots, DotColumn.
There is no fundamental limit to rest durations (both in terms of longest and shortest), but the number of glyphs is limited: rests from 128th to maxima (8 x whole) may be printed.
Tuplets are made from a music expression by multiplying all the durations with a fraction:
\times fraction { music }
The duration of music will be multiplied by the fraction. The fraction's denominator will be printed over or under the notes, optionally with a bracket. The most common tuplet is the triplet in which 3 notes have the duration of 2, so the notes are 2/3 of their written length.
a2 \times 2/3 { b4 b b } c4 c \times 2/3 { b4 a g }
The automatic placement of the tuplet bracket above or below the notes may be overridden manually with predefined commands, for details see Direction and placement.
Tuplets may be nested:
\autoBeamOff c4 \times 4/5 { f8 e f \times 2/3 { e[ f g] } } f4 |
Modifying nested tuplets which begin at the same musical moment
must be done with \tweak
.
To modify the duration of notes without printing a tuplet bracket, see Scaling durations.
\tupletUp
,
\tupletDown
,
\tupletNeutral
.
Entering several tuplets using only one \times command
The property tupletSpannerDuration
sets how long each of the
tuplets contained within the brackets after \times
should last.
Many consecutive tuplets can then be placed within a single
\times
expression, thus saving typing.
In the example, two triplets are shown, while \times
was
entered only once.
For more information about make-moment
, see "Time
administration".
\relative c' { \time 2/4 \set tupletSpannerDuration = #(ly:make-moment 1 4) \times 2/3 { c8 c c c c c } }
Changing the tuplet number
By default, only the numerator of the tuplet number is printed over the
tuplet bracket, i.e., the denominator of the argument to the
\times
command. Alternatively, num:den of the tuplet number may
be printed, or the tuplet number may be suppressed altogether.
\relative c'' { \times 2/3 { c8 c c } \times 2/3 { c8 c c } \override TupletNumber #'text = #tuplet-number::calc-fraction-text \times 2/3 { c8 c c } \override TupletNumber #'stencil = ##f \times 2/3 { c8 c c } }
Permitting line breaks within beamed tuplets
This artificial example shows how both manual and automatic line breaks may be permitted to within a beamed tuplet. Note that such off-beat tuplets have to be beamed manually.
\layout { \context { \Voice % Permit line breaks within tuplets \remove "Forbid_line_break_engraver" % Allow beams to be broken at line breaks \override Beam #'breakable = ##t } } \relative c'' { a8 \repeat unfold 8 { \times 2/3 { c[ b a] } } % Insert a manual line break within a tuplet \times 2/3 { c[ b \bar "" \break a] } \repeat unfold 2 { \times 2/3 { c[ b a] } } c8 }
Music Glossary: triplet, tuplet, polymetric.
Learning Manual: Tweaking methods.
Notation Reference: Time administration, Scaling durations, The tweak command, Polymetric notation.
Snippets: Rhythms.
Internals Reference: TupletBracket, TupletNumber, TimeScaledMusic.
When the first note on a staff is a grace note followed by a
tuplet the grace note must be placed before the \times
command to avoid errors. Anywhere else, grace notes may be
placed within tuplet brackets.
You can alter the duration of single notes, rests or chords by a
fraction N/M
by appending *N/M
(or *N
if
M
is 1) to the duration.
This will not affect the appearance of the notes or rests
produced, but the altered duration will be used in calculating the
position within the measure and setting the duration in the MIDI
output. Multiplying factors may be combined such as *L*M/N
.
In the following example, the first three notes take up exactly two beats, but no triplet bracket is printed.
\time 2/4 % Alter durations to triplets a4*2/3 gis4*2/3 a4*2/3 % Normal durations a4 a4 % Double the duration of chord <a d>4*2 % Duration of quarter, appears like sixteenth b16*4 c4
The duration of skip or spacing notes may also be modified by
a multiplier. This is useful for skipping many measures, e.g.,
s1*23
.
Longer stretches of music may be compressed by a fraction in the same way, as if every note, chord or rest had the fraction as a multiplier. This leaves the appearance of the music unchanged but the internal duration of the notes will be multiplied by the fraction num/den. The spaces around the dot are required. Here is an example showing how music can be compressed and expanded:
\time 2/4 % Normal durations <c a>4 c8 a % Scale music by *2/3 \scaleDurations #'(2 . 3) { <c a f>4. c8 a f } % Scale music by *2 \scaleDurations #'(2 . 1) { <c' a>4 c8 b }
One application of this command is in polymetric notation, see Polymetric notation.
Notation Reference: Tuplets, Invisible rests, Polymetric notation.
Snippets: Rhythms.
A tie connects two adjacent note heads of the same pitch. The tie in effect extends the duration of a note.
Note: Ties should not be confused with slurs, which indicate articulation, or phrasing slurs, which indicate musical phrasing. A tie is just a way of extending a note duration, similar to the augmentation dot. |
A tie is entered using the tilde symbol ~
e'2 ~ e'
Ties are used either when the note crosses a bar line, or when dots cannot be used to denote the rhythm. Ties should also be used when note values cross larger subdivisions of the measure:
If you need to tie many notes across bar lines, it may be easier to use automatic note splitting, see Automatic note splitting. This mechanism automatically splits long notes, and ties them across bar lines.
When a tie is applied to a chord, all note heads whose pitches match are connected. When no note heads match, no ties will be created. Chords may be partially tied by placing the tie inside the chord.
<c e g> ~ <c e g> <c~ e g~ b> <c e g b>
When a second alternative of a repeat starts with a tied note, you have to specify the repeated tie as follows:
\repeat volta 2 { c g <c e>2 ~ } \alternative { % First alternative: following note is tied normally { <c e>2. r4 } % Second alternative: following note has a repeated tie { <c e>2\repeatTie d4 c } }
L.v. ties (laissez vibrer) indicate that notes must not be damped at the end. It is used in notation for piano, harp and other string and percussion instruments. They can be entered as follows:
<c f g>1\laissezVibrer
The vertical placement of ties may be controlled, see Predefined commands, or for details, see Direction and placement.
Solid, dotted or dashed ties may be specified, see Predefined commands.
\tieUp
,
\tieDown
,
\tieNeutral
,
\tieDotted
,
\tieDashed
,
\tieSolid
.
Using ties with arpeggios
Ties are sometimes used to write out arpeggios. In this case, two tied
notes need not be consecutive. This can be achieved by setting the
tieWaitForNote
property to "true". The same feature is also
useful, for example, to tie a tremolo to a chord, but in principle, it
can also be used for ordinary consecutive notes, as demonstrated in
this example.
\relative c' { \set tieWaitForNote = ##t \grace { c16[~ e~ g]~ } <c, e g>2 \repeat tremolo 8 { c32~ c'~ } <c c,>1 e8~ c~ a~ f~ <e' c a f>2 \tieUp c8~ a \tieDown \tieDotted g~ c g2 }
Engraving ties manually
Ties may be engraved manually by changing the tie-configuration
property of the TieColumn
object. The first number indicates the
distance from the center of the staff in staff-spaces, and the second
number indicates the direction (1 = up, -1 = down).
\relative c' { <c e g>2 ~ <c e g> \override TieColumn #'tie-configuration = #'((0.0 . 1) (-2.0 . 1) (-4.0 . 1)) <c e g> ~ <c e g> }
Music Glossary: tie, laissez vibrer.
Notation Reference: Automatic note splitting.
Snippets: Rhythms.
Internals Reference: LaissezVibrerTie, LaissezVibrerTieColumn, TieColumn, Tie.
Switching staves when a tie is active will not produce a slanted tie.
Changing clefs or octavations during a tie is not really well-defined. In these cases, a slur may be preferable.
Rests are entered as part of the music in music expressions.
Rests are entered like notes with the note name r
.
Durations longer than a whole rest use the predefined
commands shown:
\new Staff { % These two lines are just to prettify this example \time 16/1 \override Staff.TimeSignature #'stencil = ##f % Print a maxima rest, equal to four breves r\maxima % Print a longa rest, equal to two breves r\longa % Print a breve rest r\breve r1 r2 r4 r8 r16 r32 r64 r128 }
Whole measure rests, centered in the middle of the measure, must be entered as multi-measure rests. They can be used for a single measure as well as many measures and are discussed in Full measure rests.
To explicitly specify a rest's vertical position, write a note
followed by \rest
. A rest of the duration of the note will
be placed at the staff position where the note would appear. This
allows for precise manual formatting of polyphonic music, since the
automatic rest collision formatter will not move these rests.
a4\rest d4\rest
Rest styles
Rests may be used in various styles.
\layout { indent = 0.0 \context { \Staff \remove "Time_signature_engraver" } } \relative c { \set Score.timing = ##f \override Staff.Rest #'style = #'mensural r\maxima^\markup \typewriter { mensural } r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 \bar "" \override Staff.Rest #'style = #'neomensural r\maxima^\markup \typewriter { neomensural } r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 \bar "" \override Staff.Rest #'style = #'classical r\maxima^\markup \typewriter { classical } r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 \bar "" \override Staff.Rest #'style = #'default r\maxima^\markup \typewriter { default } r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 r128 }
Notation Reference: Full measure rests.
Snippets: Rhythms.
Internals Reference: Rest.
There is no fundamental limit to rest durations (both in terms of longest and shortest), but the number of glyphs is limited: there are rests from 128th to maxima (8 x whole).
An invisible rest (also called a ‘spacer rest’) can be entered
like a note with the note name s
:
c4 c s c s2 c
Spacer rests are available only in note mode and chord mode. In
other situations, for example, when entering lyrics, \skip
is used to skip a musical moment. \skip
requires an
explicit duration.
<< { a2 \skip2 a2 a2 } \new Lyrics { \lyricmode { foo2 \skip 1 bla2 } } >>
A spacer rest implicitly causes Staff
and Voice
contexts to be created if none exist, just like notes and rests
do:
s1 s s
\skip
simply skips musical time; it creates no output of
any kind.
% This is valid input, but does nothing \skip 1 \skip1 \skip 1
Snippets: Rhythms.
Internals Reference: SkipMusic
Rests for one or more full measures are entered like notes with
the note name uppercase R
:
% Rest measures contracted to single measure \compressFullBarRests R1*4 R1*24 R1*4 b2^"Tutti" b4 a4
The duration of full-measure rests is identical to the duration notation used for notes. The duration in a multi-measure rest must always be an integral number of measure-lengths, so augmentation dots or fractions must often be used:
\compressFullBarRests \time 2/4 R1 | R2 | \time 3/4 R2. | R2.*2 | \time 13/8 R1*13/8 | R1*13/8*12 | \time 10/8 R4*5*4 |
A full-measure rest is printed as either a whole or breve rest, centered in the measure, depending on the time signature.
\time 4/4 R1 | \time 6/4 R1*3/2 | \time 8/4 R1*2 |
By default a multi-measure rest is expanded in the printed score to show all the rest measures explicitly. Alternatively, a mult-measure rest can be shown as a single measure containing a multi-measure rest symbol, with the number of measures of rest printed above the measure:
% Default behavior \time 3/4 r2. | R2.*2 | \time 2/4 R2 | \time 4/4 % Rest measures contracted to single measure \compressFullBarRests r1 | R1*17 | R1*4 | % Rest measures expanded \expandFullBarRests \time 3/4 R2.*2 |
Markups can be added to multi-measure rests.
The predefined command \fermataMarkup
is provided for adding fermatas.
\compressFullBarRests \time 3/4 R2.*10^\markup { \italic "ad lib." } R2.^\fermataMarkup
Note: Markups attached to a multi-measure rest are
objects of type MultiMeasureRestText , not
TextScript . Overrides must be directed to the correct
object, or they will be ignored. See the following example.
|
% This fails, as the wrong object name is specified \override TextScript #'padding = #5 R1^"wrong" % This is correct and works \override MultiMeasureRestText #'padding = #5 R1^"right"
When a multi-measure rest immediately follows a \partial
setting, resulting bar-check warnings may not be displayed.
\textLengthOn
,
\textLengthOff
,
\fermataMarkup
,
\compressFullBarRests
,
\expandFullBarRests
.
Changing form of multi-measure rests
If there are ten or fewer measures of rests, a series of longa
and breve rests (called in German "Kirchenpausen" - church rests)
is printed within the staff; otherwise a simple line is shown.
This default number of ten may be changed by overriding the
expand-limit
property:
\relative c'' { \compressFullBarRests R1*2 | R1*5 | R1*9 \override MultiMeasureRest #'expand-limit = 3 R1*2 | R1*5 | R1*9 }
Positioning multi-measure rests
Unlike ordinary rests, there is no predefined command to change the vertical position on the staff of a multi-measure rest symbol of either form by attaching it to a note. However, in polyphonic music multi-measure rests in odd-numbered and even-numbered voices are vertically separated. The positioning of multi-measure rests can be controlled as follows:
\relative c'' { % Multi-measure rests by default are set under the second line R1 % They can be moved with an override \override MultiMeasureRest #'staff-position = #-2 R1 % A value of 0 is the default position; % the following trick moves the rest to the center line \override MultiMeasureRest #'staff-position = #-0.01 R1 % Multi-measure rests in odd-numbered voices are under the top line << { R1 } \\ { a1 } >> % Multi-measure rests in even-numbered voices are under the bottom line << { c1 } \\ { R1 } >> % They remain separated even in empty measures << { R1 } \\ { R1 } >> % This brings them together even though there are two voices \compressFullBarRests << \revert MultiMeasureRest #'staff-position { R1*3 } \\ \revert MultiMeasureRest #'staff-position { R1*3 } >> }
Markups attached to a multi-measure rest will be centered above or below it. Long markups attached to multi-measure rests do not cause the measure to expand. To expand a multi-measure rest to fit the markup, use a spacer rest with an attached markup before the multi-measure rest:
\compressFullBarRests \textLengthOn s1*0^\markup { [MAJOR GENERAL] } R1*19 s1*0_\markup { \italic { Cue: ... it is yours } } s1*0^\markup { A } R1*30^\markup { [MABEL] } \textLengthOff c4^\markup { CHORUS } d f c
Note that the spacer rest causes a bar to be inserted. Text attached to a spacer rest in this way is left-aligned to the position where the note would be placed in the measure, but if the measure length is determined by the length of the text, the text will appear to be centered.
Music Glossary: multi-measure rest.
Notation Reference: Durations, Text, Formatting text, Text scripts.
Snippets: Rhythms.
Internals Reference: MultiMeasureRest, MultiMeasureRestNumber, MultiMeasureRestText.
If an attempt is made to use fingerings (e.g.,
R1*10-4
) to put numbers over multi-measure rests, the
fingering numeral (4) may collide with the bar counter
numeral (10).
There is no way to automatically condense multiple ordinary rests into a single multi-measure rest.
Multi-measure rests do not take part in rest collisions.
The time signature is set as follows:
\time 2/4 c2 \time 3/4 c2.
Time signatures are printed at the beginning of a piece and whenever the time signature changes. If a change takes place at the end of a line a warning time signature sign is printed there. This default behavior may be changed, see Visibility of objects.
\time 2/4 c2 c \break c c \break \time 4/4 c c c c
The time signature symbol that is used in 2/2 and 4/4 time can be changed to a numeric style:
% Default style \time 4/4 c1 \time 2/2 c1 % Change to numeric style \numericTimeSignature \time 4/4 c1 \time 2/2 c1 % Revert to default style \defaultTimeSignature \time 4/4 c1 \time 2/2 c1
Ancient time signatures are covered in Ancient time signatures.
\numericTimeSignature
,
\defaultTimeSignature
.
\time
sets the properties timeSignatureFraction
,
beatLength
, and measureLength
in the Timing
context, which is normally aliased to Score
. Changing the
value of timeSignatureFraction
causes the new time
signature symbol to be printed without changing the other
properties. The property measureLength
determines where
bar lines should be inserted and, with beatLength
, how
automatic beams should be generated.
TODO Add example of using beatLength.
Options to group beats within a bar are available through the
Scheme function set-time-signature
, which takes three
arguments: the number of beats, the beat length, and the internal
grouping of beats in the measure. If the
Measure_grouping_engraver is included, the function
will also create MeasureGrouping signs. Such signs
ease reading rhythmically complex modern music. In the example,
the 9/8 measure is subdivided in 2, 2, 2 and 3. This is passed to
set-time-signature
as the third argument: '(2 2 2 3)
:
\score { \relative c'' { #(set-time-signature 9 8 '(2 2 2 3)) g8[ g] d[ d] g[ g] a8[( bes g]) | #(set-time-signature 5 8 '(3 2)) a4. g4 } \layout { \context { \Staff \consists "Measure_grouping_engraver" } } }
Odd 20th century time signatures (such as "5/8") can often be played as compound time signatures (e.g. "3/8 + 2/8"), which combine two or more inequal metrics. LilyPond can make such music quite easy to read and play, by explicitly printing the compound time signatures and adapting the automatic beaming behavior. (Graphic measure grouping indications can also be added; see the appropriate snippet in this database.)
#(define (compound-time one two num) (markup #:override '(baseline-skip . 0) #:number (#:line ((#:column (one num)) #:vcenter "+" (#:column (two num)))) )) \relative { \override Staff.TimeSignature #'stencil = #ly:text-interface::print \override Staff.TimeSignature #'text = #(compound-time "2" "3" "8") \time 5/8 #(override-auto-beam-setting '(end 1 8 5 8) 1 4) c8 d e fis gis c8 fis, gis e d c8 d e4 gis8 }
Music Glossary: time signature
Notation Reference: Ancient time signatures, Time administration.
Snippets: Rhythms.
Internals Reference: TimeSignature, Timing_translator.
Automatic beaming does not use the measure grouping specified with
set-time-signature
.
Partial or pick-up measures, such as an anacrusis or upbeat, are
entered using the \partial
command, with the syntax
\partial duration
where duration
is the rhythmic length of the interval
before the start of the first complete measure:
\partial 4 e4 | a2. c,4 |
The partial measure can be any duration less than a full measure:
\partial 8*3 c8 d e | a2. c,4 |
Internally, this is translated into
\set Timing.measurePosition = -duration
The property measurePosition
contains a rational number
indicating how much of the measure has passed at this point. Note
that this is set to a negative number by the \partial
command: i.e., \partial 4
is internally translated to
-4
, meaning “there is a quarter note left in the measure.”
Music Glossary: anacrusis
Notation Reference: Grace notes
Snippets: Rhythms.
Internal Reference: Timing_translator
The \partial
command is intended to be used only at the
beginning of a piece. If you use it after the beginning, some
odd warnings may occur.
Bar lines and bar numbers are calculated automatically. For
unmetered music (some cadenzas, for example), this is not desirable.
To turn off automatic calculation of bar lines and bar numbers,
use the command \cadenzaOn
, and use \cadenzaOff
to turn them on again.
c4 d e d \cadenzaOn c4 c d8 d d f4 g4. \cadenzaOff \bar "|" d4 e d c
Bar numbering is resumed at the end of the cadenza as if the cadenza were not there:
% Show all bar numbers \override Score.BarNumber #'break-visibility = #all-visible c4 d e d \cadenzaOn c4 c d8 d d f4 g4. \cadenzaOff \bar "|" d4 e d c
\cadenzaOn
,
\cadenzaOff
.
Music Glossary: cadenza
Notation Reference: Visibility of objects
Snippets: Rhythms.
LilyPond will insert line breaks and page breaks only at a bar line. Unless the unmetered music ends before the end of the staff line, you will need to insert invisible bar lines with
\bar ""
to indicate where breaks can occur.
Polymetric notation is supported, either explicitly or through clever use of markup features.
Staves with different time signatures, equal measure lengths
This notation can be created by setting a common time signature
for each staff but replacing the symbol manually by setting
timeSignatureFraction
to the desired fraction and scaling
the printed durations in each staff to the common time
signature. This is done with \scaleDurations
, which
is used in a similar way to \times
, but does not create
a tuplet bracket, see Scaling durations.
In this example, music with the time signatures of 3/4, 9/8, and 10/8 are used in parallel. In the second staff, shown durations are multiplied by 2/3, as 2/3 * 9/8 = 3/4, and in the third staff, shown durations are multiplied by 3/5, as 3/5 * 10/8 = 3/4.
\relative c' { << \new Staff { \time 3/4 c4 c c | c c c | } \new Staff { \time 3/4 \set Staff.timeSignatureFraction = #'(9 . 8) \scaleDurations #'(2 . 3) \repeat unfold 6 { c8[ c c] } } \new Staff { \time 3/4 \set Staff.timeSignatureFraction = #'(10 . 8) \scaleDurations #'(3 . 5) { \repeat unfold 2 { c8[ c c] } \repeat unfold 2 { c8[ c] } | c4. c4. \times 2/3 { c8 c c } c4 } } >> }
Staves with different time signatures, unequal bar lengths
Each staff can be given its own independent time signature by
moving the Timing_translator
to the Staff
context.
\layout { \context { \Score \remove "Timing_translator" \remove "Default_bar_line_engraver" } \context { \Staff \consists "Timing_translator" \consists "Default_bar_line_engraver" } } % Now each staff has its own time signature. \relative c' << \new Staff { \time 3/4 c4 c c | c c c | } \new Staff { \time 2/4 c4 c | c c | c c | } \new Staff { \time 3/8 c4. | c8 c c | c4. | c8 c c | } >>
Alternating time signatures
Regularly alternating double time signatures are not supported
explicitly, but they can be faked. In the next example, the
double time signature is created with markup text, while the
real time signature is set in the usual way with \time
.
% Create 9/8 split into 2/4 + 5/8 tsMarkup = \markup { \override #'(baseline-skip . 2) \number { \column { "2" "4" } \vcenter "+" \bracket \column { "5" "8" } } } { \override Staff.TimeSignature #'stencil = #ly:text-interface::print \override Staff.TimeSignature #'text = #tsMarkup \time 9/8 c'2 \bar ":" c'4 c'4. c'2 \bar ":" c'4 c'4. }
Music Glossary: polymetric, polymetric time signature, meter.
Notation Reference: Scaling durations
Snippets: Rhythms.
Internals Reference: TimeSignature, Timing_translator, Staff.
When using different time signatures in parallel, notes at the same moment will be be placed at the same horizontal location. However, the bar lines in the different staves will cause the note spacing to be less regular in each of the individual staves than would be normal without the different time signatures.
Long notes which overrun bar lines can be converted automatically
to tied notes. This is done by replacing the
Note_heads_engraver
with the
Completion_heads_engraver
. In the following
example, notes crossing the bar lines are split and tied.
\new Voice \with { \remove "Note_heads_engraver" \consists "Completion_heads_engraver" } { c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 }
This engraver splits all running notes at the bar line, and inserts ties. One of its uses is to debug complex scores: if the measures are not entirely filled, then the ties show exactly how much each measure is off.
Music Glossary: tie
Learning Manual: Engravers explained, Adding and removing engravers.
Snippets: Rhythms.
Internals Reference: Note_heads_engraver, Completion_heads_engraver, Forbid_line_break_engraver.
Not all durations (especially those containing tuplets) can be
represented exactly with normal notes and dots, but the
Completion_heads_engraver
will not insert tuplets.
The Completion_heads_engraver
only affects notes; it does not
split rests.
Sometimes you might want to show only the rhythm of a melody. This can be done with the rhythmic staff. All pitches of notes on such a staff are squashed, and the staff itself has a single line
<< \new RhythmicStaff { \new Voice = "myRhythm" { \time 4/4 c4 e8 f g2 r4 g g f g1 } } \new Lyrics { \lyricsto "myRhythm" { This is my song I like to sing } } >>
Guitar chord charts often show the strumming rhythms. This can
be done with the Pitch_squash_engraver
and
\improvisationOn
.
<< \new ChordNames { \chordmode { c1 f g c } } \new Voice \with { \consists Pitch_squash_engraver } \relative c'' { \improvisationOn c4 c8 c c4 c8 c f4 f8 f f4 f8 f g4 g8 g g4 g8 g c4 c8 c c4 c8 c } >>
\improvisationOn
,
\improvisationOff
.
For guitar music, it is possible to show strum rhythms, along with melody notes, chord names, and fret diagrams.
\include "predefined-guitar-fretboards.ly" << \new ChordNames { \chordmode { c1 f g c } } \new FretBoards { \chordmode { c1 f g c } } \new Voice \with { \consists Pitch_squash_engraver } \relative c'' { \improvisationOn c4 c8 c c4 c8 c f4 f8 f f4 f8 f g4 g8 g g4 g8 g c4 c8 c c4 c8 c } \new Voice = "melody" { \relative c'' { \improvisationOff c2 e4 e4 f2. r4 g2. a4 e4 c2. } } \new Lyrics { \lyricsto "melody" { This is my song. I like to sing. } } >>
Snippets: Rhythms.
Internals Reference: RhythmicStaff, Pitch_squash_engraver.
By default, beams are inserted automatically:
\time 2/4 c8 c c c \time 6/8 c c c c8. c16 c8
If these automatic decisions are not satisfactory, beaming can be entered explicitly; see Manual beams. It is also possible to define beaming patterns that differ from the defaults; see Setting automatic beam behavior. The default beaming rules are defined in scm/auto-beam.scm.
Automatic beaming may be turned off and on with
\autoBeamOff
and \autoBeamOn
commands:
c4 c8 c8. c16 c8. c16 c8 \autoBeamOff c4 c8 c8. c16 c8. \autoBeamOn c16 c8
\autoBeamOff
,
\autoBeamOn
.
Beaming patterns may be altered with the beatGrouping
property,
\time 5/16 \set beatGrouping = #'(2 3) c8[^"(2+3)" c16 c8] \set beatGrouping = #'(3 2) c8[^"(3+2)" c16 c8]
The beams of consecutive 16th (or shorter) notes are, by default,
not sub-divided. That is, the three (or more) beams stretch
unbroken over entire groups of notes. This behavior can
be modified to sub-divide the beams into sub-groups by setting
the property subdivideBeams
. When set, multiple beams
will be sub-divided at intervals defined by the current value of
beatLength
by reducing the multiple beams to just one beam
between the sub-groups. Note that beatLength
lives in the
Score
context and defaults to a quarter note. It must be
set to a fraction giving the duration of the beam sub-group
using the make-moment
function, as shown here:
c32[ c c c c c c c] \set subdivideBeams = ##t c32[ c c c c c c c] % Set beam sub-group length to an eighth note \set Score.beatLength = #(ly:make-moment 1 8) c32[ c c c c c c c] % Set beam sub-group length to a sixteenth note \set Score.beatLength = #(ly:make-moment 1 16) c32[ c c c c c c c]
For more information about make-moment
, see
Time administration.
Line breaks are normally forbidden when beams cross bar lines.
This behavior can be changed by setting the breakable
property: \override Beam #'breakable = ##t
.
\override Beam #'breakable = ##t c8 \repeat unfold 15 { c[ c] } c
Kneed beams are inserted automatically when a large gap is
detected between the note heads. This behavior can be tuned
through the auto-knee-gap
property. A kneed beam is
drawn if the gap is larger than the value of
auto-knee-gap
plus the width of the beam object (which
depends on the duration of the notes and the slope of the beam).
By default auto-knee-gap
is set to 5.5 staff spaces.
f8 f''8 f8 f''8 \override Beam #'auto-knee-gap = #6 f8 f''8 f8 f''8
Notation Reference: Manual beams, Setting automatic beam behavior.
Installed Files: scm/auto-beam.scm.
Snippets: Rhythms.
Internals Reference: Beam.
Automatically kneed cross-staff beams cannot be used together with hidden staves. See Hiding staves.
Beams can collide with note heads and accidentals in other voices
In normal time signatures, automatic beams can start on any note
but can end in only a few positions within the measure: beams can
end on a beat, or at durations specified by the properties in
autoBeamSettings
. The properties in
autoBeamSettings
consist of a list of rules for where beams
can begin and end. The default autoBeamSettings
rules are
defined in scm/auto-beam.scm.
In order to add a rule to the list, use
#(override-auto-beam-setting '(beam-limit beam-numerator beam-denominator time-signature-numerator time-signature-denominator) moment-numerator moment-denominator [context])
beam-limit
is the type of automatic beam limit
defined, either begin
or end
.
beam-numerator/beam-denominator
is the beam duration
for which you want to add a rule. A beam is considered to have
the duration of its shortest note. Set beam-numerator
and
beam-denominator
to '*'
to
have this rule apply beams of any duration.
time-signature-numerator/time-signature-denominator
is the time signature to which
this rule should apply. Set time-signature-numerator
and
time-signature-denominator
to '*'
to have this rule apply in any time signature.
monent-numerator/moment-denominator
is the position
in the bar at which the beam should
begin or end.
context
is optional, and it specifies the context at which
the change should be made. The default is 'Voice
.
#(score-override-auto-beam-setting '(A B C D) E F)
is equivalent to
#(override-auto-beam-setting '(A B C D) E F 'Score)
.
TODO – convert to music example For example, if automatic beams should always end on the first quarter note, use
#(override-auto-beam-setting '(end * * * *) 1 4)
You can force the beam settings to only take effect on beams whose shortest note is a certain duration
\time 2/4 % end 1/16 beams for all time signatures at the 1/16 moment #(override-auto-beam-setting '(end 1 16 * *) 1 16) a16 a a a a a a a | a32 a a a a16 a a a a a | % end 1/32 beams for all time signatures at the 1/16 moment #(override-auto-beam-setting '(end 1 32 * *) 1 16) a32 a a a a16 a a a a a |
You can force the beam settings to only take effect in certain time signatures
\time 5/8 % end beams of all durations in 5/8 time signature at the 2/8 moment #(override-auto-beam-setting '(end * * 5 8) 2 8) c8 c d d d \time 4/4 e8 e f f e e d d \time 5/8 c8 c d d d
Existing auto-beam rules are removed by using
#(revert-auto-beam-setting '(beam-limit beam-numerator beam-denominator time-signature-numerator time-signature-denominator) moment-numerator moment-denominator [context])
beam-limit
, beam-numerator
, beam-denominator
,
time-signature-numerator
, time-signature-denominator
,
moment-numerator
, moment-denominator
and context
are the same as above. Note that the default auto-beaming rules are
specified in scm/auto-beam.scm,
so you can revert rules that you did not explicitly create.
\time 4/4 a16 a a a a a a a a a a a a a a a % undo a rule ending 1/16 beams in 4/4 time at 1/4 moment #(revert-auto-beam-setting '(end 1 16 4 4) 1 4) a16 a a a a a a a a a a a a a a a
The rule in a revert-auto-beam-setting
statement must exactly
match the original rule. That is, no wildcard expansion is taken into
account.
\time 1/4 #(override-auto-beam-setting '(end 1 16 1 4) 1 8) a16 a a a #(revert-auto-beam-setting '(end 1 16 * *) 1 8) % this won't revert it! a a a a #(revert-auto-beam-setting '(end 1 16 1 4) 1 8) % this will a a a a
If automatic beams should end on every quarter in 5/4 time, specify all endings
#(override-auto-beam-setting '(end * * * *) 1 4 'Staff) #(override-auto-beam-setting '(end * * * *) 1 2 'Staff) #(override-auto-beam-setting '(end * * * *) 3 4 'Staff) #(override-auto-beam-setting '(end * * * *) 5 4 'Staff) ...
The same syntax can be used to specify beam starting points. In this example, automatic beams can only end on a dotted quarter note
#(override-auto-beam-setting '(end * * * *) 3 8) #(override-auto-beam-setting '(end * * * *) 1 2) #(override-auto-beam-setting '(end * * * *) 7 8)
In 4/4 time signature, this means that automatic beams could end only on 3/8 and on the fourth beat of the measure (after 3/4, that is 2 times 3/8, has passed within the measure).
If any unexpected beam behavior occurs, check the default automatic beam settings in scm/auto-beam.scm for possible interference, because the beam endings defined there will still apply on top of your own overrides. Any unwanted endings in the default vales must be reverted for your time signature(s).
For example, to typeset (3 4 3 2)
-beam endings in 12/8, begin
with
%%% revert default values in scm/auto-beam.scm regarding 12/8 time #(revert-auto-beam-setting '(end * * 12 8) 3 8) #(revert-auto-beam-setting '(end * * 12 8) 3 4) #(revert-auto-beam-setting '(end * * 12 8) 9 8) %%% your new values #(override-auto-beam-setting '(end 1 8 12 8) 3 8) #(override-auto-beam-setting '(end 1 8 12 8) 7 8) #(override-auto-beam-setting '(end 1 8 12 8) 10 8)
If beams are used to indicate melismata in songs, then automatic
beaming should be switched off with \autoBeamOff
.
If a score ends while an automatic beam has not been ended and is
still accepting notes, this last beam will not be typeset at all.
The same holds for polyphonic voices, entered with <<
... \\ ... >>
. If a polyphonic voice ends while an
automatic beam is still accepting notes, it is not typeset.
Snippets: Rhythms.
In some cases it may be necessary to override the automatic
beaming algorithm. For example, the autobeamer will not put beams
over rests or bar lines, and in choral scores the beaming is
often set to follow the meter of the lyrics rather than the
notes. Such beams can be specified manually by
marking the begin and end point with [
and ]
{ r4 r8[ g' a r8] r8 g[ | a] r8 }
Individual notes may be marked with \noBeam
to prevent them
from being beamed:
\time 2/4 c8 c\noBeam c c
Even more strict manual control with the beams can be achieved by
setting the properties stemLeftBeamCount
and
stemRightBeamCount
. They specify the number of beams to
draw on the left and right side, respectively, of the next note.
If either property is set, its value will be used only once, and
then it is erased. In this example, the last f
is printed
with only one beam on the left side, i.e., the eighth-note beam of
the group as a whole.
TODO – no difference based on stemLeftBeamCount in this example
{ f8[ r16 f g a] f8[ r16 \set stemLeftBeamCount = #1 f g a] }
TODO – this section relies on overrides. We need to either add a predefined, move this to snippets (whole section), or violate policy for this section.
Feathered beams are used to indicate that a small group of notes
should be played at an increasing (or decreasing) tempo, without
changing the overall tempo of the piece. The extent of the
feathered beam must be indicated manually using [
and
]
, and the beam feathering is turned on by specifying a
direction to the Beam
property grow-direction
.
If the placement of the notes and the sound in the MIDI output
is to reflect the ritardando or accelerando indicated by the
feathered beam the notes must be grouped as a
music expression delimited by braces and preceded by a
featheredDurations
command which specifies the ratio
between the durations of the first and last notes in the group.
The square brackets show the extent of the beam and the braces show which notes are to have their durations modified. Normally these would delimit the same group of notes, but this is not required: the two commands are independent.
In the following example the eight 16th notes occupy exactly the same time as a half note, but the first note is one half as long as the last one, with the intermediate notes gradually lengthening. The first four 32nd notes gradually speed up, while the last four 32nd notes are at a constant tempo.
\override Beam #'grow-direction = #LEFT \featherDurations #(ly:make-moment 2 1) { c16[ c c c c c c c] } \override Beam #'grow-direction = #RIGHT \featherDurations #(ly:make-moment 2 3) { c32[ d e f] } % revert to non-feathered beams \override Beam #'grow-direction = #'() { g32[ a b c] }
The spacing in the printed output represents the note durations only approximately, but the midi output is exact.
The \featherDurations
command only works with very short
music snippets, and when numbers in the fraction are small.
Snippets: Rhythms.
Bar lines delimit measures, and are also used to indicate repeats. Normally, simple bar lines are automatically inserted into the printed output at places based on the current time signature.
The simple bar lines inserted automatically can be changed to
other types with the \bar
command. For example, a closing
double bar line is usually placed at the end of a piece:
e4 d c2 \bar "|."
Note: An incorrect duration can lead to poorly formatted music. |
It is not invalid if the final note in a measure does not end on the automatically entered bar line: the note is assumed to carry over into the next measure. But if a long sequence of such carry-over measures appears the music can appear compressed or even flowing off the page. This is because automatic line breaks happen only at the end of complete measures, i.e., where the end of a note coincides with the end of a measure.
Line breaks are also permitted at manually inserted bar lines even within incomplete measures. To allow a line break without printing a bar line, use
\bar ""
This will insert an invisible bar line and allow (but not force) a line break to occur at this point. The bar number counter is not increased. To force a line break see Line breaking.
This and other special bar lines may be inserted manually at any point. When they coincide with the end of a measure they replace the simple bar line which would have been inserted there automatically. When they do not coincide with the end of a measure the specified bar line is inserted at that point in the printed output. Such insertions do not affect the calculation and placement of subsequent automatic bar lines.
The simple bar line and four types of double bar line are available for manual insertion:
f1 \bar "|" g \bar "||" a \bar ".|" b \bar ".|." c \bar "|." d
together with dotted and dashed bar lines:
f1 \bar ":" g \bar "dashed" a
and three types of repeat bar line:
f1 \bar "|:" g \bar ":|:" a \bar ":|" b
Although the bar line types signifying repeats may be inserted manually they do not in themselves cause LilyPond to recognize a repeated section. Such repeated sections are better entered using the various repeat commands (see Repeats), which automatically print the appropriate bar lines.
In addition, you can specify "||:"
, which is equivalent to
"|:"
except at line breaks, where it gives a double bar
line at the end of the line and a start repeat at the beginning of
the next line.
\override Score.RehearsalMark #'padding = #3 c c c c \bar "||:" c c c c \break \bar "||:" c c c c
In scores with many staves, a \bar
command in one staff is
automatically applied to all staves. The resulting bar lines are
connected between different staves of a StaffGroup
,
InnerStaffGroup
, PianoStaff
, or GrandStaff
.
<< \new StaffGroup << \new Staff { e'4 d' \bar "||" f' e' } \new Staff { \clef bass c4 g e g } >> \new Staff { \clef bass c2 c2 } >>
The command \bar
bartype is a shortcut for
\set Timing.whichBar =
bartype. A bar line is
created whenever the whichBar
property is
set.
The default bar type used for automatically inserted bar lines is
"|"
. This may be changed at any time
with \set Timing.defaultBarType =
bartype.
Notation Reference: Line breaking, Repeats,
Snippets: Rhythms.
Internals Reference: BarLine (created at Staff level), SpanBar (across staves), Timing_translator (for Timing properties).
Bar numbers are typeset by default at the start of every line except
the first line. The number itself is stored in the
currentBarNumber
property, which is normally updated
automatically for every measure. It may also be set manually:
c1 c c c \break \set Score.currentBarNumber = #50 c1 c c c
Bar numbers can be typeset at regular intervals instead of just at
the beginning of every line. To do this the default behavior
must be overridden to permit bar numbers to be printed at places
other than the start of a line. This is controlled by the
break-visibility
property of BarNumber
. This takes
three values which may be set to #t
or #f
to specify
whether the corresponding bar number is visible or not. The order
of the three values is end of line visible
, middle of
line visible
, beginning of line visible
. In the following
example bar numbers are printed at all possible places:
\override Score.BarNumber #'break-visibility = #'#(#t #t #t) \set Score.currentBarNumber = #11 \bar "" % Permit first bar number to be printed c1 c c c \break c c c c
and here the bar numbers are printed every two measures except at the end of the line:
\override Score.BarNumber #'break-visibility = #'#(#f #t #t) \set Score.currentBarNumber = #11 \bar "" % Permit first bar number to be printed % Print a bar number every second measure \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2) c1 c c c c \break c c c c c
The size of the bar number may be changed. This is illustrated
in the following example, which also shows how to enclose bar
numbers in boxes and circles, and shows an alternative way
of specifying #(#f #t #t)
for break-visibility
.
% Prevent bar numbers at the end of a line and permit them elsewhere \override Score.BarNumber #'break-visibility = #end-of-line-invisible % Increase the size of the bar number by 2 \override Score.BarNumber #'font-size = #2 \repeat unfold 3 { c1 } \bar "|" % Draw a box round the following bar number(s) \override Score.BarNumber #'stencil = #(make-stencil-boxer 0.1 0.25 ly:text-interface::print) \repeat unfold 3 { c1 } \bar "|" % Draw a circle round the following bar number(s) \override Score.BarNumber #'stencil = #(make-stencil-circler 0.1 0.25 ly:text-interface::print) \repeat unfold 4 { c1 } \bar "|."
Bar numbers by default are left-aligned to their parent object. This is usually the left edge of a line or, if numbers are printed within a line, the left bar line of the measure. The numbers may also be positioned directly on the bar line or right-aligned to the bar line:
\set Score.currentBarNumber = #111 \override Score.BarNumber #'break-visibility = #'#(#t #t #t) % Increase the size of the bar number by 2 \override Score.BarNumber #'font-size = #2 % Print a bar number every second measure \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2) c1 c1 % Center-align bar numbers \override Score.BarNumber #'self-alignment-X = #0 c1 c1 % Right-align bar numbers \override Score.BarNumber #'self-alignment-X = #-1 c1 c1
Bar numbers can be removed entirely by removing the
Bar_number_engraver
from the Score
context.
\layout { \context { \Score \remove "Bar_number_engraver" } } \relative c''{ c4 c c c \break c4 c c c }
Snippets: Rhythms.
Internals Reference: BarNumber.
Bar numbers may collide with the top of the
StaffGroup bracket, if there is one. To solve
this, the padding
property of BarNumber can
be used to position the number correctly.
Bar numbers may only be printed at bar lines; to print a bar
number at the beginning of a piece, an empty bar line must be
inserted there, and a value other than 1
must be placed
in currentBarNumber
:
\set Score.currentBarNumber = #50 \bar "" c1 c c c c1 c c c \break
Bar checks help detect errors in the entered durations.
A bar check may be entered using the bar symbol, |
,
at any place where a bar line is expected to fall.
If bar check lines are encountered at other places,
a list of warnings is printed in the log file,
showing the line numbers and lines
in which the bar checks failed. In the next
example, the second bar check will signal an error.
\time 3/4 c2 e4 | g2 |
Bar checks can also be used in lyrics, for example
\lyricmode { \time 2/4 Twin -- kle | Twin -- kle | }
An incorrect duration can result in a completely garbled score, especially if the score is polyphonic, so a good place to start correcting input is by scanning for failed bar checks and incorrect durations.
If successive bar checks are off by the same musical interval, only the first warning message is displayed. This allows the warning to focus on the source of the timing error.
It is also possible to redefine the action taken when a bar check
or pipe symbol, |
, is encountered in the input, so that
it does something other than a bar check. This is done by
assigning a music expression to pipeSymbol
.
In the following example |
is set to insert a double bar
line wherever it appears in the input, rather than checking
for end of bar.
pipeSymbol = \bar "||" { c'2 c'2 | c'2 c'2 c'2 | c'2 c'2 c'2 }
When copying large pieces of music, it can be helpful to check
that the LilyPond bar number corresponds to the original that you
are entering from. This can be checked with
\barNumberCheck
, for example,
\barNumberCheck #123
will print a warning if the currentBarNumber
is not 123
when it is processed.
Snippets: Rhythms.
To print a rehearsal mark, use the \mark
command
c1 \mark \default c1 \mark \default c1 \mark #8 c1 \mark \default c1 \mark \default
The letter ‘I’ is skipped in accordance with engraving traditions. If you wish to include the letter ‘I’, then use
\set Score.markFormatter = #format-mark-alphabet
The mark is incremented automatically if you use \mark
\default
, but you can also use an integer argument to set the
mark manually. The value to use is stored in the property
rehearsalMark
.
The style is defined by the property markFormatter
. It is
a function taking the current mark (an integer) and the current
context as argument. It should return a markup object. In the
following example, markFormatter
is set to a pre-defined
procedure. After a few measures, it is set to a procedure that
produces a boxed number.
\set Score.markFormatter = #format-mark-numbers c1 \mark \default c1 \mark \default \set Score.markFormatter = #format-mark-box-numbers c1 \mark \default c1 \mark \default c1
The file scm/translation-functions.scm contains the
definitions of format-mark-numbers
(the default format),
format-mark-box-numbers
, format-mark-letters
and
format-mark-box-letters
. These can be used as inspiration
for other formatting functions.
You may use format-mark-barnumbers
,
format-mark-box-barnumbers
, and
format-mark-circle-barnumbers
to get bar numbers instead of
incremented numbers or letters.
Other styles of rehearsal mark can be specified manually
\mark "A1"
Score.markFormatter
does not affect marks specified in this
manner. However, it is possible to apply a \markup
to the
string.
\mark \markup{ \box A1 }
Music glyphs (such as the segno sign) may be printed inside a
\mark
c1 \mark \markup { \musicglyph #"scripts.segno" } c1 \mark \markup { \musicglyph #"scripts.coda" } c1 \mark \markup { \musicglyph #"scripts.ufermata" } c1
See The Feta font, for a list of symbols which may be
printed with \musicglyph
.
For common tweaks to the positioning of rehearsal marks, see Formatting text.
This manual: The Feta font, Formatting text.
Installed Files:
scm/translation-functions.scm contains
the definition of format-mark-numbers
and
format-mark-letters
. They can be used as inspiration for
other formatting functions.
Snippets: Rhythms.
Internals Reference: RehearsalMark.
Examples:
Grace notes are ornaments that are written out. Grace notes are printed in a smaller font and take up no logical time in a measure.
c4 \grace c16 c4 \grace { c16[ d16] } c2
Lilypond also supports two special types of grace notes, the acciaccatura–an unmeasured grace note indicated by a slurred small note with a slashed stem–and the appoggiatura, which takes a fixed fraction of the main note and appears in small print without a slash.
\grace c8 b4 \acciaccatura d8 c4 \appoggiatura e8 d4 \acciaccatura { g16[ f] } e4
The placement of grace notes is synchronized between different staves. In the following example, there are two sixteenth grace notes for every eighth grace note
<< \new Staff { e2 \grace { c16[ d e f] } e2 } \new Staff { c2 \grace { g8[ b] } c2 } >>
If you want to end a note with a grace, use the \afterGrace
command. It takes two arguments: the main note, and the grace
notes following the main note.
c1 \afterGrace d1 { c16[ d] } c1
This will put the grace notes after a space lasting 3/4 of the
length of the main note. The default fraction 3/4 can be changed by
setting afterGraceFraction
. The following example shows
the results from setting the space at the default, at 15/16, and
finally at 1/2 of the main note.
<< \new Staff { c1 \afterGrace d1 { c16[ d] } c1 } \new Staff { #(define afterGraceFraction (cons 15 16)) c1 \afterGrace d1 { c16[ d] } c1 } \new Staff { #(define afterGraceFraction (cons 1 2)) c1 \afterGrace d1 { c16[ d] } c1 } >>
The space between the main note and the grace note may also be specified using spacers. The following example places the grace note after a space lasting 7/8 of the main note.
\new Voice { << { d1^\trill_( } { s2 s4. \grace { c16[ d] } } >> c1) }
A \grace
music expression will introduce special
typesetting settings, for example, to produce smaller type, and
set directions. Hence, when introducing layout tweaks to
override the special settings, they should be placed inside
the grace expression. The overrides should also be reverted
inside the grace expression. Here, the grace note's default stem
direction is overriden and then reverted.
\new Voice { \acciaccatura { \stemDown f16-> \stemNeutral } g4 e c2 }
The slash through the stem found in acciaccaturas can be applied in other situations:
\relative c'' { \override Stem #'stroke-style = #"grace" c8( d2) e8( f4) }
The layout of grace expressions can be changed throughout the
music using the function add-grace-property
. The following
example undefines the Stem
direction for this grace, so
that stems do not always point up.
\relative c'' { \new Staff { #(add-grace-property 'Voice 'Stem 'direction ly:stem::calc-direction) #(remove-grace-property 'Voice 'Stem 'direction) \new Voice { \acciaccatura { f16 } g4 \grace { d16[ e] } f4 \appoggiatura { a,32[ b c d] } e2 } } }
Another option is to change the variables startGraceMusic
,
stopGraceMusic
, startAcciaccaturaMusic
,
stopAcciaccaturaMusic
, startAppoggiaturaMusic
,
stopAppoggiaturaMusic
. The default values of these can be
seen in the file ly/grace-init.ly
. By redefining
them other effects may be obtained.
Grace notes may be forced to align with regular notes in other staves:
\relative c'' { << \override Score.SpacingSpanner #'strict-grace-spacing = ##t \new Staff { c4 \afterGrace c4 { c16[ c8 c16] } c4 r } \new Staff { c16 c c c c c c c c4 r } >> }
Music Glossary: grace notes, acciaccatura, appoggiatura.
Installed Files: ly/grace-init.ly.
Snippets: Rhythms.
Internals Reference: GraceMusic.
A multi-note beamed acciaccatura is printed without a slash, and looks exactly the same as a multi-note beamed appoggiatura.
Grace note synchronization can also lead to surprises. Staff notation, such as key signatures, bar lines, etc., are also synchronized. Take care when you mix staves with grace notes and staves without, for example,
<< \new Staff { e4 \bar "|:" \grace c16 d2. } \new Staff { c4 \bar "|:" d2. } >>
This can be remedied by inserting grace skips of the corresponding durations in the other staves. For the above example
<< \new Staff { e4 \bar "|:" \grace c16 d2. } \new Staff { c4 \bar "|:" \grace s16 d2. } >>
Predefined commands, like \voiceOne
, which are intended to
change the behaviour of the notation after a grace note, may not
be effective if placed immediately before the grace note – they
should be placed after it.
Grace sections should only be used within sequential music expressions. Nesting or juxtaposing grace sections is not supported, and might produce crashes or other errors.
In an orchestral context, cadenzas present a special problem: when constructing a score that includes a measured cadenza or other solo passage, all other instruments should skip just as many notes as the length of the cadenza, otherwise they will start too soon or too late.
One solution to this problem is to use the functions
mmrest-of-length
and skip-of-length
. These Scheme
functions take a defined piece of music as an argument and generate a
multi-measure rest or \skip
exactly as long as the piece.
MyCadenza = \relative c' { c4 d8 e f g g4 f2 g4 g } \new GrandStaff << \new Staff { \MyCadenza c'1 \MyCadenza c'1 } \new Staff { #(ly:export (mmrest-of-length MyCadenza)) c'1 #(ly:export (skip-of-length MyCadenza)) c'1 } >>
Music Glossary: cadenza.
Snippets: Rhythms.
Time is administered by the Timing_translator
, which by
default is to be found in the Score
context. An alias,
Timing
, is added to the context in which the
Timing_translator
is placed.
The following properties of Timing
are used
to keep track of timing within the score.
currentBarNumber
measureLength
measurePosition
measureLength
whenever
measureLength
is reached or exceeded. When that happens,
currentBarNumber
is incremented.
timing
Timing can be changed by setting any of these variables
explicitly. In the next example, the default 4/4 time
signature is printed, but measureLength
is set to 5/4.
At 4/8 through the third measure, the measurePosition
is
advanced by 1/8 to 5/8, shortening that bar by 1/8.
The next bar line then falls at 9/8 rather than 5/4.
\set Score.measureLength = #(ly:make-moment 5 4) c1 c4 c1 c4 c4 c4 \set Score.measurePosition = #(ly:make-moment 5 8) b4 b4 b8 c4 c1
As the example illustrates, ly:make-moment n m
constructs a
duration of n/m of a whole note. For example,
ly:make-moment 1 8
is an eighth note duration and
ly:make-moment 7 16
is the duration of seven sixteenths
notes.
This manual: Bar numbers, Unmetered music
Snippets: Rhythms.
Internals Reference: Timing_translator, Score
This section lists various expressive marks that can be created in a score.
This section explains how to create expressive marks that are attached to notes: articulations, ornamentations, and dynamics. Methods to create new dynamic markings are also discussed.
A variety of symbols that denote articulations, ornamentations, and other performance indications can be attached to a note using this syntax:
note\name
The possible values for name are listed in List of articulations. For example:
c4\staccato c\mordent b2\turn c1\fermata
Some of these articulations have shorthands for easier entry.
Shorthands are appended to the note name, and their syntax
consists of a dash -
followed by a symbol signifying the
articulation. Predefined shorthands exist for marcato,
stopped, tenuto, staccatissimo,
accent, staccato, and portato.
Their corresponding output appears as follows:
c4-^ c-+ c-- c-| c4-> c-. c2-_
The rules for the default placement of articulations are defined in scm/script.scm. Articulations and ornamentations may be manually placed above or below the staff, see Direction and placement.
Modifying default values for articulation shorthand notation
The shorthands are defined in ‘ly/script-init.ly’, where the
variables dashHat
, dashPlus
, dashDash
,
dashBar
, dashLarger
, dashDot
, and
dashUnderscore
are assigned default values. The default values
for the shorthands can be modified. For example, to associate the
-+
(dashPlus
) shorthand with the trill symbol instead of
the default + symbol, assign the value trill
to the variable
dashPlus
:
\relative c'' { c1-+ } dashPlus = "trill" \relative c'' { c1-+ }
Controlling the vertical ordering of scripts
The vertical ordering of scripts is controlled with the
script-priority
property. The lower this number, the closer it
will be put to the note. In this example, the TextScript
(the
sharp symbol) first has the lowest priority, so it is put lowest in the
first example. In the second, the prall trill (the Script
) has
the lowest, so it is on the inside. When two objects have the same
priority, the order in which they are entered determines which one
comes first.
\relative c''' { \once \override TextScript #'script-priority = #-100 a2^\prall^\markup { \sharp } \once \override Script #'script-priority = #-100 a2^\prall^\markup { \sharp } }
Music Glossary: tenuto, accent, staccato, portato.
Notation Reference: Direction and placement, List of articulations.
Installed Files: scm/script.scm.
Snippets: Expressive marks.
Internals Reference: Script, TextScript.
Absolute dynamic marks are specified using a command after a note,
such as c4\ff
. The available dynamic marks are
\ppppp
, \pppp
, \ppp
, \pp
, \p
,
\mp
, \mf
, \f
, \ff
, \fff
,
\ffff
, \fp
, \sf
, \sff
, \sp
,
\spp
, \sfz
, and \rfz
. The dynamic marks may
be manually placed above or below the staff, see
Direction and placement.
c2\ppp c\mp c2\rfz c^\mf c2_\spp c^\ff
A crescendo mark is started with \<
and
terminated with \!
, an absolute dynamic, or an additional
crescendo or decrescendo mark. A decrescendo mark is
started with \>
and is also terminated with \!
, an
absolute dynamic, or another crescendo or decrescendo mark.
\cr
and \decr
may be used instead of \<
and
\>
. Hairpins are engraved by default using this
notation.
c2\< c\! d2\< d\f e2\< e\> f2\> f\! e2\> e\mp d2\> d\> c1\!
Spacer rests are needed to engrave multiple marks on one note.
c4\< c\! d\> e\! << f1 { s4 s4\< s4\> s4\! } >>
In some situations the \espressivo
articulation mark may be
the appropriate choice to indicate a crescendo and decrescendo on
one note:
c2 b4 a g1\espressivo
Crescendos and decrescendos can be engraved as textual markings
instead of hairpins. Dashed lines are printed to indicate their
extent. The built-in commands that enable these text modes are
\crescTextCresc
, \dimTextDecresc
,
\dimTextDecr
, and \dimTextDim
. The corresponding
\crescHairpin
and \dimHairpin
commands will revert
to hairpins again:
\crescTextCresc c2\< d | e f\! \dimTextDecresc e2\> d | c b\! \crescHairpin c2\< d | e f\! \dimHairpin e2\> d\!
To create new absolute dynamic marks or text that should be aligned with dynamics, see New dynamic marks.
Vertical positioning of dynamics is handled by DynamicLineSpanner.
\dynamicUp
,
\dynamicDown
,
\dynamicNeutral
,
\crescTextCresc
,
\dimTextDim
,
\dimTextDecr
,
\dimTextDecresc
,
\crescHairpin
,
\dimHairpin
.
Setting hairpin behavior at bar lines
If the note which ends a hairpin falls on a downbeat,
the hairpin stops at the bar line immediately preceding. This behavior
can be controlled by overriding the to-barline
property.
\relative c'' { e4\< e2. e1\! \override Hairpin #'to-barline = ##f e4\< e2. e1\! }
Setting the minimum length of hairpins
If hairpins are too short, they can be lengthened by modifying the
minimum-length
property of the Hairpin
object.
\relative c'' { c4\< c\! d\> e\! \override Hairpin #'minimum-length = #5 << f1 { s4 s\< s\> s\! } >> }
Printing hairpins using al niente notation
Hairpins may be printed with a circled tip (al niente notation) by
setting the circled-tip
property of the Hairpin
object to
#t
.
\relative c'' { \override Hairpin #'circled-tip = ##t c2\< c\! c4\> c\< c2\! }
Vertically aligned dynamics and textscripts
By setting the Y-extent
property to a suitable value, all
DynamicLineSpanner
objects (hairpins and dynamic texts) can be
aligned to a common reference point, regardless of their actual extent.
This way, every element will be vertically aligned, thus producing a
more pleasing output.
The same idea is used to align the text scripts along their baseline.
music = \relative c'' { c2\p^\markup { gorgeous } c\f^\markup { fantastic } c4\p c\f\> c c\!\p } { \music \break \override DynamicLineSpanner #'staff-padding = #2.0 \override DynamicLineSpanner #'Y-extent = #'(-1.5 . 1.5) \override TextScript #'Y-extent = #'(-1.5 . 1.5) \music }
Hiding the extender line for text dynamics
Text style dynamic changes (such as cresc. and dim.) are printed with a dashed line showing their extent. This line can be suppressed in the following way:
\relative c'' { \override DynamicTextSpanner #'dash-period = #-1.0 \crescTextCresc c1\< | d | b | c\! }
Changing text and spanner styles for text dynamics
The text used for crescendos and decrescendos can be
changed by modifying the context properties crescendoText
and decrescendoText
. The style of the spanner line can
be changed by modifying the 'style
property of
DynamicTextSpanner
. The default value is
'hairpin
, and other possible values include
'line
, 'dashed-line
, and
'dotted-line
:
\relative c'' { \set crescendoText = \markup { \italic { cresc. poco } } \set crescendoSpanner = #'text \override DynamicTextSpanner #'style = #'dotted-line a2\< a a2 a a2 a a2 a\mf }
Music Glossary: crescendo, decrescendo.
Learning Manual: Articulation and dynamics.
Notation Reference: Direction and placement, New dynamic marks, What goes into the MIDI output?, Controlling MIDI dynamics.
Snippets: Expressive marks.
Internals Reference: DynamicText, Hairpin, DynamicLineSpanner.
The easiest way to create dynamic indications is to use
\markup
objects.
moltoF = \markup { molto \dynamic f } \relative c' { <d e>16_\moltoF <d e> <d e>2.. }
In markup mode, editorial dynamics (within parentheses or square brackets) can be created. The syntax for markup mode is described in Formatting text.
roundF = \markup { \center-align \concat { \bold { \italic ( } \dynamic f \bold { \italic ) } } } boxF = \markup { \bracket { \dynamic f } } \relative c' { c1_\roundF c1_\boxF }
Simple, centered dynamic marks are easily created with the
make-dynamic-script
function. The dynamic font only
contains the characters f,m,p,r,s
and z
.
sfzp = #(make-dynamic-script "sfzp") \relative c' { c4 c c\sfzp c }
In general, make-dynamic-script
takes any markup object as
its argument. In the following example, using
make-dynamic-script
ensures the vertical alignment of
markup objects and hairpins that are attached to the same note
head.
roundF = \markup { \center-align \concat { \normal-text { \bold { \italic ( } } \dynamic f \normal-text { \bold { \italic ) } } } } boxF = \markup { \bracket { \dynamic f } } roundFdynamic = #(make-dynamic-script roundF) boxFdynamic = #(make-dynamic-script boxF) \relative c' { c4_\roundFdynamic\< d e f g,1_\boxFdynamic }
The Scheme form of markup mode may be used instead. Its syntax is explained in Markup construction in Scheme.
moltoF = #(make-dynamic-script (markup #:normal-text "molto" #:dynamic "f")) \relative c' { <d e>16 <d e> <d e>2..\moltoF }
Font settings in markup mode are described in Selecting font and font size.
Notation Reference: Formatting text, Selecting font and font size, Markup construction in Scheme, What goes into the MIDI output?, Controlling MIDI dynamics.
Snippets: Expressive marks.
This section explains how to create various expressive marks that are curved: normal slurs, phrasing slurs, breath marks, falls, and doits.
Slurs are entered using parentheses:
f4( g a) a8 b( a4 g2 f4) <c e>2( <b d>2)
Slurs may be manually placed above or below the notes, see Direction and placement.
c2( d) \slurDown c2( d) \slurNeutral c2( d)
Phrasing slurs must be used to print more than one slur at once. For details, see Phrasing slurs.
Slurs can be solid, dotted, or dashed. Solid is the default slur style:
c4( e g2) \slurDashed g4( e c2) \slurDotted c4( e g2) \slurSolid g4( e c2)
\slurUp
,
\slurDown
,
\slurNeutral
,
\slurDashed
,
\slurDotted
,
\slurSolid
.
Using double slurs for legato chords
Some composers write two slurs when they want legato chords. This can
be achieved by setting doubleSlurs
.
\relative c' { \set doubleSlurs = ##t <c e>4( <d f> <c e> <d f>) }
Music Glossary: slur.
Learning Manual: On the un-nestedness of brackets and ties.
Notation Reference: Direction and placement, Phrasing slurs.
Snippets: Expressive marks.
Internals Reference: Slur.
Phrasing slurs (or phrasing marks) that indicate a
musical sentence are written using the commands \(
and
\)
respectively:
c4\( d( e) f( e2) d\)
Typographically, a phrasing slur behaves almost exactly like a
normal slur. However, they are treated as different objects; a
\slurUp
will have no effect on a phrasing slur. Phrasing
slurs may be manually placed above or below the notes, see
Direction and placement.
c4\( g' c,( b) | c1\) \phrasingSlurUp c4\( g' c,( b) | c1\)
Simultaneous phrasing slurs are not permitted.
\phrasingSlurUp
,
\phrasingSlurDown
,
\phrasingSlurNeutral
.
Learning Manual: On the un-nestedness of brackets and ties.
Notation Reference: Direction and placement.
Snippets: Expressive marks.
Internals Reference: PhrasingSlur.
Breath marks are entered using \breathe
:
c2. \breathe d4
Musical indicators for breath marks in ancient notation, divisiones, are supported. For details, see Divisiones.
Changing the breath mark symbol
The glyph of the breath mark can be tuned by overriding the text
property of the BreathingSign
layout object with any markup
text.
\relative c'' { c2 \override BreathingSign #'text = \markup { \musicglyph #"scripts.rvarcomma" } \breathe d2 }
Caesura marks can be created by overriding the 'text
property of the BreathingSign
object. A curved caesura
mark is also available.
\relative c'' { \override BreathingSign #'text = #(make-musicglyph-markup "scripts.caesura.straight") c8 e4. \breathe g8. e16 c4 \override BreathingSign #'text = #(make-musicglyph-markup "scripts.caesura.curved") g8 e'4. \breathe g8. e16 c4 }
Notation Reference: Divisiones.
Snippets: Expressive marks.
Internals Reference: BreathingSign.
Falls and doits can be added to notes using
the \bendAfter
command. The direction of the fall or doit
is indicated with a plus or minus (up or down). The number
indicates the pitch interval that the fall or doit will extend
beyond the main note.
c2-\bendAfter #+4 c2-\bendAfter #-4 c2-\bendAfter #+8 c2-\bendAfter #-8
The dash -
immediately preceding the \bendAfter
command is required when writing falls and doits.
Adjusting the shape of falls and doits
The shortest-duration-space
property may have to be tweaked to
adjust the shape of falls and doits.
\relative c'' { \override Score.SpacingSpanner #'shortest-duration-space = #4.0 c2-\bendAfter #+5 c2-\bendAfter #-3 c2-\bendAfter #+8 c2-\bendAfter #-6 }
Snippets: Expressive marks.
This section explains how to create various expressive marks that follow a linear path: glissandos, arpeggios, and trills.
A glissando is created by attaching \glissando
to a note:
g2\glissando g' c2\glissando c,
Different styles of glissandi can be created. For details, see Line styles.
Contemporary glissando
A contemporary glissando without a final note can be typeset using a hidden note and cadenza timing.
\relative c'' { \time 3/4 \override Glissando #'style = #'zigzag c4 c \cadenzaOn c4\glissando \hideNotes c,,4 \unHideNotes \cadenzaOff \bar "|" }
Music Glossary: glissando.
Notation Reference: Line styles.
Snippets: Expressive marks.
Internals Reference: Glissando.
Printing text over the line (such as gliss.) is not supported.
An arpeggio on a chord (also known as a broken chord)
is denoted by appending \arpeggio
to the chord construct:
<c e g c>1\arpeggio
Different types of arpeggios may be written.
\arpeggioNormal
reverts to a normal arpeggio:
<c e g c>2\arpeggio \arpeggioArrowUp <c e g c>2\arpeggio \arpeggioArrowDown <c e g c>2\arpeggio \arpeggioNormal <c e g c>2\arpeggio
Special bracketed arpeggio symbols can be created:
<c e g c>2 \arpeggioBracket <c e g c>2\arpeggio \arpeggioParenthesis <c e g c>2\arpeggio \arpeggioNormal <c e g c>2\arpeggio
Arpeggios can be explicitly written out with ties. For more information, see Ties.
\arpeggio
,
\arpeggioArrowUp
,
\arpeggioArrowDown
,
\arpeggioNormal
,
\arpeggioBracket
,
\arpeggioParenthesis
.
Creating cross-staff arpeggios in a piano staff
In a PianoStaff
, it is possible to let an arpeggio cross between
the staves by setting the property PianoStaff.connectArpeggios
.
\new PianoStaff \relative c'' << \set PianoStaff.connectArpeggios = ##t \new Staff { <c e g c>4\arpeggio <g c e g>4\arpeggio <e g c e>4\arpeggio <c e g c>4\arpeggio } \new Staff { \clef bass \repeat unfold 4 { <c,, e g c>4\arpeggio } } >>
Creating cross-staff arpeggios in other contexts
Cross-staff arpeggios can be created in contexts other than
PianoStaff
if the Span_arpeggio_engraver
is included in
the Score
context.
\score { \new StaffGroup { \set Score.connectArpeggios = ##t << \new Voice \relative c' { <c e>2\arpeggio <d f>2\arpeggio <c e>1\arpeggio } \new Voice \relative c { \clef bass <c g'>2\arpeggio <b g'>2\arpeggio <c g'>1\arpeggio } >> } \layout { \context { \Score \consists "Span_arpeggio_engraver" } } }
Creating arpeggios across notes in different voices
An arpeggio can be drawn across notes in different voices on the same
staff if the Span_arpeggio_engraver
is moved to the Staff
context:
\new Staff \with { \consists "Span_arpeggio_engraver" } \relative c' { \set Staff.connectArpeggios = ##t << { <e' g>4\arpeggio <d f> <d f>2 } \\ { <d, f>2\arpeggio <g b>2 } >> }
Music Glossary: arpeggio.
Notation Reference: Ties.
Snippets: Expressive marks.
Internals Reference: Arpeggio, PianoStaff.
It is not possible to mix connected arpeggios and unconnected
arpeggios in one PianoStaff
at the same point in
time.
The parenthesis-style arpeggio brackets do not work for cross-staff arpeggios.
Short trills without an extender line are printed with
\trill
; see Articulations and ornamentations.
Longer trills with an extender line are made with
\startTrillSpan
and \stopTrillSpan
:
d1~\startTrillSpan d1 c2\stopTrillSpan r2
In the following example, a trill is combined with grace notes. The syntax of this construct and the method to precisely position the grace notes are described in Grace notes.
c1 \afterGrace d1\startTrillSpan { c32[ d]\stopTrillSpan } e2 r2
Trills that require an auxiliary note with an explicit pitch can
be typeset with the \pitchedTrill
command. The first
argument is the main note, and the second is the trilled
note, printed as a stemless note head in parentheses.
\pitchedTrill e2\startTrillSpan fis d\stopTrillSpan
In the following example, the second pitched trill is ambiguous; the accidental of the trilled note is not printed. As a workaround, the accidentals of the trilled notes can be forced. The second measure illustrates this method:
\pitchedTrill eis4\startTrillSpan fis g\stopTrillSpan \pitchedTrill eis4\startTrillSpan fis g\stopTrillSpan \pitchedTrill eis4\startTrillSpan fis g\stopTrillSpan \pitchedTrill eis4\startTrillSpan fis! g\stopTrillSpan
\startTrillSpan
,
\stopTrillSpan
.
Music Glossary: trill.
Notation Reference: Articulations and ornamentations, Grace notes.
Snippets: Expressive marks.
Internals Reference: TrillSpanner.
Repetition is a central concept in music, and multiple notations exist for repetitions. LilyPond supports the following kinds of repeats:
volta
unfold
percent
tremolo
This section discusses how to input long (usually multi-measure) repeats. The repeats can take two forms: repeats enclosed between repeat signs; or written out repeats, used to input repetitious music. Repeat signs can also be controlled manually.
The syntax for a normal repeat is
\repeat volta repeatcount musicexpr
where musicexpr is a music expression. Alternate endings can be
produced using \alternative
. In order to delimit the alternate
endings, the group of alternatives must be enclosed in a set of
braces. If there are more repeats than there are alternate endings,
the earliest repeats are given the first alternative.
Normal repeats without alternate endings:
\repeat volta 2 { c4 d e f } c2 d \repeat volta 2 { d4 e f g }
Normal repeats with alternate endings:
\repeat volta 4 { c4 d e f } \alternative { { d2 e } { f2 g } } c1
Repeats with upbeats can be entered in two ways:
\partial 4 e | \repeat volta 4 { c2 d | e2 f | } \alternative { { g4 g g e } { a4 a a a | b2. } }
or
\partial 4 \repeat volta 4 { e4 | c2 d | e2 f | } \alternative { { \partial 4*3 g4 g g } { a4 a a a | b2. } }
Ties may be added to a second ending:
c1 \repeat volta 2 { c4 d e f ~ } \alternative { { f2 d } { f2\repeatTie f, } }
Shortening volta brackets
By default, the volta brackets will be drawn over all of the
alternative music, but it is possible to shorten them by setting
voltaSpannerDuration
. In the next example, the bracket only
lasts one measure, which is a duration of 3/4.
\relative c'' { \time 3/4 c4 c c \set Score.voltaSpannerDuration = #(ly:make-moment 3 4) \repeat volta 5 { d4 d d } \alternative { { e4 e e f4 f f } { g4 g g } } }
Adding volta brackets to additional staves
The Volta_engraver
by default resides in the Score
context, and brackets for the repeat are thus normally only printed
over the topmost staff. This can be adjusted by adding the
Volta_engraver
to the Staff
context where the brackets
should appear; see also the "Volta multi staff" snippet.
<< \new Staff { \repeat volta 2 { c'1 } \alternative { c' } } \new Staff { \repeat volta 2 { c'1 } \alternative { c' } } \new Staff \with { \consists "Volta_engraver" } { c'2 g' e' a' } \new Staff { \repeat volta 2 { c'1 } \alternative { c' } } >>
Music Glossary: repeat, volta.
Notation Reference: Bar lines, Modifying context plug-ins.
Snippets: Repeats.
Internals Reference: VoltaBracket, RepeatedMusic, VoltaRepeatedMusic, UnfoldedRepeatedMusic.
\repeat ... \repeat ... \alternative
is ambiguous, since it is is not clear to which \repeat
the
\alternative
belongs. This ambiguity is resolved by always
having the \alternative
belong to the inner \repeat
.
For clarity, it is advisable to use braces in such situations.
Timing information is not remembered at the start of an alternative,
so after a repeat timing information must be reset by hand; for
example, by setting Score.measurePosition
or entering
\partial
. Similarly, slurs are also not repeated.
Note: These methods are only used for displaying unusual repeat
constructs, and may produce unexpected behavior. In most cases,
repeats should be created using the standard \repeat command
or by printing the relevant bar lines. For more information, see
Bar lines.
|
The property repeatCommands
can be used to control the
layout of repeats. Its value is a Scheme list of repeat commands.
start-repeat
|:
bar line.
c1 \set Score.repeatCommands = #'(start-repeat) d4 e f g c1
As per standard engraving practice, repeat signs are not printed
at the beginning of a piece.
end-repeat
:|
bar line:
c1 d4 e f g \set Score.repeatCommands = #'(end-repeat) c1
(volta
number) ... (volta #f)
f4 g a b \set Score.repeatCommands = #'((volta "2")) g4 a g a \set Score.repeatCommands = #'((volta #f)) c1
Multiple repeat commands may occur at the same point:
f4 g a b \set Score.repeatCommands = #'((volta "2, 5") end-repeat) g4 a g a c1 \set Score.repeatCommands = #'((volta #f) (volta "95") end-repeat) b1
Text can be included with the volta bracket. The text can be a number or numbers or markup text, see Formatting text. The simplest way to use markup text is to define the markup first, then include the the markup in a Scheme list.
voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } } \relative c'' { c1 \set Score.repeatCommands = #(list(list 'volta voltaAdLib) 'start-repeat) c4 b d e \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat) f1 \set Score.repeatCommands = #'((volta #f)) }
Printing a repeat sign at the beginning of a piece
A |:
bar line can be printed at the beginning of a piece, by
overriding the relevant property:
\relative c'' { \once \override Score.BreakAlignment #'break-align-orders = #(make-vector 3 '(instrument-name left-edge ambitus span-bar breathing-sign clef key-signature time-signature staff-bar custos span-bar)) \bar "|:" c1 d1 d4 e f g }
Notation Reference: Bar lines, Formatting text.
Snippets: Repeats.
Internals Reference: VoltaBracket, RepeatedMusic, VoltaRepeatedMusic.
By using the unfold
command, repeats can be used to simplify
the writing out of repetitious music. The syntax is
\repeat unfold repeatcount musicexpr
where musicexpr is a music expression and repeatcount is the number of times musicexpr is repeated.
c1 \repeat unfold 2 { c4 d e f } c1
Unfold repeats can be made with alternate endings. If there are more repeats than there are alternate endings, the first alternative ending is applied to the earliest endings.
c1 \repeat unfold 2 { g4 f e d } \alternative { { cis2 g' } { cis,2 b } } c1
Snippets: Repeats.
Internals Reference: RepeatedMusic, UnfoldedRepeatedMusic.
This section discusses how to input short repeats. Short repeats can take two basic forms: repeats of a single note to two measures, represented by slashes or percent signs; and tremolos.
Repeated short patterns of notes are supported. The music is printed once, and the pattern is replaced with a special sign. Patterns that are shorter than one measure are replaced by slashes, and patterns of one or two measures are replaced by percent-like signs. The syntax is
\repeat percent
number musicexpr
where musicexpr is a music expression.
\repeat percent 4 { c4 } \repeat percent 2 { b4 a g f } \repeat percent 2 { c2 es | f4 fis g c | }
Percent repeat counter
Measure repeats of more than two repeats can get a counter when the convenient property is switched, as shown in this example:
\relative c'' { \set countPercentRepeats = ##t \repeat percent 4 { c1 } }
Isolated percent repeats
Isolated percents can also be printed. This is done by entering a multi-measure rest with a different print function:
\relative c'' { \override MultiMeasureRest #'stencil = #ly:multi-measure-rest::percent R1 }
Music Glossary: percent repeat, simile.
Snippets: Repeats.
Internals Reference: RepeatSlash, PercentRepeat, DoublePercentRepeat, DoublePercentRepeatCounter, PercentRepeatCounter, PercentRepeatedMusic.
Only three kinds of percent repeats are supported: a single slash representing a single beat (regardless of the duration of the repeated notes); a single slash with dots representing one full measure; and two slashes with dots crossing a bar line representing two full measures. Neither multiple slashes representing single beat repeats consisting of sixteenth or shorter notes, nor two slashes with dots representing single beat repeats consisting of notes of varying durations, are supported.
Tremolos can take two forms: alternation between two chords or two notes, and rapid repetition of a single note or chord. Tremolos consisting of an alternation are indicated by adding beams between the notes or chords being alternated, while tremolos consisting of the rapid repetition of a single note are indicated by adding beams or slashes to a single note.
To place tremolo marks between notes, use \repeat
with
tremolo style:
\repeat tremolo 8 { c16 d } \repeat tremolo 6 { c16 d } \repeat tremolo 2 { c16 d }
The \repeat tremolo
syntax expects exactly two notes within
the braces, and the number of repetitions must correspond to a
note value that can be expressed with plain or dotted notes. Thus,
\repeat tremolo 7
is valid and produces a double dotted
note, but \repeat tremolo 9
is not.
The duration of the tremolo equals the duration of the
braced expression multiplied by the number of repeats:
\repeat tremolo 8 { c16 d16 }
gives a whole note tremolo,
notated as two whole notes joined by tremolo beams.
There are two ways to put tremolo marks on a single note. The
\repeat tremolo
syntax is also used here, in which case
the note should not be surrounded by braces:
\repeat tremolo 4 c'16
The same output can be obtained by adding
‘:
[number]’ after the note. The number indicates
the duration of the subdivision, and it must be at least 8. A
number value of 8 gives one line across the note stem. If
the length is omitted, the last value (stored in
tremoloFlags
) is used
c2:8 c:32 c: c:
Snippets: Repeats.
Cross-staff tremolos do not work well.
Polyphony in music refers to having more than one voice occurring in a piece of music. Polyphony in LilyPond refers to having more than one voice on the same staff.
This section discusses simultaneous notes inside the same voice.
A chord is formed by a enclosing a set of pitches between <
and
>
. A chord may be followed by a duration and/or a set of
articulations, just like simple notes:
<c e g>2 <c f a>4-> <e g c>-.
Relative mode can be used for pitches in chords; the preceding pitch into the same chord is still used as a reference for relative pitches, but when a chord is completed, the reference pitch for relative mode is the first note of this chord –not the last note of the chord.
For more information about chords, see Chord notation.
Music Glossary: chord.
Learning Manual: Combining notes into chords.
Notation Reference: Chord notation.
Snippets: Simultaneous notes.
A cluster indicates a continuous range of pitches to be played. They
can be denoted as the envelope of a set of notes. They are entered by
applying the function \makeClusters
to a sequence of chords,
e.g.,
\makeClusters { <g b>2 <c g'> }
Ordinary notes and clusters can be put together in the same staff, even simultaneously. In such a case no attempt is made to automatically avoid collisions between ordinary notes and clusters.
Music Glossary: cluster.
Snippets: Simultaneous notes.
Internals Reference: ClusterSpanner, ClusterSpannerBeacon, Cluster_spanner_engraver.
Clusters look good only if they span at least two chords; otherwise they appear too narrow.
Clusters do not have a stem and cannot indicate durations by themselves. Separate clusters would need a separating rest between them.
This section discusses simultaneous notes in multiple voices or multiple staves.
The basic structure of code needed to achieve multiple, independent voices in a single staff is illustrated in the following example:
\new Staff << \new Voice = "first" { \voiceOne r8 r16 g e8. f16 g8[ c,] f e16 d } \new Voice= "second" { \voiceTwo d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. } >>
Here, voices are instantiated explicitly and are given a name. The
\voiceOne
... \voiceFour
commands set up the voices so
that first and third voices get stems up, second and fourth voices get
stems down, third and fourth voice note heads are horizontally
shifted, and rests in the respective voices are automatically moved to
avoid collisions. Using the \oneVoice
command, all the voice
settings are put back to the neutral directions typical of a
single-voice passage.
We can make a voice to be in the same Voice
context before
and after a temporary polyphonic passage. For example, the following
construct keeps a voice alive throughout the polyphonic section. Said
voice is the first one inside of the two-voice section, and the extra
voice is the second one.
<< { \voiceOne ... } \new Voice { \voiceTwo ... } >> \oneVoice
Using the name given when created, this allows lyrics to be assigned to one consistent voice.
<< \new Voice = "melody" { a4 << { \voiceOne g f } \new Voice { \voiceTwo e d } >> \oneVoice e } \new Lyrics \lyricsto "melody" { This is my song. } >>
Here, the \voiceOne
and \voiceTwo
commands help to make clear what
settings does each voice receive.
The <<{...} \\ {...}>>
construction, where the two (or
more) voices are separated by double backslashes, can be used as a
simplified method to print multiple voices in a single staff. Our
first example could be typeset as follows:
<< { r8 r16 g e8. f16 g8[ c,] f e16 d } \\ { d16 c d8~ d16 b c8~ c16 b c8~ c16 b8. } >>
This syntax is simpler and can be used where it does not matter that
temporary voices are created and then discarded. These implicitly
created voices are given the settings equivalent to the effect of the
\voiceOne
... \voiceFour
commands, in the order in which
they appear in the code. In the following example, the intermediate
voice has stems up, therefore we enter it in the third place, so it
becomes voice three which has the stems up as desired.
<< { r8 g g g g f16 es f8 d } \\ { es,8 r es r d r d r } \\ { d'8 s c s bes s a s } >>
Spacer rests are often used to avoid too many rests, as seen in the example above.
In all but simplest works it is advisable to create explicit
Voice
contexts using the \new
and \context
commands as it is explained in Contexts and engravers and
Explicitly instantiating voices.
In the special case that we want to typeset parallel pieces of music
that have the same rhythm, we can combine them into a single
Voice
context, thus forming chords. To achieve this, enclose
them in a simple simultaneous music construction and make it to be an
explicit voice:
\new Voice << { e4 f8 d e16 f g8 d4 } { c4 d8 b c16 d e8 b4 } >>
This method leads to strange beamings and warnings if the pieces of music do not have the same rhythm.
\voiceOne
,
\voiceTwo
,
\voiceThree
,
\voiceFour
,
\oneVoice
.
Learning Manual: Voices contain music, Explicitly instantiating voices.
Notation Reference: Percussion staves, Invisible rests.
Snippets: Simultaneous notes.
Voices may be given distinct colors and shapes, allowing them to be easily identified:
<< { \voiceOneStyle d4 c2 b4 } \\ { \voiceTwoStyle e,2 e } \\ { \voiceThreeStyle b2. c4 } \\ { \voiceFourStyle g'2 g } >>
To revert the standard presentation, the \voiceNeutralstyle
command is used.
\voiceOneStyle
,
\voiceTwoStyle
,
\voiceThreeStyle
,
\voiceFourStyle
,
\voiceNeutralStyle
.
Learning Manual: I'm hearing Voices, Other sources of information.
Snippets: Simultaneous notes.
Note heads with equal durations are automatically merged, while note heads with unequal durations are not merged. Rests opposite a stem are shifted vertically.
<< { c8 d e d c d c4 g'2 fis } \\ { c2 c8. b16 c4 e,2 r } \\ { \oneVoice s1 e8 a b c d2 } >>
Note heads with different note heads may be merged, with the exception of half-note heads and quarter-note heads:
<< { \mergeDifferentlyHeadedOn c8 d e d c d c4 g'2 fis } \\ { c2 c8. b16 c4 e,2 r } \\ { \oneVoice s1 e8 a b c d2 } >>
Note heads with different dots may be merged:
<< { \mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn c8 d e d c d c4 g'2 fis } \\ { c2 c8. b16 c4 e,2 r } \\ { \oneVoice s1 e8 a b c d2 } >>
The collision on the second measure happens because
\mergeDifferentlyHeadedOn
cannot successfully complete the
merge when three or more notes line up in the same column – in
fact, you will obtain a warning for this reason. To allow the
merge to work properly, apply a \shift
to the note that
should not be merged. Here, \shiftOn
is applied to move
the top g
out of the column, and
\mergeDifferentlyHeadedOn
works properly.
<< { \mergeDifferentlyHeadedOn \mergeDifferentlyDottedOn c8 d e d c d c4 \shiftOn g'2 fis } \\ { c2 c8. b16 c4 e,2 r } \\ { \oneVoice s1 e8 a b c d2 } >>
The \shiftOn
, \shiftOnn
, and \shiftOnnn
commands specify the degree to which chords of the current voice
should be shifted. The outer voices (normally: voices one and
two) have \shiftOff
, while the inner voices (three and
four) have \shiftOn
. \shiftOnn
and
\shiftOnnn
define further shift levels.
Notes are only merged if they have opposing stem directions (i.e., in
Voice
1 and 2).
\mergeDifferentlyDottedOn
,
\mergeDifferentlyDottedOff
,
\mergeDifferentlyHeadedOn
,
\mergeDifferentlyHeadedOff
.
\shiftOn
,
\shiftOnn
,
\shiftOnnn
,
\shiftOff
.
Additional voices to avoid collisions
In some instances of complex polyphonic music, additional voices are
necessary to prevent collisions between notes. If more than four
parallel voices are needed, additional voices can be added by defining
a variable using the Scheme function context-spec-music
.
voiceFive = #(context-spec-music (make-voice-props-set 4) 'Voice) \relative c'' { \time 3/4 \key d \minor \partial 2 << { \voiceOne a4. a8 e'4 e4. e8 f4 d4. c8 } \\ { \voiceThree f,2 bes4 a2 a4 s2 } \\ { \voiceFive s2 g4 g2 f4 f2 } \\ { \voiceTwo d2 d4 cis2 d4 bes2 } >> }
Forcing horizontal shift of notes
When the typesetting engine cannot cope, the force-hshift
property of the NoteColumn
object can be used to override
typesetting decisions. The measure units used here are staff spaces.
\relative c' << { <d g>2 <d g> } \\ { <b f'>2 \once \override NoteColumn #'force-hshift = #1.7 <b f'>2 } >>
Music Glossary: polyphony.
Learning Manual: Multiple notes at once, Voices contain music, Collisions of objects.
Snippets: Simultaneous notes.
Internals Reference: NoteColumn, NoteCollision, RestCollision.
When using \mergeDifferentlyHeadedOn
with an upstem eighth
or a shorter note, and a downstem half note, the eighth note stem
gets a slightly wrong offset because of the different width of the
half note head symbol.
The requirements for successfully merging different note heads that are at the same time differently dotted are not clear.
There is no support for chords where the same note occurs with different accidentals in the same chord. In this case, it is recommended to use enharmonic transcription, or to use special cluster notation (see Clusters).
Automatic part combining is used to merge two parts of music onto a staff. It is aimed at typesetting orchestral scores. When the two parts are identical for a period of time, only one is shown. In places where the two parts differ, they are typeset as separate voices, and stem directions are set automatically. Also, solo and a due parts are identified and marked by default.
The syntax for part combining is:
\partcombine musicexpr1 musicexpr2
The following example demonstrates the basic functionality of the part combiner: putting parts on one staff and setting stem directions and polyphony. The same variables are used for the independent parts and the combined staff.
instrumentOne = \relative c' { c4 d e f R1 d'4 c b a b4 g2 f4 e1 } instrumentTwo = \relative g' { R1 g4 a b c d c b a g f( e) d e1 } << \new Staff \instrumentOne \new Staff \instrumentTwo \new Staff \partcombine \instrumentOne \instrumentTwo >>
The notes in the third measure appear only once, although they were
specified in both parts. Stem, slur, and tie directions are set
automatically, depending whether there is a solo or unison. When
needed in polyphony situations, the first part (with context called
one
) always gets up stems, while the second (called two
)
always gets down stems. In solo situations, the first and second
parts get marked with ‘Solo’ and ‘Solo II’, respectively. The
unisono (a due) parts are marked by default with the text
“a2”.
Both arguments to \partcombine
will be interpreted as
Voice
contexts. If using relative octaves,
\relative
should be specified for both music expressions,
i.e.,
\partcombine \relative ... musicexpr1 \relative ... musicexpr2
A \relative
section that is outside of \partcombine
has no effect on the pitches of musicexpr1 and
musicexpr2.
Combining two parts on the same staff
The part combiner tool ( \partcombine
command ) allows the
combination of several different parts on the same staff. Text
directions such as "solo" or "a2" are added by default; to remove
them, simply set the property printPartCombineTexts
to
"false". For vocal scores (hymns), there is no need to add
"solo"/"a2" texts, so they should be switched off. However, it
might be better not to use it if there are any solos, as they won't be
indicated. In such cases, standard polyphonic notation may be
preferable.
This snippet presents the three ways two parts can be printed on a same
staff: standard polyphony, \partcombine
without texts, and
\partcombine
with texts.
musicUp = \relative c'' { \time 4/4 a4 c4.( g8) a4 | g4 e' g,( a8 b) | c b a2. } musicDown = \relative c'' { g4 e4.( d8) c4 | r2 g'4( f8 e) | d2 \stemDown a } \score { << << \new Staff { \set Staff.instrumentName = "Standard polyphony " << \musicUp \\ \musicDown >> } \new Staff \with { printPartCombineTexts = ##f } { \set Staff.instrumentName = "PartCombine without texts " \partcombine \musicUp \musicDown } \new Staff { \set Staff.instrumentName = "PartCombine with texts " \partcombine \musicUp \musicDown } >> >> \layout { indent = 6.0\cm \context { \Score \override SystemStartBar #'collapse-height = #30 } } }
Changing partcombine texts
When using the automatic part combining feature, the printed text for the solo and unison sections may be changed:
\new Staff << \set Staff.soloText = #"girl" \set Staff.soloIIText = #"boy" \set Staff.aDueText = #"together" \partcombine \relative c'' { g4 g r r a2 g } \relative c'' { r4 r a( b) a2 g } >>
Notation Reference: Writing parts.
Snippets: Simultaneous notes.
Internals Reference: PartCombineMusic, Voice.
When printPartCombineTexts
is set, if the two voices play
the same notes on and off, the part combiner may typeset a2
more than once in a measure.
\partcombine
cannot be inside \times
.
\partcombine
cannot be inside \relative
.
Internally, the \partcombine
interprets both arguments as
Voice
s named one
and two
, and then decides
when the parts can be combined. Consequently, if the arguments
switch to differently named Voice contexts, the
events in those will be ignored.
Music for multiple parts can be interleaved in input code. The
function \parallelMusic
accepts a list with the names of a
number of variables to be created, and a musical expression. The
content of alternate measures from the expression become the value
of the respective variables, so you can use them afterwards to
print the music.
Note: Bar checks | must be used, and the measures must
be of the same length.
|
\parallelMusic #'(voiceA voiceB voiceC) { % Bar 1 r8 g'16 c'' e'' g' c'' e'' r8 g'16 c'' e'' g' c'' e'' | r16 e'8.~ e'4 r16 e'8.~ e'4 | c'2 c'2 | % Bar 2 r8 a'16 d'' f'' a' d'' f'' r8 a'16 d'' f'' a' d'' f'' | r16 d'8.~ d'4 r16 d'8.~ d'4 | c'2 c'2 | } \new StaffGroup << \new Staff << \voiceA \\ \voiceB >> \new Staff { \clef bass \voiceC } >>
Relative mode may be used. Note that the \relative
command
is not used inside \parallelMusic
itself. The notes are
relative to the preceding note in the voice, not to the previous
note in the input – in other words, relative notes for
voiceA
ignore the notes in voiceB
.
\parallelMusic #'(voiceA voiceB voiceC) { % Bar 1 r8 g16 c e g, c e r8 g,16 c e g, c e | r16 e8.~ e4 r16 e8.~ e4 | c2 c | % Bar 2 r8 a,16 d f a, d f r8 a,16 d f a, d f | r16 d8.~ d4 r16 d8.~ d4 | c2 c | } \new StaffGroup << \new Staff << \relative c'' \voiceA \\ \relative c' \voiceB >> \new Staff \relative c' { \clef bass \voiceC } >>
This works quite well for piano music. This example maps four consecutive measures to four variables:
global = { \key g \major \time 2/4 } \parallelMusic #'(voiceA voiceB voiceC voiceD) { % Bar 1 a8 b c d | d4 e | c16 d e fis d e fis g | a4 a | % Bar 2 e8 fis g a | fis4 g | e16 fis g a fis g a b | a4 a | % Bar 3 ... } \score { \new PianoStaff << \new Staff { \global << \relative c'' \voiceA \\ \relative c' \voiceB >> } \new Staff { \global \clef bass << \relative c \voiceC \\ \relative c \voiceD >> } >> }
Learning Manual: Organizing pieces with variables.
Snippets: Simultaneous notes.
This section explains how to influence the staff appearance, print scores with more than one staff, and how to apply specific performance marks to single staves.
This section shows the different possibilities of creating and grouping staves, which are marked at the beginning of each line with either a bracket or a brace.
Staves (singular: staff) are created with
the \new
or \context
commands. For details, see
Creating contexts.
The basic staff context is Staff
:
\new Staff { c4 d e f }
DrumStaff
creates a five-line staff set up for a
typical drum set. It uses different names for each instrument.
The instrument names are set using the \drummode
command.
For details, see Percussion staves.
\new DrumStaff { \drummode { cymc hh ss tomh } }
GregorianTranscriptionStaff
creates a staff to notate
modern Gregorian chant. It does not show bar lines.
\new GregorianTranscriptionStaff { c4 d e f }
RhythmicStaff
creates a single-line staff that only
displays the rhythmic values of the input. Real durations are
preserved. For details, see Showing melody rhythms.
\new RhythmicStaff { c4 d e f }
TabStaff
creates a tablature with six strings in standard
guitar tuning. For details, see Default tablatures.
\new TabStaff { c4 d e f }
There are two staff contexts specific for the notation of ancient
music: MensuralStaff
and VaticanaStaff
. They are
described in Pre-defined contexts.
Staves can be started or stopped at any point in the score. The
commands \startStaff
and \stopStaff
are used for
this purpose. For details, see Staff symbol.
Music Glossary: staff, staves.
Notation Reference: Creating contexts, Percussion staves, Showing melody rhythms, Default tablatures, Pre-defined contexts, Staff symbol, Gregorian chant contexts, Mensural contexts.
Snippets: Staff notation.
Internals Reference: Staff, DrumStaff, GregorianTranscriptionStaff, RhythmicStaff, TabStaff, MensuralStaff, VaticanaStaff, StaffSymbol.
Various contexts exist to group single staves together in order to form multi-stave systems. Each grouping context sets the style of the system start delimiter and the behavior of bar lines.
If no context is specified, the default properties will be used: the group is started with a vertical line, and the bar lines are not connected.
<< \new Staff { c1 c } \new Staff { c1 c } >>
In the StaffGroup
context, the group is started with a
bracket and bar lines are drawn through all the staves.
\new StaffGroup << \new Staff { c1 c } \new Staff { c1 c } >>
In a ChoirStaff
, the group starts with a bracket, but bar
lines are not connected.
\new ChoirStaff << \new Staff { c1 c } \new Staff { c1 c } >>
In a GrandStaff
, the group begins with a brace, and bar
lines are connected between the staves.
\new GrandStaff << \new Staff { c1 c } \new Staff { c1 c } >>
The PianoStaff
is identical to a GrandStaff
, except
that it supports printing the instrument name directly. For
details, see Instrument names.
\new PianoStaff << \set PianoStaff.instrumentName = "Piano" \new Staff { c1 c } \new Staff { c1 c } >>
Each staff group context sets the property
systemStartDelimiter
to one of the following values:
SystemStartBar
, SystemStartBrace
, or
SystemStartBracket
. A fourth delimiter,
SystemStartSquare
, is also available, but it must be
explicitly specified.
Use square bracket at the start of a staff group
The system start delimiter SystemStartSquare
can be used by
setting it explicitly in a StaffGroup
or ChoirStaffGroup
context.
\score { \new StaffGroup { << \set StaffGroup.systemStartDelimiter = #'SystemStartSquare \new Staff { c'4 d' e' f' } \new Staff { c'4 d' e' f' } >> } }
Display bracket with only one staff in a system
If there is only one staff in one of the staff types
ChoirStaff
, InnerChoirStaff
, InnerStaffGroup
or StaffGroup
, the bracket and the starting bar line will not
be displayed as standard behavior. This can be changed by overriding
the relevant properties, as demonstrated in this example.
Note that in contexts such as PianoStaff
and GrandStaff
where the systems begin with a brace instead of a bracket, another
property has to be set, as shown on the second system in the example.
\markup \column { \score { \new StaffGroup << % Must be lower than the actual number of staff lines \override StaffGroup.SystemStartBracket #'collapse-height = #1 \override Score.SystemStartBar #'collapse-height = #1 \new Staff { c'1 } >> \layout { } } \score { \new PianoStaff << \override PianoStaff.SystemStartBrace #'collapse-height = #1 \override Score.SystemStartBar #'collapse-height = #1 \new Staff { c'1 } >> \layout { } } }
Mensurstriche layout (bar lines between the staves)
The mensurstriche-layout where the bar lines do not show on the staves
but between staves can be achieved with a StaffGroup
instead of
a ChoirStaff
. The bar line on staves is blanked out by setting
the transparent
property.
global = { \override Staff.BarLine #'transparent = ##t s1 s % the final bar line is not interrupted \revert Staff.BarLine #'transparent \bar "|." } \new StaffGroup \relative c'' { << \new Staff { << \global { c1 c } >> } \new Staff { << \global { c c } >> } >> }
Music Glossary: brace, bracket, grand staff.
Notation Reference: Instrument names.
Snippets: Staff notation.
Internals Reference: Staff, StaffGroup, ChoirStaff, GrandStaff, PianoStaff, SystemStartBar, SystemStartBrace, SystemStartBracket, SystemStartSquare.
Two additional staff-group contexts are available that can be
nested within a StaffGroup
or ChoirStaff
context:
InnerStaffGroup
and InnerChoirStaff
. These contexts
create a bracket next to the original bracket of their parent
staff group.
An InnerStaffGroup
is treated similarly to a
StaffGroup
; bar lines are connected between each stave
within the context:
\new StaffGroup << \new Staff { c2 c | c2 c } \new InnerStaffGroup << \new Staff { g2 g | g2 g } \new Staff { e2 e | e2 e } >> >>
Bar lines are not connected between staves of an
InnerChoirStaff
, just like a ChoirStaff
:
\new ChoirStaff << \new Staff { c2 c | c2 c } \new InnerChoirStaff << \new Staff { g2 g | g2 g } \new Staff { e2 e | e2 e } >> \new Staff { c1 | c1 } >>
Nesting staves
The property systemStartDelimiterHierarchy
can be used to make
more complex nested staff groups. The command \set
StaffGroup.systemStartDelimiterHierarchy
takes an alphabetical list of
the number of staves produced. Before each staff a system start
delimiter can be given. It has to be enclosed in brackets and takes as
much staves as the brackets enclose. Elements in the list can be
omitted, but the first bracket takes always the complete number of
staves. The possibilities are SystemStartBar
,
SystemStartBracket
, SystemStartBrace
, and
SystemStartSquare
.
\new StaffGroup \relative c'' << \set StaffGroup.systemStartDelimiterHierarchy = #'(SystemStartSquare (SystemStartBrace (SystemStartBracket a (SystemStartSquare b) ) c ) d) \new Staff { c1 } \new Staff { c1 } \new Staff { c1 } \new Staff { c1 } \new Staff { c1 } >>
Notation Reference: Grouping staves, Instrument names.
Snippets: Staff notation.
Internals Reference: InnerStaffGroup, StaffGroup, InnerChoirStaff, ChoirStaff, SystemStartBar, SystemStartBrace, SystemStartBracket, SystemStartSquare.
This section explains how to change specific attributes of one staff: for example, modifying the number of staff lines or the staff size. Methods to start and stop staves and set ossia sections are also described.
The lines of a staff belong to the StaffSymbol
grob.
StaffSymbol
properties can be modified to change the
appearance of a staff, but they must be modified before the staff
is created.
The number of staff lines may be changed. The clef position and the position of middle C may need to be modified to fit the new staff. For an explanation, refer to the snippet section in Clef.
\new Staff \with { \override StaffSymbol #'line-count = #3 } { d4 d d d }
The vertical position of staff lines and the number of staff lines can be defined at the same time. As the following example shows, note positions are not influenced by the staff line positions.
Note: The 'line-positions property overrides the
'line-count property. The number of staff lines is
implicitly defined by the number of elements in the list of values
for 'line-positions
|
\new Staff \with { \override StaffSymbol #'line-positions = #'(7 3 0 -4 -6 -7) } { a4 e' f b | d1 }
Staff line thickness can be modified. The thickness of ledger lines and stems are also affected, since they depend on staff line thickness.
\new Staff \with { \override StaffSymbol #'thickness = #3 } { e4 d c b }
Ledger line thickness can be set independently of staff line thickness.
\new Staff \with { \override StaffSymbol #'ledger-line-thickness = #'(1 . 0.2) } { e4 d c b }
The distance between staff lines can be changed. This setting has influence on ledger lines as well.
\new Staff \with { \override StaffSymbol #'staff-space = #1.5 } { a4 b c d }
The width of a staff can be modified. The unit is one staff space. The spacing of objects inside the staff is not influenced by this setting.
\new Staff \with { \override StaffSymbol #'width = #23 } { a4 e' f b | d1 }
Further details about the properties of StaffSymbol
can be
found here: staff-symbol-interface.
Modifications to staff properties in the middle of a score can be
placed between \stopStaff
and \startStaff
:
c2 c \stopStaff \override Staff.StaffSymbol #'line-count = #2 \startStaff b2 b \stopStaff \revert Staff.StaffSymbol #'line-count \startStaff a2 a
\startStaff
,
\stopStaff
.
Making some staff lines thicker than the others
For pedagogical purposes, a staff line can be thickened (e.g., the
middle line, or to emphasize the line of the G clef). This can be
achieved by adding extra lines very close to the line that should be
emphasized, using the line-positions
property of the
StaffSymbol
object.
{ \override Staff.StaffSymbol #'line-positions = #'(-4 -2 -0.2 0 0.2 2 4) d'4 e' f' g' }
Music Glossary: line, ledger line, staff.
Notation Reference: Displaying pitches.
Snippets: Staff notation.
Internals Reference: StaffSymbol, staff-symbol-interface.
When setting vertical staff line positions manually, bar lines are always centered on position 0, so the maximum distance between the outermost bar lines in either direction must be equal.
Ossia staves can be set by creating a new simultaneous staff in the appropriate location:
\new Staff \relative c'' { c4 b d c << { c4 b d c } \new Staff { e4 d f e } >> c4 b c2 }
However, the above example is usually not the desired result. To create ossia staves that are above the original staff, have no time signature or clef, and have a smaller font size, tweaks must be used. The Learning Manual describes a specific technique to achieve this goal, beginning with Nesting music expressions.
The following example uses the alignAboveContext
property
to align the ossia staff. This method is most appropriate when
only a few ossia staves are needed.
\new Staff = main \relative c'' { c4 b d c << { c4 b d c } \new Staff \with { \remove "Time_signature_engraver" alignAboveContext = #"main" fontSize = #-3 \override StaffSymbol #'staff-space = #(magstep -3) \override StaffSymbol #'thickness = #(magstep -3) firstClef = ##f } { e4 d f e } >> c4 b c2 }
If many isolated ossia staves are needed, creating an empty
Staff
context with a specific context id may be more
appropriate; the ossia staves may then be created by
calling this context and using \startStaff
and
\stopStaff
at the desired locations. The benefits of this
method are more apparent if the piece is longer than the following
example.
<< \new Staff = ossia \with { \remove "Time_signature_engraver" \remove "Clef_engraver" fontSize = #-3 \override StaffSymbol #'staff-space = #(magstep -3) \override StaffSymbol #'thickness = #(magstep -3) } { \stopStaff s1*6 } \new Staff \relative c' { c4 b c2 << { e4 f e2 } \context Staff = ossia { \startStaff e4 g8 f e2 \stopStaff } >> g4 a g2 \break c4 b c2 << { g4 a g2 } \context Staff = ossia { \startStaff g4 e8 f g2 \stopStaff } >> e4 d c2 } >>
Using the \RemoveEmptyStaffContext
command to create ossia
staves may be used as an alternative. This method is most
convenient when ossia staves occur immediately following a line
break. In this case, spacer rests do not need to be used at all;
only \startStaff
and \stopStaff
are necessary. For
more information about \RemoveEmptyStaffContext
, see
Hiding staves.
<< \new Staff = ossia \with { \remove "Time_signature_engraver" \remove "Clef_engraver" fontSize = #-3 \override StaffSymbol #'staff-space = #(magstep -3) \override StaffSymbol #'thickness = #(magstep -3) } \new Staff \relative c' { c4 b c2 e4 f e2 g4 a g2 \break << { c4 b c2 } \context Staff = ossia { c4 e8 d c2 \stopStaff } >> g4 a g2 e4 d c2 } >> \layout { \context { \RemoveEmptyStaffContext \override VerticalAxisGroup #'remove-first = ##t } }
Vertically aligning ossias and lyrics
This snippet demonstrates the use of the context properties
alignBelowContext
and alignAboveContext
to control the
positioning of lyrics and ossias.
\paper { ragged-right = ##t } \relative c' << \new Staff = "1" { c4 c s2 } \new Staff = "2" { c4 c s2 } \new Staff = "3" { c4 c s2 } { \skip 2 << \lyrics { \set alignBelowContext = #"1" lyrics4 below } \new Staff \with { alignAboveContext = #"3" fontSize = #-2 \override StaffSymbol #'staff-space = #(magstep -2) \remove "Time_signature_engraver" } { \times 4/6 { \override TextScript #'padding = #3 c8^"ossia above" d e d e f } } >> } >>
Music Glossary: ossia, staff, Frenched staff.
Learning Manual: Nesting music expressions, Size of objects, Length and thickness of objects.
Notation Reference: Setting the staff size.
Snippets: Staff notation.
Internals Reference: StaffSymbol.
Staff lines can be hidden by removing the
Staff_symbol_engraver
from the Staff
context. As an
alternative, \stopStaff
may be used.
\new Staff \with { \remove "Staff_symbol_engraver" } \relative c''' { a8 f e16 d c b a2 }
Empty staves can be hidden by setting the
\RemoveEmptyStaffContext
command in the \layout
block. In orchestral scores, this style is known as ‘Frenched
Score’. By default, this command hides all empty staves in a
score except for those in the first system.
Note: An empty staff may only include multi-measure rests, skips, spacer rests, or a combination of these. |
\layout { \context { \RemoveEmptyStaffContext } } \relative c' << \new Staff { e4 f g a \break b1 \break a4 b c2 } \new Staff { c,4 d e f \break R1 \break f4 g c,2 } >>
\RemoveEmptyStaffContext
can also be used to create ossia
sections for a staff. For details, see Ossia staves.
The \AncientRemoveEmptyStaffContext
command may be used to
hide empty staves in ancient music contexts. Similarly,
\RemoveEmptyRhythmicStaffContext
may be used to hide empty
RhythmicStaff
contexts.
\RemoveEmptyStaffContext
,
\AncientRemoveEmptyStaffContext
,
\RemoveEmptyRhythmicStaffContext
.
Removing the first empty line
The first empty staff can also be removed from the score by setting the
VerticalAxisGroup
property remove-first
. This can be done
globally inside the \layout
block, or locally inside the
specific staff that should be removed. In the latter case, you have to
specify the context (Staff
applies only to the current staff) in
front of the property.
The lower staff of the second staff group is not removed, because the setting applies only to the specific staff inside of which it is written.
\layout { \context { \RemoveEmptyStaffContext % To use the setting globally, uncomment the following line: % \override VerticalAxisGroup #'remove-first = ##t } } \new StaffGroup << \new Staff \relative c' { e4 f g a \break c1 } \new Staff { % To use the setting globally, comment this line, % uncomment the line in the \layout block above \override Staff.VerticalAxisGroup #'remove-first = ##t R1 \break R } >> \new StaffGroup << \new Staff \relative c' { e4 f g a \break c1 } \new Staff { R1 \break R } >>
Music Glossary: Frenched staff.
Notation Reference: Staff symbol, Ossia staves.
Snippets: Staff notation.
Internals Reference: ChordNames, FiguredBass, Lyrics, Staff, VerticalAxisGroup.
This section explains how to insert tempo indications and instrument names into a score. Methods to quote other voices and format cue notes are also described.
A basic metronome mark is simple to write:
\tempo 4 = 120 c2 d e4. d8 c2
Tempo indications with text can be used instead:
\tempo "Allegretto" c4 e d c b4. a16 b c4 r4
Combining a metronome mark and text will automatically place the metronome mark within parentheses:
\tempo "Allegro" 4 = 160 g4 c d e d4 b g2
In general, the text can be any markup object:
\tempo \markup { \italic Faster } 4 = 132 a8-. r8 b-. r gis-. r a-. r
A parenthesized metronome mark with no textual indication may be written by including an empty string in the input:
\tempo "" 8 = 96 d4 g e c
Printing metronome and rehearsal marks below the staff
By default, metronome and rehearsal marks are printed above the staff.
To place them below the staff simply set the direction
property
of MetronomeMark
or RehearsalMark
appropriately.
\layout { ragged-right = ##f } { % Metronome marks below the staff \override Score.MetronomeMark #'direction = #DOWN \tempo 8. = 120 c''1 % Rehearsal marks below the staff \override Score.RehearsalMark #'direction = #DOWN \mark \default c''1 }
To change the tempo in the MIDI output without printing anything, make the metronome marking invisible
\once \override Score.MetronomeMark #'transparent = ##t
To print other metronome markings, use these markup commands
c4^\markup { ( \smaller \general-align #Y #DOWN \note #"16." #1 = \smaller \general-align #Y #DOWN \note #"8" #1 ) }
For more details, see Formatting text.
Music Glossary: metronome, metronomic indication, tempo indication, metronome mark.
Notation Reference: Formatting text, MIDI output.
Snippets: Staff notation.
Internals Reference: MetronomeMark.
Instrument names can be printed on the left side of staves for the
Staff
and PianoStaff
contexts. The value of
instrumentName
is used for the first staff, and the value
of shortInstrumentName
is used for all succeeding staves.
\set Staff.instrumentName = "Violin " \set Staff.shortInstrumentName = "Vln " c4.. g'16 c4.. g'16 \break c1
Markup mode can be used to create more complicated instrument names:
\set Staff.instrumentName = \markup { \column { "Clarinetti" \line { "in B" \smaller \flat } } } c4 c,16 d e f g2
When two or more staff contexts are grouped together, the
instrument names and short instrument names are centered by
default. To center multi-line instrument names,
\center-column
must be used:
<< \new Staff { \set Staff.instrumentName = "Flute" f2 g4 f } \new Staff { \set Staff.instrumentName = \markup \center-column { Clarinetti \line { "in B" \smaller \flat } } c4 b c2 } >>
However, if the instrument names are longer, the instrument names
in a staff group may not be centered unless the indent
and
short-indent
settings are increased. The indent
and
short-indent
settings are modified in the \layout
block and specify the level of indentation for the first system
and all succeeding systems, respectively.
\layout { indent = 2.5\cm short-indent = 1.5\cm } \relative c'' << \new Staff { \set Staff.instrumentName = "Flute" \set Staff.shortInstrumentName = "Fl." f2 g4 f \break g4 f g2 } \new Staff { \set Staff.instrumentName = "Clarinet" \set Staff.shortInstrumentName = "Clar." c,4 b c2 \break c2 b4 c } >>
To add instrument names to other contexts (such as
GrandStaff
, ChoirStaff
, or StaffGroup
),
Instrument_name_engraver
must be added to that context.
For details, see Modifying context plug-ins.
Instrument names may be changed in the middle of a piece:
\set Staff.instrumentName = "First" \set Staff.shortInstrumentName = "one" c1 c c c \break c1 c c c \break \set Staff.instrumentName = "Second" \set Staff.shortInstrumentName = "two" c1 c c c \break c1 c c c \break
Notation Reference: Modifying context plug-ins.
Snippets: Staff notation.
Internals Reference: InstrumentName, PianoStaff, Staff.
Quotations allow fragments of other parts to be inserted directly
into a music expression. Before a part can be quoted, the
\addQuote
command must be used to initialize the quoted
fragment. This command must be used in the toplevel scope. The
first argument is an identifying string, and the second is a music
expression:
flute = \relative c' { f4 fis g gis } \addQuote "flute" { \flute }
The \quoteDuring
command may then be used to indicate when
the quotation should take place. The corresponding measures from
the quotation are inserted into the music expression. The syntax
is similar to \addQuote
:
flute = \relative c' { f4 fis g gis } \addQuote "flute" { \flute } \relative c' { c4 cis \quoteDuring #"flute" { s2 } }
If the music expression used for \quoteDuring
contains
anything but a spacer rest or multi-measure rest, a polyphonic
situation is created, which is often not desirable:
flute = \relative c' { f4 fis g gis } \addQuote "flute" { \flute } \relative c' { c4 cis \quoteDuring #"flute" { c4 b } }
Quotations recognize instrument transposition settings for both
the source and target instruments if they are specified using the
\transposition
command:
clarinet = \relative c' { \transposition bes f4 fis g gis } \addQuote "clarinet" { \clarinet } \relative c' { c4 cis \quoteDuring #"clarinet" { s2 } }
Quoting another voice with transposition
Quotations take into account the transposition of both
source and target. In this example, all instruments play sounding
middle C; the target is an instrument in F. The target part may be
transposed using \transpose
. In this case, all the pitches
(including the quoted ones) are transposed.
\addQuote clarinet { \transposition bes \repeat unfold 8 { d'16 d' d'8 } } \addQuote sax { \transposition es' \repeat unfold 16 { a8 } } quoteTest = { % french horn \transposition f g'4 << \quoteDuring #"clarinet" { \skip 4 } s4^"clar." >> << \quoteDuring #"sax" { \skip 4 } s4^"sax." >> g'4 } { \set Staff.instrumentName = \markup \center-column { Horn \line { in F } } \quoteTest \transpose c' d' << \quoteTest s4_"up a tone" >> }
Quoting another voice
With \quote
, fragments of previously entered
music may be quoted. quotedEventTypes
will determines which
items are quoted. In this example, a 16th rest is not quoted, since
rest-event
is not in quotedEventTypes
.
quoteMe = \relative c' { fis4 r16 a8.-> b4-\ff c } \addQuote quoteMe \quoteMe original = \relative c'' { c8 d s2 \once \override NoteColumn #'ignore-collision = ##t es8 gis8 } << \new Staff { \set Staff.instrumentName = #"quoteMe" \quoteMe } \new Staff { \set Staff.instrumentName = #"orig" \original } \new Staff \relative c'' << \set Staff.instrumentName = #"orig+quote" \set Staff.quotedEventTypes = #'(note-event articulation-event) \original \new Voice { s4 \set fontSize = #-4 \override Stem #'length-fraction = #(magstep -4) \quoteDuring #"quoteMe" { \skip 2. } } >> >>
Notation Reference: Instrument transpositions.
Snippets: Staff notation.
Internals Reference: QuoteMusic, Voice.
Only the contents of the first Voice
occurring in an
\addQuote
command will be considered for quotation, so
music cannot contain \new
and \context Voice
statements that would switch to a different Voice.
Quoting grace notes is broken and can even cause LilyPond to crash.
Quoting nested triplets may result in poor notation.
In earlier versions of LilyPond (pre 2.11), addQuote
was
written entirely in lower-case letters: \addquote
.
The previous section explains how to quote other voices. The
\cueDuring
command is a more specialized form of
\quoteDuring
, being particularly useful for inserting cue
notes into a part. The syntax is as follows:
\cueDuring #partname #voice music
This command copies the corresponding measures from partname
into a CueVoice
context. The CueVoice
is created
implicitly, and occurs simultaneously with music, which
creates a polyphonic situation. The voice argument
determines whether the cue notes should be notated as a first or
second voice; UP
corresponds to the first voice, and
DOWN
corresponds to the second.
oboe = \relative c'' { r2 r8 d16 f e g f a g8 g16 g g2. } \addQuote "oboe" { \oboe } \new Voice \relative c'' { \cueDuring #"oboe" #UP { R1 } g2 c, }
In the above example, the Voice
context had to be
explicitly declared, or else the entire music expression would
belong to the CueVoice
context.
The name of the cued instrument can be printed by setting the
instrumentCueName
property.
oboe = \relative c''' { g4 r8 e16 f e4 d } \addQuote oboe { \oboe } \new Staff \relative c'' << \new CueVoice \with { instrumentCueName = "ob." } \new Voice { \cueDuring #"oboe" #UP { R1 } g4. b8 d2 } >>
The \killCues
command is used to remove the cue notes from
a music expression.
flute = \relative c''' { r2 cis2 r2 dis2 } \addQuote flute { \flute } \new Voice \relative c'' { \killCues { \cueDuring #"flute" #UP { R1 } g4. b8 d2 } }
When typesetting cue notes, some guidelines should be followed:
The \transposedCueDuring
command is useful to add cues for
instruments in a completely different register. The syntax is
similar to \cueDuring
, but it requires one more argument to
specify the transposition of the cued instrument. For more
information about transposition, see
Instrument transpositions.
piccolo = \relative c''' { \clef "treble^8" R1 c8 c c e g2 a4 g g2 } \addQuote "piccolo" { \piccolo } cbassoon = \relative c, { \clef "bass_8" c4 r g r \transposedCueDuring #"piccolo" #UP c,, { R1 } c4 r g r } << \new Staff = "piccolo" \piccolo \new Staff = "cbassoon" \cbassoon >>
Notation Reference: Instrument transpositions.
Snippets: Staff notation.
Internals Reference: CueVoice, Voice.
Collisions are not checked between Voice
and
CueVoice
contexts.
This section discusses the various ways to change the appearance of notes and add analysis or educational emphasis.
This section discusses how to add emphasis to elements that are inside the staff.
The font size of notation elements may be altered. It does not change the size of variable symbols, such as beams or slurs.
Note: For font sizes of text, see Selecting font and font size. |
\huge c4.-> d8---3 \large c4.-> d8---3 \normalsize c4.-> d8---3 \small c4.-> d8---3 \tiny c4.-> d8---3 \teeny c4.-> d8---3
Internally, this sets the fontSize
property. This in turn
causes the font-size
property to be set in all layout
objects. The value of font-size
is a number indicating the
size relative to the standard size for the current staff height.
Each step up is an increase of approximately 12% of the font size.
Six steps is exactly a factor of two. The Scheme function
magstep
converts a font-size
number to a scaling
factor. The font-size
property can also be set directly,
so that only certain layout objects are affected.
\set fontSize = #3 c4.-> d8---3 \override NoteHead #'font-size = #-4 c4.-> d8---3 \override Script #'font-size = #2 c4.-> d8---3 \override Stem #'font-size = #-5 c4.-> d8---3
Font size changes are achieved by scaling the design size that is
closest to the desired size. The standard font size (for
font-size = #0
) depends on the standard staff height.
For a 20pt staff, a 10pt font is selected.
The font-size
property can only be set on layout objects
that use fonts. These are the ones supporting the
font-interface
layout interface.
\teeny
,
\tiny
,
\small
,
\normalsize
,
\large
,
\huge
.
Snippets: Editorial annotations.
Internals Reference: font-interface.
Fingering instructions can be entered using note-digit:
c4-1 d-2 f-4 e-3
Markup texts may be used for finger changes.
c4-1 d-2 f-4 c^\markup { \finger "2 - 3" }
A thumb-script can be added (e.g., in cello music) to indicate that a note should be played with the thumb.
<a_\thumb a'-3>2 <b_\thumb b'-3>
Fingerings for chords can also be added to individual notes of the chord by adding them after the pitches.
<c-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
Fingering instructions may be manually placed above or below the staff, see Direction and placement.
Controlling the placement of chord fingerings
The placement of fingering numbers can be controlled precisely.
\relative c' { \set fingeringOrientations = #'(left) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(down) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(right) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(up) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(left down) <c-1 e-3 a-5>2 \set fingeringOrientations = #'(up right down) <c-1 e-3 a-5>2 }
Allowing fingerings to be printed inside the staff
By default, fingering numbers will be printed outside the staff. However, this behavior can be canceled.
\relative c' { <c-1 e-2 g-3 b-5>2 \once \override Fingering #'staff-padding = #'() <c-1 e-2 g-3 b-5>2 }
Notation Reference: Direction and placement
Snippets: Editorial annotations.
Internals Reference: FingeringEvent, fingering-event, Fingering_engraver, New_fingering_engraver, Fingering.
Hidden (or invisible or transparent) notes can be useful in preparing theory or composition exercises.
c4 d \hideNotes e4 f \unHideNotes g a \hideNotes b \unHideNotes c
Notation objects which are attached to invisible notes are still visible.
c4( d) \hideNotes e4(\p f)--
\hideNotes
, \unHideNotes
Snippets: Editorial annotations.
Internals Reference: Note_spacing_engraver, NoteSpacing.
Individual objects may be assigned colors. Valid color names are listed in the List of colors.
\override NoteHead #'color = #red c4 c \override NoteHead #'color = #(x11-color 'LimeGreen) d \override Stem #'color = #blue e
The full range of colors defined for X11 can be accessed by using
the Scheme function x11-color
. The function takes one
argument; this can be a symbol in the form 'FooBar or a
string in the form "FooBar". The first form is quicker to
write and is more efficient. However, using the second form it is
possible to access X11 colors by the multi-word form of its name.
If x11-color
cannot make sense of the parameter then the
color returned defaults to black.
\override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2) \set Staff.instrumentName = \markup { \with-color #(x11-color 'navy) "Clarinet" } gis8 a \override Beam #'color = #(x11-color "medium turquoise") gis a \override Accidental #'color = #(x11-color 'DarkRed) gis a \override NoteHead #'color = #(x11-color "LimeGreen") gis a % this is deliberate nonsense; note that the stems remain black \override Stem #'color = #(x11-color 'Boggle) b2 cis
Exact RGB colors can be specified using the Scheme function
rgb-color
.
\override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2) \set Staff.instrumentName = \markup { \with-color #(x11-color 'navy) "Clarinet" } \override Stem #'color = #(rgb-color 0 0 0) gis8 a \override Stem #'color = #(rgb-color 1 1 1) gis8 a \override Stem #'color = #(rgb-color 0 0 0.5) gis4 a
Notation Reference: List of colors, The tweak command.
Snippets: Editorial annotations.
An X11 color is not necessarily exactly the same shade as a similarly named normal color.
Not all X11 colors are distinguishable in a web browser, i.e.,
a web browser might not display a difference between 'LimeGreen
and 'ForestGreen
. For web use normal colors are recommended
(i.e., #blue
, #green
, #red
).
Notes in a chord cannot be colored with \override
; use
\tweak
instead, see The tweak command.
Objects may be parenthesized by prefixing \parenthesize
to
the music event. When prefixed to a chord, it parenthesizes every
note. Individual notes inside a chord may also be parenthesized.
c2 \parenthesize d c2 \parenthesize <c e g> c2 <c \parenthesize e g>
Non-note objects may be parenthesized as well.
c2-\parenthesize -. d c2 \parenthesize r
Snippets: Editorial annotations.
Internals Reference: Parenthesis_engraver, ParenthesesItem, parentheses-interface.
Parenthesizing a chord prints parentheses around each individual note, instead of a single large parenthesis around the entire chord.
Whenever a note is found, a Stem
object is created
automatically. For whole notes and rests, they are also created but
made invisible.
\stemUp
,
\stemDown
,
\stemNeutral
.
Default direction of stems on the center line of the staff
The default direction of stems on the center line of the staff is set
by the Stem
property neutral-direction
.
\relative c'' { a4 b c b \override Stem #'neutral-direction = #up a4 b c b \override Stem #'neutral-direction = #down a4 b c b }
Notation Reference: Direction and placement.
Snippets: Editorial annotations.
Internals Reference: Stem_engraver, Stem, stem-interface.
This section discusses how to add emphasis to elements in the staff from outside of the staff.
Elements of notation can be marked and named with the help of a square balloon. The primary purpose of this feature is to explain notation.
\new Voice \with { \consists "Balloon_engraver" } { \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" } a8 \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" } r <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2. }
There are two music functions, balloonGrobText
and
balloonText
; the former is used like
\once \override
to attach text to any grob, and the
latter is used like \tweak
, typically within chords, to
attach text to an individual note.
Balloon text normally influences note spacing, but this can be altered:
\new Voice \with { \consists "Balloon_engraver" } { \balloonLengthOff \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" } a8 \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" } r \balloonLengthOn <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2. }
\balloonLengthOn
, \balloonLengthOff
Snippets: Editorial annotations.
Internals Reference: Balloon_engraver, BalloonTextItem, balloon-interface.
Vertical lines can be drawn between staves synchronized with the notes.
The Grid_point_engraver
must be used to create the end
points of the lines, while the Grid_line_span_engraver
must
be used to actually draw the lines. By default this centers grid
lines horizontally below and to the left side of each note head.
Grid lines extend from the middle lines of each staff. The
gridInterval
must specify the duration between the grid
lines.
\layout { \context { \Staff \consists "Grid_point_engraver" gridInterval = #(ly:make-moment 1 4) } \context { \Score \consists "Grid_line_span_engraver" } } \score { \new ChoirStaff << \new Staff \relative c'' { \stemUp c4. d8 e8 f g4 } \new Staff \relative c { \clef bass \stemDown c4 g' f e } >> }
Grid lines: changing their appearance
The appearance of grid lines can be changed by overriding some of their properties.
\layout { \context { \Staff % set up grids \consists "Grid_point_engraver" % set the grid interval to one quarter note gridInterval = #(ly:make-moment 1 4) } } \new Score \with { \consists "Grid_line_span_engraver" % this moves them to the right half a staff space \override NoteColumn #'X-offset = #-0.5 } \new ChoirStaff << \new Staff { \relative c'' { \stemUp c'4. d8 e8 f g4 } } \new Staff { \relative c { % this moves them up one staff space from the default position \override Score.GridLine #'extra-offset = #'(0.0 . 1.0) \stemDown \clef bass \once \override Score.GridLine #'thickness = #5.0 c4 \once \override Score.GridLine #'thickness = #1.0 g' \once \override Score.GridLine #'thickness = #3.0 f \once \override Score.GridLine #'thickness = #5.0 e } } >>
Snippets: Editorial annotations.
Internals Reference: Grid_line_span_engraver, Grid_point_engraver, GridLine, GridPoint, grid-line-interface, grid-point-interface.
Brackets are used in musical analysis to indicate structure in musical pieces. Simple horizontal brackets are supported.
\layout { \context { \Voice \consists "Horizontal_bracket_engraver" } } \relative c'' { c2\startGroup d\stopGroup }
Analysis brackets may be nested.
\layout { \context { \Voice \consists "Horizontal_bracket_engraver" } } \relative c'' { c4\startGroup\startGroup d4\stopGroup e4\startGroup d4\stopGroup\stopGroup }
Snippets: Editorial annotations.
Internals Reference: Horizontal_bracket_engraver, HorizontalBracket, horizontal-bracket-interface, Staff.
This section explains how to include text (with various formatting) in music scores.
Some text elements that are not dealt with here are discussed in other specific sections: Vocal music, Titles and headers.
Note: To write accented and special text (such as characters from other languages), simply insert the characters directly into the LilyPond file. The file must be saved as UTF-8. For more information, see Text encoding. |
This section introduces different ways of adding text to a score.
Simple ‘quoted text’ indications may be added to a score, as demonstrated in the following example. Such indications can be manually placed above or below the staff, using the syntax described in Direction and placement.
d8^"pizz." e f g a4-"scherz." f
This syntax is actually a shorthand; more complex text
formatting may be added to a note by explicitly using a
\markup
block, as described in Formatting text.
d8^\markup { \italic pizz. } e f g a4_\markup { \tiny scherz. \bold molto } f
By default, text indications do not influence the note spacing. However, their widths can be taken into account: in the following example, the first text string does not affect spacing, whereas the second one does.
d8^"pizz." e f g \textLengthOn a4_"scherzando" f
Notation Reference: Formatting text, Direction and placement.
Snippets: Text.
Internals Reference: TextScript.
Checking to make sure that text scripts and lyrics are within the margins is a relatively large computational task. To speed up processing, LilyPond does not perform such calculations by default; to enable it, use
\override Score.PaperColumn #'keep-inside-line = ##t
Some performance indications, e.g., rallentando or accelerando, are written as text and are extended over multiple notes with dotted lines. Such objects, called ‘spanners’, may be created from one note to another using the following syntax:
\override TextSpanner #'bound-details #'left #'text = "rit." b1\startTextSpan e,\stopTextSpan
The string to be printed is set through
object properties. By default it is printed in italic characters,
but different formatting can be obtained using
\markup
blocks, as described in Formatting text.
\override TextSpanner #'bound-details #'left #'text = \markup { \upright "rit." } b1\startTextSpan c e,\stopTextSpan
The line style, as well as the text string, can be defined as an object property. This syntax is described in Line styles.
\textSpannerUp
,
\textSpannerDown
,
\textSpannerNeutral
Notation Reference: Line styles.
Snippets: Text.
Internals Reference: TextSpanner.
Various text elements can be added to a score using the syntax described in Rehearsal marks:
c4 \mark "Allegro" c c c
This syntax makes it possible to put any text on a bar line;
more complex text formatting may be added using a \markup
block, as described in Formatting text. This can be used to print
signs like coda, segno or fermata, by specifying the appropriate
symbol name:
c1 \mark \markup { \musicglyph #"scripts.ufermata" } c1
Such objects are only typeset above the top staff of the score; depending on whether they are specified at the end or the middle of a bar, they can be placed above the bar line or between notes. When specified at the beginning of a score or at a line break, marks will be printed at the beginning of the line (the next line, in case of a line break).
\mark "Allegro" c1 c \mark "assai" \break c c
Printing marks at the end of a line or a score
Marks can be printed at the end of the current line, instead of the beginning of the following line. This is particularly useful when a mark has to be added at the end of a score – when there is no next line.
In such cases, the right end of the mark has to be aligned with the final bar line, as demonstrated on the second line of this example.
\relative c'' { \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible g2 c d,2 a' \mark \default \break \override Score.RehearsalMark #'self-alignment-X = #RIGHT g2 b, c1 \bar "||" \mark "D.C. al Fine" }
Aligning marks with various notation objects
If specified, text marks may be aligned with notation objects other
than bar lines. These objects include ambitus
,
breathing-sign
, clef
, custos
, staff-bar
,
left-edge
, key-cancellation
, key-signature
, and
time-signature
.
In such cases, text marks will be horizontally centered above the object. However this can be changed, as demonstrated on the second line of this example (in a score with multiple staves, this setting should be done for all the staves).
\relative c' { e1 % the RehearsalMark will be centered above the Clef \override Score.RehearsalMark #'break-align-symbols = #'(clef) \key a \major \clef treble \mark "↓" e % the RehearsalMark will be centered above the TimeSignature \override Score.RehearsalMark #'break-align-symbols = #'(time-signature) \key a \major \clef treble \time 3/4 \mark "↓" e2. % the RehearsalMark will be centered above the KeySignature \override Score.RehearsalMark #'break-align-symbols = #'(key-signature) \key a \major \clef treble \time 4/4 \mark "↓" e1 \break e % the RehearsalMark will be aligned with the left edge of the KeySignature \once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT \mark "↓" \key a \major e % the RehearsalMark will be aligned with the right edge of the KeySignature \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT \key a \major \mark "↓" e % the RehearsalMark will be aligned with the left edge of the KeySignature % and then shifted right by 1 unit. \once \override Score.KeySignature #'break-align-anchor = #1 \key a \major \mark "↓" e1 }
Printing marks on every staff
Although text marks are normally only printed above the topmost staff, they may also be printed on every staff.
{ \new Score \with { \remove "Mark_engraver" } << \new Staff \with { \consists "Mark_engraver" } { c''1 \mark "molto" c'' } \new Staff \with { \consists "Mark_engraver" } { c'1 \mark "molto" c' } >> }
Notation Reference: Rehearsal marks, Formatting text, The Feta font.
Snippets: Text.
Internals Reference: RehearsalMark.
If a mark is entered at the end of the last bar of the score (where there is no next line), then the mark will not be printed at all.
A \markup
block can exist by itself, outside of any
any \score
block, as a “top-level
expression”. This syntax is described in File structure.
\markup { Tomorrow, and tomorrow, and tomorrow... }
This allows printing text separately from the music, which is particularly useful when the input file contains several music pieces, as described in Multiple scores in a book.
\score { c'1 } \markup { Tomorrow, and tomorrow, and tomorrow... } \score { c'1 }
Using a specific syntax, text blocks can be spread over multiple pages, making possible to print text documents or books (and therefore to use LilyPond as a word processor). This syntax is described in Multi-page markup.
Notation Reference: Formatting text, File structure, Multiple scores in a book, Multi-page markup.
Snippets: Text.
Internals Reference: TextScript.
This section presents basic and advanced text formatting,
using the \markup
mode specific syntax.
A \markup
block is used to typeset text with an extensible
specific syntax called “markup mode”.
The markup syntax is similar to LilyPond's usual syntax: a
\markup
expression is enclosed in curly braces {
... }
. A single word is regarded as a minimal expression,
and therefore does not need to be enclosed with braces.
Unlike simple ‘quoted text’ indications, \markup
blocks
may contain nested expressions or specific commands,
entered using the backslash \
character.
Such commands only affect the first following expression.
e1-\markup intenso a2^\markup { poco \italic più forte } c e1 d2_\markup { \italic "string. assai" } e b1^\markup { \bold { molto \italic agitato } } c
A \markup
block may also contain quoted text strings.
Such strings are treated as minimal text expressions, and
therefore any markup command or special character (such as
\
and #
) will be printed verbatim without affecting
the formatting of the text. This syntax even allows to print
double quotation marks, by preceding them with backslashes
d1^"\italic markup..." d_\markup \italic "... prints \"italic\" letters!" d d
The way markup expressions are defined affects how these expressions will stacked, centered and aligned when using the commands explained in Text alignment.
c1^\markup { \column { a bbbb \line { c d } } } c1^\markup { \center-column { a bbbb c } } c1^\markup { \line { a b c } }
Lists of words that are not enclosed with double quotes
or preceded by a command are not treated as a distinct
expression. In the following example, the first two
\markup
expressions are equivalent:
c1^\markup { \center-column { a bbb c } } c1^\markup { \center-column { a { bbb c } } } c1^\markup { \center-column { a \line { bbb c } } }
Markups can be stored in variables. These variables may be directly attached to notes:
allegro = \markup { \bold \large Allegro } { d''8.^\allegro d'16 d'4 r2 }
An exhaustive list of \markup
-specific commands can be found in
Text markup commands.
This manual: Text markup commands.
Snippets: Text.
Internals Reference: TextScript.
Init files: scm/new-markup.scm.
Syntax errors for markup mode can be confusing.
Basic font switching is supported in markup mode:
{ d1^\markup { \bold { Più mosso } \italic { non troppo \underline Vivo } } r2 r4 r8 d,_\markup { \italic quasi \smallCaps Tromba } f1 d2 r }
The size of the characters can also be altered in different ways:
The following example demonstrates these three methods:
{ f1^\markup { \fontsize #5 Sinfonia } a,_\markup { \tiny espressivo \large e \normalsize intenso } bes^\markup { (con \larger grande \smaller emozione \magnify #0.6 { e sentimento } ) } d c2 r8 c bes a g1 }
Text may be printed as subscript or superscript. By default these are printed in a smaller size, but a normal size can be used as well:
\markup { \column { \line { 1 \super st movement } \line { 1 \normal-size-super st movement \sub { (part two) } } } }
The markup mode provides an easy way to select alternate font families. The default serif font, of roman type, is automatically selected unless specified otherwise: on the last line of the following example, there is no difference between the first and the second word.
\markup { \column { \line { Act \number 1 } \line { \sans { Scene I. } } \line { \typewriter { Verona. An open place. } } \line { Enter \roman Valentine and Proteus. } } }
Some of these font families, used for specific items such as numbers or dynamics, do not provide all characters, as mentioned in New dynamic marks and Manual repeat marks.
When used inside a word, some font-switching or formatting commands may produce an unwanted blank space. This can easily be solved by concatenating the text elements together:
\markup { \column { \line { \concat { 1 \super st } movement } \line { \concat { \dynamic p , } \italic { con dolce espressione } } } }
An exhaustive list of font-switching, font-size and font-families related commands can be found in Font.
Defining custom font sets is also possible, as explained in Fonts.
\teeny
,
\tiny
,
\small
,
\normalsize
,
\large
,
\huge
.
This subsection discusses how to place text in markup mode,
inside a \markup
block. Markup objects can also
be moved as a whole, using the syntax described in
Moving objects.
Markup objects may be aligned in different ways. By default, a text indication is aligned on its left edge: in the following example, there is no difference between the first and the second markup.
a1-\markup { poco } e' a,-\markup { \left-align poco } e' a,-\markup { \center-align { poco } } e' a,-\markup { \right-align poco }
The horizontal alignment may be fine-tuned using a numeric value:
a1-\markup { \halign #-1 poco } e' a,-\markup { \halign #0 poco } e' a,-\markup { \halign #0.5 poco } e' a,-\markup { \halign #2 poco }
Some objects may have alignment procedures of their own, and therefore are not affected by these commands. It is possible to move such markup objects as a whole, as shown for instance in Text marks,
Vertical alignment is a bit more complex. As stated above, markup objects can be moved as a whole; however, it is also possible to move specific elements inside a markup block. In this case, the element to be moved needs to be preceded with an anchor point, that can be another markup element or an invisible object. The following example demonstrates these two possibilities; the last markup in this example has no anchor point, and therefore is not moved.
d2^\markup { Acte I \raise #2 { Scène 1 } } a' g_\markup { \null \lower #4 \bold { Très modéré } } a d,^\markup { \raise #4 \italic { Une forêt. } } a'4 a g2 a
Some commands can affect both the horizontal and vertical alignment of text objects in markup mode. Any object affected by these commands must be preceded with an anchor point:
d2^\markup { Acte I \translate #'(-1 . 2) "Scène 1" } a' g_\markup { \null \general-align #Y #3.2 \bold "Très modéré" } a d,^\markup { \null \translate-scaled #'(-1 . 2) \teeny "Une forêt." } a'4 a g2 a
A markup object may include several lines of text. In the following example, each element or expression is placed on its own line, either left-aligned or centered:
\markup { \column { a "b c" \line { d e f } } \hspace #10 \center-column { a "b c" \line { d e f } } }
Similarly, a list of elements or expressions may be spread to fill the entire horizontal line width (if there is only one element, it will be centered on the page). These expressions can, in turn, include multi-line text or any other markup expression:
\markup { \fill-line { \line { William S. Gilbert } \center-column { \huge \smallCaps "The Mikado" or \smallCaps "The Town of Titipu" } \line { Sir Arthur Sullivan } } } \markup { \fill-line { 1885 } }
Long text indications can also be automatically wrapped accordingly to the given line width. These will be either left-aligned or justified, as shown in the following example.
\markup { \column { \line \smallCaps { La vida breve } \line \bold { Acto I } \wordwrap \italic { (La escena representa el corral de una casa de gitanos en el Albaicín de Granada. Al fondo una puerta por la que se vé el negro interior de una Fragua, iluminado por los rojos resplandores del fuego.) } \hspace #0 \line \bold { Acto II } \override #'(line-width . 50) \justify \italic { (Calle de Granada. Fachada de la casa de Carmela y su hermano Manuel con grandes ventanas abiertas a través de las que se ve el patio donde se celebra una alegre fiesta) } } }
An exhaustive list of text alignment commands can be found in Align.
Various graphic objects may be added to a score, using specific markup commands.
Some markup commands allow to decorate text elements with graphics, as demonstrated in the following example.
\markup \fill-line { \center-column { \circle Jack \box "in the box" \null \line { Erik Satie \hspace #3 \bracket "1866 - 1925" } \null \rounded-box \bold Prelude } }
Some commands may require to increase the padding around the text: this is achieved with some specific commands exhaustively described in Align.
\markup \fill-line { \center-column { \box "Charles Ives (1874 - 1954)" \null \box \pad-markup #2 "THE UNANSWERED QUESTION" \box \pad-x #8 "A Cosmic Landscape" \null } } \markup \column { \line { \hspace #10 \box \pad-to-box #'(-5 . 20) #'(0 . 5) \bold "Largo to Presto" } \pad-around #3 "String quartet keeps very even time, Flute quartet keeps very uneven time." }
Other graphic elements or symbols may be printed without requiring any text. As with any markup expression, such objects can be combined together:
\markup { \combine \draw-circle #4 #0.4 ##f \filled-box #'(-4 . 4) #'(-0.5 . 0.5) #1 \hspace #5 \center-column { \triangle ##t \combine \draw-line #'(0 . 4) \arrow-head #Y #DOWN ##f } }
Advanced graphic features include the ability to include external image files converted to the Encapsulated PostScript format (eps), or to directly embed graphics into the input file, using native PostScript code.
c1^\markup { \combine \epsfile #X #10 #"./context-example.eps" \postscript #" -2 3 translate 2.7 2 scale newpath 2 -1 moveto 4 -2 4 1 1 arct 4 2 3 3 1 arct 0 4 0 3 1 arct 0 0 1 -1 1 arct closepath stroke" } c
An exhaustive list of graphics-specific commands can be found in Graphic.
Notes can be printed in markup mode blah blah:
\note \note-by-number
Accidental symbols can be obtained easily:
\doubleflat \sesquiflat \flat \semiflat \natural \semisharp \sharp \sesquisharp \doublesharp
Some other notation objects blah blah
\beam \finger \dynamic \tied-lyric \markalphabet \markletter
Any musical symbol can be printed
\musicglyph
The markup mode has support for fret diagrams:
\fret-diagram \fret-diagram-terse \fret-diagram-verbose
An entire \score
block can even be nested in a \markup
block. In such a case, the \score
must contain a \layout
block.
\score
\relative { c4 d^\markup { \score { \relative { c4 d e f } \layout { } } } e f }
Snippets: Text.
Whereas \markup
is used to enter a non-breakable block of
text, \markuplines
can be used at top-level to enter lines
of text that can spread over multiple pages:
\markuplines { \justified-lines { A very long text of justified lines. ... } \justified-lines { An other very long paragraph. ... } ... }
\markuplines
accepts a list of markup, that is either the
result of a markup list command, or a list of markups or of markup
lists. The built-in markup list commands are described in
Text markup list commands.
This manual: Text markup list commands, New markup list command definition.
Snippets: Text.
It is also possible to change the default font family for the
entire document. This is done by calling the
make-pango-font-tree
from within the \paper
block.
The function takes names for the font families to use for roman,
sans serif and monospaced text. For example,
\paper { myStaffSize = #20 #(define fonts (make-pango-font-tree "Times New Roman" "Nimbus Sans" "Luxi Mono" (/ myStaffSize 20))) } { c'^\markup { roman: foo \sans bla \typewriter bar } }
By setting the object properties described below, you can select a font from the preconfigured font families. LilyPond has default support for the feta music fonts. Text fonts are selected through Pango/FontConfig. The serif font defaults to New Century Schoolbook, the sans and typewriter to whatever the Pango installation defaults to.
font-encoding
is a symbol that sets layout of the glyphs. This should only be
set to select different types of non-text fonts, e.g.
fetaBraces
for piano staff braces, fetaMusic
the
standard music font, including ancient glyphs, fetaDynamic
for dynamic signs and fetaNumber
for the number font.
font-family
is a symbol indicating the general class of the typeface.
Supported are roman
(Computer Modern), sans
, and
typewriter
.
font-shape
is a symbol indicating the shape of the font. There are typically
several font shapes available for each font family. Choices are
italic
, caps
, and upright
.
font-series
is a symbol indicating the series of the font. There are
typically several font series for each font family and shape.
Choices are medium
and bold
.
Fonts selected in the way sketched above come from a predefined
style sheet. If you want to use a font from outside the style
sheet, then set the font-name
property,
{ \override Staff.TimeSignature #'font-name = #"Charter" \override Staff.TimeSignature #'font-size = #2 \time 3/4 c'1_\markup { \override #'(font-name . "Vera Bold") { This text is in Vera Bold } } }
Any font can be used, as long as it is available to Pango/FontConfig. To get a full list of all available fonts, run the command
lilypond -dshow-available-fonts blabla
(the last argument of the command can be anything, but has to be present).
The size of the font may be set with the font-size
property. The resulting size is taken relative to the
text-font-size
as defined in the \paper
block.
Snippets: Text.
This chapter explains how to create musical notation for specific types of instrument or in specific styles.
Since LilyPond input files are text, there are two issues to consider when working with vocal music:
d
should be interpreted as a one letter syllable,
not the note D.
To address the first issue, the fundamental method is the special mode
opened by \lyricmode
that interprets its contents as text.
This mode is implicit by some abbreviated methods, as we will see.
Aligning of text with melodies can be made automatically, but if you specify the durations of the syllables it can also be made manually. Lyrics aligning and typesetting are prepared with the help of skips, hyphens and extender lines.
All these methods and their combinations lead to a few different ways to define lyrics; we shall begin by examining the simplest method, and gradually increase complexity.
TBC
‘Parlato’ is spoken without pitch but still with rhythm; it is notated by cross note heads. This is demonstrated in Special note heads.
The easiest way to add lyrics to a melody is to append
\addlyrics { the lyrics }
to a melody. Here is an example,
\time 3/4 \relative c' { c2 e4 g2. } \addlyrics { play the game }
More stanzas can be added by adding more
\addlyrics
sections
\time 3/4 \relative c' { c2 e4 g2. } \addlyrics { play the game } \addlyrics { speel het spel } \addlyrics { joue le jeu }
The command \addlyrics
cannot handle polyphony settings. For these
cases you should use \lyricsto
and \lyricmode
, as will be
introduced in Entering lyrics.
Lyrics are entered in a special input mode, which can be introduced
by the keyword \lyricmode
, or by using \addlyrics
or
\lyricsto
. In this mode you can enter lyrics,
with punctuation and accents, and the input d
is not parsed as
a pitch, but rather as a one letter syllable. Syllables are entered
like notes, but with pitches replaced by text. For example,
\lyricmode { Twin-4 kle4 twin- kle litt- le star2 }
There are two main methods to specify the horizontal placement
of the syllables, either by specifying the duration of each syllable
explicitly, like in the example above, or by automatically aligning
the lyrics to a melody or other voice of music, using \addlyrics
or \lyricsto
.
A word or syllable of lyrics begins with an alphabetic character, and ends with any space or digit. The following characters can be any character that is not a digit or white space.
Any character that is not a digit or white space will be regarded as
part of the syllable; one important consequence of this is that a word
can end with }
, which often leads to the following mistake:
\lyricmode { lah- lah}
In this example, the }
is included in the final syllable, so the
opening brace is not balanced and the input file will probably not
compile.
Similarly, a period which follows an alphabetic sequence is included in the resulting string. As a consequence, spaces must be inserted around property commands: do not write
\override Score.LyricText #'font-shape = #'italic
but instead use
\override Score . LyricText #'font-shape = #'italic
In order to assign more than one syllable to a single note, you can
surround them with quotes or use a _
character, to get spaces
between syllables, or use tilde symbol (~
) to get a lyric tie.
\time 3/4 \relative c' { c2 e4 g2 e4 } \addlyrics { gran- de_a- mi- go } \addlyrics { pu- "ro y ho-" nes- to } \addlyrics { pu- ro~y~ho- nes- to }
The lyric tie is implemented with the Unicode character U+203F, so be sure to have a font (Like DejaVuLGC) installed that includes this glyph.
To enter lyrics with characters from non-English languages, or with accented and special characters (such as the heart symbol or slanted quotes), simply insert the characters directly into the input file and save it with UTF-8 encoding. See Text encoding, for more info.
\relative c' { e4 f e d e f e2 } \addlyrics { He said: “Let my peo ple go”. }
To use normal quotes in lyrics, add a backslash before the quotes. For example,
\relative c' { \time 3/4 e4 e4. e8 d4 e d c2. } \addlyrics { "\"I" am so lone- "ly\"" said she }
The full definition of a word start in Lyrics mode is somewhat more complex.
A word in Lyrics mode begins with: an alphabetic character, _
,
?
, !
, :
, '
, the control characters ^A
through ^F
, ^Q
through ^W
, ^Y
, ^^
,
any 8-bit character with ASCII code over 127, or a two-character
combination of a backslash followed by one of `
, '
,
"
, or ^
.
To define variables containing lyrics, the function lyricmode
must be used.
verseOne = \lyricmode { Joy to the world the Lord is come } \score { << \new Voice = "one" \relative c'' { \autoBeamOff \time 2/4 c4 b8. a16 g4. f8 e4 d c2 } \addlyrics { \verseOne } >> }
Internals Reference: LyricText, LyricSpace.
To define variables containing lyrics, the function \lyricmode
must be used. You do not have to enter durations though, if you add
\addlyrics
or \lyricsto
when invoking your variable.
verseOne = \lyricmode { Joy to the world the Lord is come } \score { << \new Voice = "one" \relative c'' { \autoBeamOff \time 2/4 c4 b8. a16 g4. f8 e4 d c2 } \addlyrics { \verseOne } >> }
For different or more complex orderings, the best way is to setup the hierarchy of staves and lyrics first, e.g.,
\new ChoirStaff << \new Voice = "soprano" { music } \new Lyrics = "sopranoLyrics" { s1 } \new Lyrics = "tenorLyrics" { s1 } \new Voice = "tenor" { music } >>
and then combine the appropriate melodies and lyric lines
\context Lyrics = sopranoLyrics \lyricsto "soprano" the lyrics
The final input would resemble
<<\new ChoirStaff << setup the music >> \lyricsto "soprano" etc \lyricsto "alto" etc etc >>
Internals Reference: LyricCombineMusic, Lyrics.
Lyrics are printed by interpreting them in the context called Lyrics.
\new Lyrics \lyricmode ...
There are two main methods to specify the horizontal placement of the syllables:
\addlyrics
or \lyricsto
.
\lyricmode
The lyrics can be aligned under a given melody
automatically. This is achieved by combining the
melody and the lyrics with the \lyricsto
expression
\new Lyrics \lyricsto name ...
This aligns the lyrics to the
notes of the Voice context called name, which must
already exist. Therefore normally the Voice
is specified first, and
then the lyrics are specified with \lyricsto
. The command
\lyricsto
switches to \lyricmode
mode automatically, so the
\lyricmode
keyword may be omitted.
The following example uses different commands for entering lyrics.
<< \new Voice = "one" \relative c'' { \autoBeamOff \time 2/4 c4 b8. a16 g4. f8 e4 d c2 } % not recommended: left aligns syllables \new Lyrics \lyricmode { Joy4 to8. the16 world!4. the8 Lord4 is come.2 } % wrong: durations needed \new Lyrics \lyricmode { Joy to the earth! the Sa -- viour reigns. } %correct \new Lyrics \lyricsto "one" { No more let sins and sor -- rows grow. } >>
The second stanza is not properly aligned because the durations
were not specified. A solution for that would be to use \lyricsto
.
The \addlyrics
command is actually just a convenient way
to write a more complicated LilyPond structure that sets up the
lyrics.
{ MUSIC } \addlyrics { LYRICS }
is the same as
\new Voice = "blah" { music } \new Lyrics \lyricsto "blah" { LYRICS }
Lyrics can also be entered without \addlyrics
or
\lyricsto
. In this case,
syllables are entered like notes – but with pitches replaced by text – and the
duration of each syllable must be entered explicitly. For example:
play2 the4 game2. sink2 or4 swim2.
The alignment to a melody can be specified with the
associatedVoice
property,
\set associatedVoice = #"lala"
The value of the property (here: "lala"
) should be the name of
a Voice context. Without this setting, extender lines
will not be formatted properly.
Here is an example demonstrating manual lyric durations,
<< \new Voice = "melody" { \time 3/4 c2 e4 g2. } \new Lyrics \lyricmode { \set associatedVoice = #"melody" play2 the4 game2. } >>
Internals Reference: Lyrics.
In order to assign more than one syllable to a single note, you can
surround them with quotes or use a _
character, to get spaces
between syllables, or use tilde symbol (~
) to get a lyric
tie1.
\time 3/4 \relative c' { c2 e4 g2 e4 } \addlyrics { gran- de_a- mi- go } \addlyrics { pu- "ro y ho-" nes- to } \addlyrics { pu- ro~y~ho- nes- to }
Internals Reference: LyricCombineMusic.
Sometimes, particularly in Medieval music, several notes are to be sung on one single syllable; such vocalises are called melismas, or melismata.
You can define melismata entirely in the lyrics, by entering _
for every extra note that has to be added to the the melisma.
Additionaly, you can make an extender line to be typeset to indicate the melisma in the score, writing a double underscore next to the first syllable of the melisma. This example shows the three elements that are used for this purpose (all of them surrounded by spaces): double hyphens to separate syllables in a word, underscores to add notes to a melisma, and a double underscore to put an extender line.
{ \set melismaBusyProperties = #'() c d( e) f f( e) e e } \addlyrics { Ky -- _ _ ri __ _ _ _ e }
In this case, you can also have ties and slurs in the melody if you
set melismaBusyProperties
, as is done in the example above.
However, the \lyricsto
command can also
detect melismata automatically: it only puts one
syllable under a tied or slurred group of notes. If you want to force
an unslurred group of notes to be a melisma, insert \melisma
after the first note of the group, and \melismaEnd
after the
last one, e.g.,
<< \new Voice = "lala" { \time 3/4 f4 g8 \melisma f e f \melismaEnd e2 } \new Lyrics \lyricsto "lala" { la di __ daah } >>
In addition, notes are considered a melisma if they are manually beamed, and automatic beaming (see Setting automatic beam behavior) is switched off.
A complete example of a SATB score setup is in section Vocal ensembles.
Melismata are not detected automatically, and extender lines must be inserted by hand.
Making a lyric line run slower than the melody can be achieved by
inserting \skip
s into the lyrics. For every \skip
,
the text will be delayed another note.
For example,
\relative c' { c c g' } \addlyrics { twin -- \skip 4 kle }
In the last syllable of a word, melismata are sometimes indicated with a long horizontal line starting in the melisma syllable, and ending in the next one. Such a line is called an extender line, and it is entered as ‘ __ ’ (note the spaces before and after the two underscore characters).
Note: Melismata are indicated in the score with extender lines, which are entered as one double underscore; but short melismata can also be entered by skipping individual notes, which are entered as single underscore characters; these do not make an extender line to be typeset by default. |
Centered hyphens are entered as ‘ -- ’ between syllables of a same word (note the spaces before and after the two hyphen characters). The hyphen will be centered between the syllables, and its length will be adjusted depending on the space between the syllables.
In tightly engraved music, hyphens can be removed. Whether this
happens can be controlled with the minimum-distance
(minimum
distance between two syllables) and the minimum-length
(threshold below which hyphens are removed).
Internals Reference: LyricExtender, LyricHyphen
TBC
Often, different stanzas of one song are put to one melody in slightly
differing ways. Such variations can still be captured with
\lyricsto
.
You can display alternate (or divisi) lyrics by naming voice contexts and attaching lyrics to those specific contexts.
\score{ << \new Voice = "melody" { \relative c' { c4 << { \voiceOne c8 e } \new Voice = "splitpart" { \voiceTwo c4 } >> \oneVoice c4 c | c } } \new Lyrics \lyricsto "melody" { we shall not o- ver- come } \new Lyrics \lyricsto "splitpart" { will } >> }
You can use this trick to display different lyrics for a repeated section.
\score{ << \new Voice = "melody" \relative c' { c2 e | g e | c1 | \new Voice = "verse" \repeat volta 2 {c4 d e f | g1 | } a2 b | c1} \new Lyrics = "mainlyrics" \lyricsto melody \lyricmode { do mi sol mi do la si do } \context Lyrics = "mainlyrics" \lyricsto verse \lyricmode { do re mi fa sol } \new Lyrics = "repeatlyrics" \lyricsto verse \lyricmode { dodo rere mimi fafa solsol } >> }
In some complex vocal music, it may be desirable to place
lyrics completely independently of notes. Music defined
inside lyricrhythm
disappears into the
Devnull
context, but the rhythms can still be used
to place the lyrics.
voice = { c''2 \tag #'music { c''2 } \tag #'lyricrhythm { c''4. c''8 } d''1 } lyr = \lyricmode { I like my cat! } << \new Staff \keepWithTag #'music \voice \new Devnull="nowhere" \keepWithTag #'lyricrhythm \voice \new Lyrics \lyricsto "nowhere" \lyr \new Staff { c'8 c' c' c' c' c' c' c' c' c' c' c' c' c' c' c' } >>
This method is recommended only if the music in the Devnull
context does not contain melismata. Melismata are defined by the
Voice
context. Connecting lyrics to a Devnull
context
makes the voice/lyrics links to get lost, and so does the info on
melismata. Therefore, if you link lyrics to a Devnull
context,
the implicit melismata get ignored.
TBC
To increase the spacing between lyrics, set the minimum-distance property of LyricSpace.
{ c c c c \override Lyrics.LyricSpace #'minimum-distance = #1.0 c c c c } \addlyrics { longtext longtext longtext longtext longtext longtext longtext longtext }
To make this change for all lyrics in the score, set the property in the layout.
\score { \relative c' { c c c c c c c c } \addlyrics { longtext longtext longtext longtext longtext longtext longtext longtext } \layout { \context { \Lyrics \override LyricSpace #'minimum-distance = #1.0 } } }
Aligning lyrics
Horizontal alignment for lyrics cam be set by overriding the
self-alignment-X
property of the LyricText
object.
#-1
is left, #0
is center and #1
is right;
however, you can use #LEFT
, #CENTER
and #RIGHT
as
well.
\layout { ragged-right = ##f } \relative c'' { c1 c1 c1 } \addlyrics { \once \override LyricText #'self-alignment-X = #LEFT "This is left-aligned" \once \override LyricText #'self-alignment-X = #CENTER "This is centered" \once \override LyricText #'self-alignment-X = #1 "This is right-aligned" }
Checking to make sure that text scripts and lyrics are within the margins is a relatively large computational task. To speed up processing, LilyPond does not perform such calculations by default; to enable it, use
\override Score.PaperColumn #'keep-inside-line = ##t
To make lyrics avoid bar lines as well, use
\layout { \context { \Lyrics \consists "Bar_engraver" \consists "Separating_line_group_engraver" \override BarLine #'transparent = ##t } }
TBC
Stanza numbers can be added by setting stanza
, e.g.,
\new Voice { \time 3/4 g2 e4 a2 f4 g2. } \addlyrics { \set stanza = "1. " Hi, my name is Bert. } \addlyrics { \set stanza = "2. " Oh, ché -- ri, je t'aime }
These numbers are put just before the start of the first syllable.
Stanzas differing in loudness may be indicated by putting a
dynamics mark before each stanza. In LilyPond, everything coming in
front of a stanza goes into the StanzaNumber
object; dynamics marks
are no different. For technical reasons, you have to set the stanza
outside \lyricmode
:
text = { \set stanza = \markup { \dynamic "ff" "1. " } \lyricmode { Big bang } } << \new Voice = "tune" { \time 3/4 g'4 c'2 } \new Lyrics \lyricsto "tune" \text >>
Names of singers can also be added. They are printed at the start of
the line, just like instrument names. They are created by setting
vocalName
. A short version may be entered as shortVocalName
.
\new Voice { \time 3/4 g2 e4 a2 f4 g2. } \addlyrics { \set vocalName = "Bert " Hi, my name is Bert. } \addlyrics { \set vocalName = "Ernie " Oh, ché -- ri, je t'aime }
One possibility is that the text has a melisma in one stanza, but
multiple syllables in another one. One solution is to make the faster
voice ignore the melisma. This is done by setting
ignoreMelismata
in the Lyrics context.
There is one tricky aspect: the setting for ignoreMelismata
must be set one syllable before the non-melismatic syllable
in the text, as shown here,
<< \relative c' \new Voice = "lahlah" { \set Staff.autoBeaming = ##f c4 \slurDotted f8.[( g16]) a4 } \new Lyrics \lyricsto "lahlah" { more slow -- ly } \new Lyrics \lyricsto "lahlah" { \set ignoreMelismata = ##t % applies to "fas" go fas -- ter \unset ignoreMelismata still } >>
The ignoreMelismata
applies to the syllable ‘fas’, so it
should be entered before ‘go’.
More complex variations in text underlay are possible. It is possible
to switch the melody for a line of lyrics during the text. This is
done by setting the associatedVoice
property. In the example
the text for the first stanza is set to a melody called ‘lahlah’,
\new Lyrics \lyricsto "lahlah" { Ju -- ras -- sic Park }
The second stanza initially is set to the lahlah
context, but
for the syllable ‘ran’, it switches to a different melody.
This is achieved with
\set associatedVoice = alternative
Here, alternative
is the name of the Voice
context
containing the triplet.
This command must be one syllable too early, before ‘Ty’ in this case. In other words, changing the associatedVoice happens one step later than expected. This is for technical reasons, and it is not a bug.
\new Lyrics \lyricsto "lahlah" { \set associatedVoice = alternative % applies to "ran" Ty -- ran -- no -- \set associatedVoice = lahlah % applies to "rus" sau -- rus Rex }
The underlay is switched back to the starting situation by assigning
lahlah
to associatedVoice
.
Sometimes it is appropriate to have one stanza set
to the music, and the rest added in verse form at
the end of the piece. This can be accomplished by adding
the extra verses into a \markup
section outside
of the main score block. Notice that there are two
different ways to force linebreaks when using
\markup
.
melody = \relative c' { e d c d | e e e e | d d e d | c1 | } text = \lyricmode { \set stanza = "1." Ma- ry had a lit- tle lamb, its fleece was white as snow. } \score{ << \new Voice = "one" { \melody } \new Lyrics \lyricsto "one" \text >> \layout { } } \markup { \column{ \line{ Verse 2. } \line{ All the children laughed and played } \line{ To see a lamb at school. } } } \markup{ \wordwrap-string #" Verse 3. Mary took it home again, It was against the rule." }
When a piece of music has many verses, they are often printed in multiple columns across the page. An outdented verse number often introduces each verse. The following example shows how to produce such output in LilyPond.
melody = \relative c' { c c c c | d d d d } text = \lyricmode { \set stanza = "1." This is verse one. It has two lines. } \score{ << \new Voice = "one" { \melody } \new Lyrics \lyricsto "one" \text >> \layout { } } \markup { \fill-line { \hspace #0.1 % moves the column off the left margin; % can be removed if space on the page is tight \column { \line { \bold "2." \column { "This is verse two." "It has two lines." } } \hspace #0.1 % adds vertical spacing between verses \line { \bold "3." \column { "This is verse three." "It has two lines." } } } \hspace #0.1 % adds horizontal spacing between columns; % if they are still too close, add more " " pairs % until the result looks good \column { \line { \bold "4." \column { "This is verse four." "It has two lines." } } \hspace #0.1 % adds vertical spacing between verses \line { \bold "5." \column { "This is verse five." "It has two lines." } } } \hspace #0.1 % gives some extra space on the right margin; % can be removed if page space is tight } }
Internals Reference: LyricText, StanzaNumber.
This section discusses several aspects of music notation that are unique to keyboard instruments.
This section discusses notation issues that may arise for most keyboard instruments.
Keyboard instruments are usually notated with Piano staves. These
are two or more normal staves coupled with a brace. The same
notation is also used for other keyed instruments.
Organ music is normally written with two staves inside a
PianoStaff
group and third, normal staff for the pedals.
The staves in keyboard music are largely independent, but sometimes voices can cross between the two staves. This section discusses notation techniques particular to keyboard music.
Several common issues in keyboard music are covered elsewhere:
Learning Manual: Real music example, Other uses for tweaks.
Notation Reference: Grouping staves, Instrument names, Collision resolution, Writing music in parallel, Fingering instructions, List of articulations, Grid lines, Ties, Arpeggio, Tremolo repeats.
Internals Reference: PianoStaff.
Snippets: Keyboards.
Dynamics are not automatically centered, but workarounds do exist. One
option is the ‘piano centered dynamics’ template under
Piano templates; another option is to increase the
staff-padding
of dynamics as discussed in objects
Moving objects.
Voices can be switched between staves manually, using the command
\change Staff = staffname
The string staffname is the name of the staff. It switches
the current voice from its current staff to the staff called
staffname. Typical values for staffname are
"up"
and "down"
, or "RH"
and "LH"
.
Cross-staff notes are beamed automatically:
\new PianoStaff << \new Staff = "up" { <e' c'>8 \change Staff = "down" g8 fis g \change Staff = "up" <g'' c''>8 \change Staff = "down" e8 dis e \change Staff = "up" } \new Staff = "down" { \clef bass % keep staff alive s1 } >>
If the beaming needs to be tweaked, make any changes to the stem directions first. The beam positions are then measured from the center of the staff that is closest to the beam. For a simple example of beam tweaking, see notation Fixing overlapping notation.
Learning Manual: Fixing overlapping notation.
Notation Reference: Stems, Automatic beams.
Snippets: Keyboards.
Internals Reference: Beam, ContextChange.
Voices can be made to switch automatically between the top and the bottom staff. The syntax for this is
\autochange ...music...
This will create two staves inside the current staff group
(usually a PianoStaff
), called "up"
and
"down"
. The lower staff will be in the bass clef by default.
The autochanger switches on the basis of the pitch (middle C is the
turning point), and it looks ahead skipping over rests to switch
in advance.
\new PianoStaff { \autochange { g4 a b c' d'4 r a g } }
A \relative
section that is outside of \autochange
has no effect on the pitches of the music, so if necessary, put
\relative
inside \autochange
.
If additional control is needed over the individual staves, they
can be created manually with the names "up"
and
"down"
. The \autochange
command will then switch
its voice between the existing staves. For example, this is
necessary to place a key signature in the lower staff:
\new PianoStaff << \new Staff = "up" { \new Voice = "melOne" { \key g \major \autochange \relative c' { g8 b a c b d c e d8 r fis, g a2 } } } \new Staff = "down" { \key g \major \clef bass } >>
Notation Reference: Changing staff manually.
Snippets: Keyboards.
Internals Reference: AutoChangeMusic.
The staff switches may not end up in optimal places. For high quality output, staff switches should be specified manually.
Chords will not be split across the staves; they will be assigned to a staff based on the first note named in the chord construct.
Whenever a voice switches to another staff, a line connecting the notes can be printed automatically:
\new PianoStaff << \new Staff = "one" { \showStaffSwitch c1 \change Staff = "two" b2 a } \new Staff = "two" { \clef bass s1*2 } >>
\showStaffSwitch
, \hideStaffSwitch
.
Snippets: Keyboards.
Internals Reference: Note_head_line_engraver, VoiceFollower.
Chords that cross staves may be produced:
\new PianoStaff << \new Staff { \relative c' { f8 e4 d8 d f e4 } } \new Staff { \relative c' { << { \clef bass % stems may overlap the other staff \override Stem #'cross-staff = ##t % extend the stems to reach other other staff \override Stem #'length = #12 % do not print extra flags \override Stem #'flag-style = #'no-flag % prevent beaming as needed a8 g4 f8 f bes\noBeam g4 } \\ { f,2 bes4 c } >> } } >>
Indicating cross-staff chords with arpeggio bracket
An arpeggio bracket can indicate that notes on two different staves are
to be played with the same hand. In order to do this, the
PianoStaff
must be set to accept cross-staff arpeggios and the
arpeggios must be set to the bracket shape in the PianoStaff
context.
(Debussy, Les collines d’Anacapri, m. 65)
\paper { ragged-right = ##t } \new PianoStaff << \set PianoStaff.connectArpeggios = ##t \override PianoStaff.Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket \new Staff { \relative c' { \key b \major \time 6/8 b8-.(\arpeggio fis'-.\> cis-. e-. gis-. b-.)\!\fermata^\laissezVibrer \bar "||" } } \new Staff { \relative c' { \clef bass \key b \major << { <a e cis>2.\arpeggio } \\ { <a, e a,>2. } >> } } >>
Snippets: Keyboards.
Internals Reference: Stem.
This section discusses notation issues that relate most directly to the piano.
Pianos generally have three pedals that alter the way sound is produced: sustain, sostenuto (sos.), and una corda (U.C.). Sustain pedals are also found on vibraphones and celestas.
c4\sustainOn d e g <c, f a>1\sustainOff c4\sostenutoOn e g c, <bes d f>1\sostenutoOff c4\unaCorda d e g <d fis a>1\treCorde
There are three styles of pedal indications: text, bracket, and mixed. The sustain pedal and the una corda pedal use the text style by default while the sostenuto pedal uses mixed by default.
c4\sustainOn g c2\sustainOff \set Staff.pedalSustainStyle = #'mixed c4\sustainOn g c d d\sustainOff\sustainOn g, c2\sustainOff \set Staff.pedalSustainStyle = #'bracket c4\sustainOn g c d d\sustainOff\sustainOn g, c2 \bar "|."
The placement of the pedal commands matches the physical movement of the sustain pedal during piano performance. Pedalling to the final bar line is indicated by omitting the final pedal up command.
Notation Reference: Ties.
Snippets: Keyboards.
Internals Reference: SustainPedal, SustainPedalLineSpanner, SustainEvent, SostenutoPedal, SostenutoPedalLineSpanner, SostenutoEvent, UnaCordaPedal, UnaCordaPedalLineSpanner, UnaCordaEvent, PianoPedalBracket, Piano_pedal_engraver.
This section discusses notation that is unique to the accordion.
Accordions are often built with more than one set of reeds that may be in unison with, an octave above, or an octave below the written pitch. Each accordion maker has different names for the shifts that select the various reed combinations, such as oboe, musette, or bandonium, so a system of symbols has come into use to simplify the performance instructions.
Accordion-discant symbols
Accordion discant-specific symbols are added using \markup
. The
vertical placement of the symbols can be tweaked by changing the
\raise
arguments.
discant = \markup { \musicglyph #"accordion.accDiscant" } dot = \markup { \musicglyph #"accordion.accDot" } % 16 voets register accBasson = ^\markup { \combine \discant \raise #0.5 \dot } % een korig 8 en 16 voets register accBandon = ^\markup { \combine \discant \combine \raise #0.5 \dot \raise #1.5 \dot } accVCello = ^\markup { \combine \discant \combine \raise #0.5 \dot \combine \raise #1.5 \dot \translate #'(1 . 0) \raise #1.5 \dot } % 4-8-16 voets register accHarmon = ^\markup { \combine \discant \combine \raise #0.5 \dot \combine \raise #1.5 \dot \raise #2.5 \dot } accTrombon = ^\markup { \combine \discant \combine \raise #0.5 \dot \combine \raise #1.5 \dot \combine \translate #'(1 . 0) \raise #1.5 \dot \translate #'(-1 . 0) \raise #1.5 \dot } % eenkorig 4 en 16 voets register accOrgan = ^\markup { \combine \discant \combine \raise #0.5 \dot \raise #2.5 \dot } accMaster = ^\markup { \combine \discant \combine \raise #0.5 \dot \combine \raise #1.5 \dot \combine \translate #'(1 . 0) \raise #1.5 \dot \combine \translate #'(-1 . 0) \raise #1.5 \dot \raise #2.5 \dot } accAccord = ^\markup { \combine \discant \combine \raise #1.5 \dot \combine \translate #'(1 . 0) \raise #1.5 \dot \combine \translate #'(-1 . 0) \raise #1.5 \dot \raise #2.5 \dot } accMusette = ^\markup { \combine \discant \combine \raise #1.5 \dot \combine \translate #'(1 . 0) \raise #1.5 \dot \translate #'(-1 . 0) \raise #1.5 \dot } accCeleste = ^\markup { \combine \discant \combine \raise #1.5 \dot \translate #'(-1 . 0) \raise #1.5 \dot } accOboe = ^\markup { \combine \discant \combine \raise #1.5 \dot \raise #2.5 \dot } accClarin = ^\markup { \combine \discant \raise #1.5 \dot } accPiccolo = ^\markup { \combine \discant \raise #2.5 \dot } accViolin = ^\markup { \combine \discant \combine \raise #1.5 \dot \combine \translate #'(1 . 0) \raise #1.5 \dot \raise #2.5 \dot } \relative c'' { c4 d\accBasson e f c4 d\accBandon e f c4 d\accVCello e f c4 d\accHarmon e f c4 d\accTrombon e f c4 d\accOrgan e f c4 d\accMaster e f c4 d\accAccord e f c4 d\accMusette e f c4 d\accCeleste e f c4 d\accOboe e f c4 d\accClarin e f c4 d\accPiccolo e f c4 d\accViolin e f }
Snippets: Keyboards.
This section includes extra information for writing for unfretted string instruments.
TBC
Artificial harmonics are notated with a different note head style. They
are entered by marking the harmonic pitch with \harmonic
.
<c g'\harmonic>4
TBC
Some possibilities: - glissandi - tremolo (for bisbigliando) - natural harmonics - directional arpeggio and non-arpeggio - workaroung for keeping both staves visible in an orchestral score, http://lists.gnu.org/archive/html/lilypond-user/2007-08/msg00386.html and http://lsr.dsi.unimi.it/LSR/Item?u=1&id=312
An LSR snippet could be used to demonstrate the main items; in the case of glissandi, it would be desirable to have a demonstration of different styles.
This section discusses several aspects of music notation that are unique to fretted string instruments.
This section discusses common notation that is unique to fretted string instruments.
Music for fretted string instruments is normally notated on
a single staff, either in traditional music notation or in
tablature. Sometimes the two types are combined, and it is
especially common in popular music to use chord diagrams above
a staff of traditional notation. The guitar and the banjo are
transposing instruments, sounding an octave lower than written.
Scores for these instruments should use the "treble_8"
clef.
Some other elements pertinent to fretted string instruments
are covered elsewhere:
Notation Reference: Fingering instructions, Ties, Collision resolution, Instrument names, Writing music in parallel, Arpeggio, List of articulations, Clef.
The string on which a note should be played may be indicated by
appending \
number to a note inside a chord construct
<>
.
Note: String numbers must be defined inside a chord construct even if there is only a single note. |
\clef "treble_8" <c\5>4 <e\4> <g\3>2 <c,\5 e\4 g\3>1
When fingerings and string indications are used together, their placement is controlled by the order in which the two items appear in the code:
\clef "treble_8" <g\3-0>2 <g-0\3>
Controlling the placement of chord fingerings
The placement of fingering numbers can be controlled precisely.
\relative c' { \set fingeringOrientations = #'(left) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(down) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(right) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(up) <c-1 e-3 a-5>4 \set fingeringOrientations = #'(left down) <c-1 e-3 a-5>2 \set fingeringOrientations = #'(up right down) <c-1 e-3 a-5>2 }
Allowing fingerings to be printed inside the staff
By default, fingering numbers will be printed outside the staff. However, this behavior can be canceled.
\relative c' { <c-1 e-2 g-3 b-5>2 \once \override Fingering #'staff-padding = #'() <c-1 e-2 g-3 b-5>2 }
Notation Reference: Fingering instructions.
Snippets: Fretted strings.
Internals Reference: StringNumber, Fingering.
Tablature notation is used for notating music for plucked string instruments. Pitches are not denoted with note heads, but by numbers indicating on which string and fret a note must be played. LilyPond offers limited support for tablature.
The string number associated with a note is given as a backslash
followed by a number. By default, string 1 is the highest,
and the tuning defaults to the standard guitar tuning (with 6 strings).
The notes are printed as tablature, by using TabStaff
and
TabVoice
contexts
\new TabStaff { a,4\5 c'\2 a\3 e'\1 e\4 c'\2 a\3 e'\1 }
When no string is specified for a note, the note is assigned to
the lowest string that can generate the note with a fret number
greater than or equal to the value of minimumFret
.
The default value for minimumFret
is 0.
\new StaffGroup << \new Staff \relative c { \clef "treble_8" c16 d e f g4 c,16 d e f g4 } \new TabStaff \relative c { c16 d e f g4 \set TabStaff.minimumFret = #5 c,16 d e f g4 } >>
Harmonic indications and slides can be added to tablature notation.
\new TabStaff { \new TabVoice { <c g'\harmonic> d\2\glissando e\2 } }
Stem and beam behavior in tablature
The direction of stems is controlled the same way in tablature as in traditional notation. Beams can be made horizontal, as shown in this example.
\new TabStaff { \relative c { g16 b d g b d g b \stemDown \override Beam #'damping = #+inf.0 g,,16 b d g b d g b } }
Polyphony in tablature
Polyphony is created the same way in a TabStaff
as in a regular
staff.
upper = \relative c' { \time 12/8 \key e \minor \voiceOne r4. r8 e, fis g16 b g e e' b c b a g fis e } lower = \relative c { \key e \minor \voiceTwo r16 e d c b a g4 fis8 e fis g a b c } \score { << \new StaffGroup = "tab with traditional" << \new Staff = "guitar traditional" << \clef "treble_8" \context Voice = "upper" \upper \context Voice = "lower" \lower >> \new TabStaff = "guitar tab" << \context TabVoice = "upper" \upper \context TabVoice = "lower" \lower >> >> >> }
Notation Reference: Stems.
Snippets: Fretted strings.
Internals Reference: TabNoteHead, TabStaff, TabVoice, Beam.
Chords are not handled in a special way, and hence the automatic string selector may easily select the same string for two notes in a chord.
In order to handle \partcombine
, a TabStaff
must use
specially-created voices:
melodia = \partcombine { e4 g g g }{ e4 e e e } << \new TabStaff << \new TabVoice = "one" s1 \new TabVoice = "two" s1 \new TabVoice = "shared" s1 \new TabVoice = "solo" s1 { \melodia } >> >>
Guitar special effects are limited to harmonics and slides.
LilyPond tabulature automatically calculates the fret for
a note based on the string to which the note is assigned.
In order to do this, the tuning of the strings must be
specified. The tuning of the strings is given in the
StringTunings
property.
LilyPond comes with predefined string tunings for banjo, mandolin, guitar and bass guitar. Lilypond automatically sets the correct transposition for predefined tunings. The following example is for bass guitar, which sounds an octave lower than written.
<< \new Staff { \clef "bass_8" \relative c, { c4 d e f } } \new TabStaff { \set TabStaff.stringTunings = #bass-tuning \relative c, { c4 d e f } } >>
The default string tuning is guitar-tuning
, which
is the standard EADGBE tuning. Some other predefined tunings are
guitar-open-g-tuning
, mandolin-tuning
and
banjo-open-g-tuning
. The predefined string tunings
are found in scm/output-lib.scm
.
A string tuning is a Scheme list of string pitches, one for each string, ordered by string number from 1 to N, where string 1 is at the top of the tablature staff and string N is at the bottom. This ordinarily results in ordering from highest pitch to lowest pitch, but some instruments (e.g. ukulele) do not have strings ordered by pitch.
A string pitch in a string tuning list is the pitch difference of the open string from middle C measured in semitones. The string pitch must be an integer. Lilypond calculates the actual pitch of the string by adding the string tuning pitch to the actual pitch for middle C.
LilyPond automatically calculates the number of strings in the
TabStaff
as the number of elements in stringTunings
.
Any desired string tuning can be created. For example, we can
define a string tuning for a four-string instrument with pitches
of a''
, d''
, g'
, and c'
:
mynotes = { c'4 e' g' c'' | e'' g'' b'' c''' } << \new Staff { \clef treble \mynotes } \new TabStaff { \set TabStaff.stringTunings = #'(21 14 7 0) \mynotes } >>
Installed Files: scm/output-lib.scm.
Snippets: Fretted strings.
Internals Reference: Tab_note_heads_engraver.
Fret diagrams can be added to music as a markup to the desired note. The markup contains information about the desired fret diagram. There are three different fret-diagram markup interfaces: standard, terse, and verbose. The three interfaces produce equivalent markups, but have varying amounts of information in the markup string. Details about the markup interfaces are found at Text markup commands.
The standard fret diagram markup string indicates the string number and the fret number for each dot to be placed on the string. In addition, open and unplayed (muted) strings can be indicated.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram #"6-x;5-3;4-2;3-o;2-1;1-o;" < d a d' f'> ^\markup \fret-diagram #"6-x;5-x;4-o;3-2;2-3;1-1;" } >>
Barre indications can be added to the diagram from the fret-diagram markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" < f, c f a c' f'>1 ^\markup \fret-diagram #"c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;" < g, d g b d' g'> ^\markup \fret-diagram #"c:6-1-3;6-3;5-5;4-5;3-4;2-3;1-3;" } >>
The size of the fret diagram, and the number of frets in the diagram can be changed in the fret-diagram markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" < f, c f a c' f'>1 ^\markup \fret-diagram #"s:1.5;c:6-1-1;6-1;5-3;4-3;3-2;2-1;1-1;" < g, b, d g b g'> ^\markup \fret-diagram #"h:6;6-3;5-2;4-o;3-o;2-o;1-3;" } >>
The number of strings in a fret diagram can be changed to accomodate different instruments such as banjos and ukeleles with the fret-diagram markup string.
<< \context ChordNames { \chordmode { a1 } } \context Staff { %% A chord for ukelele a'1 ^\markup \fret-diagram #"w:4;4-2-2;3-1-1;2-o;1-o;" } >>
Fingering indications can be added, and the location of fingering labels can be controlled by the fret-diagram markup string.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram #"f:1;6-x;5-3-3;4-2-2;3-o;2-1-1;1-o;" < d a d' f'> ^\markup \fret-diagram #"f:2;6-x;5-x;4-o;3-2-2;2-3-3;1-1-1;" } >>
Dot radius and dot position can be controlled with the fret-diagram markup string.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram #"d:0.35;6-x;5-3;4-2;3-o;2-1;1-o;" < d a d' f'> ^\markup \fret-diagram #"p:0.2;6-x;5-x;4-o;3-2;2-3;1-1;" } >>
The fret-diagram-terse markup string omits string numbers; the string number is implied by the presence of semicolons. There is one semicolon for each string in the diagram. The first semicolon corresponds to the highest string number and the last semicolon corresponds to the first string. Mute strings, open strings, and fret numbers can be indicated.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram-terse #"x;3;2;o;1;o;" < d a d' f'> ^\markup \fret-diagram-terse #"x;x;o;2;3;1;" } >>
Barre indicators can be included in the fret-diagram-terse markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" < f, c f a c' f'>1 ^\markup \fret-diagram-terse #"1-(;3;3;2;1;1-);" < g, d g b d' g'> ^\markup \fret-diagram-terse #"3-(;5;5;4;3;3-);" } >>
Fingering indications can be included in the fret-diagram-terse markup string.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \override Voice.TextScript #'fret-diagram-details #'finger-code = #'below-string \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" < d a d' f'> ^\markup \fret-diagram-terse #"x;x;o;2-2;3-3;1-1;" } >>
Other fret diagram properties must be adjusted using \override
when using
the fret-diagram-terse markup.
The fret-diagram-verbose markup string is in the format of a Scheme list. Each element of the list indicates an item to be placed on the fret diagram.
<< \context ChordNames { \chordmode { c1 d:m } } \context Staff { \clef "treble_8" < c e g c' e' > 1 ^\markup \fret-diagram-verbose #'( (mute 6) (place-fret 5 3) (place-fret 4 2) (open 3) (place-fret 2 1) (open 1) ) < d a d' f'> ^\markup \fret-diagram-verbose #'( (mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 1) ) } >>
Fingering indications and barres can be included in a fret-diagram-verbose markup string.
<< \context ChordNames { \chordmode { f1 g } } \context Staff { \clef "treble_8" \override Voice.TextScript #'fret-diagram-details #'finger-code = #'below-string < f, c f a c' f'>1 ^\markup \fret-diagram-verbose #'( (place-fret 6 1) (place-fret 5 3) (place-fret 4 3) (place-fret 3 2) (place-fret 2 1) (place-fret 1 1) (barre 6 1 1) ) < g, b, d g b g'> ^\markup \fret-diagram-verbose #'( (place-fret 6 3 2) (place-fret 5 2 1) (open 4) (open 3) (open 2) (place-fret 1 3 3) ) } >>
All other fret diagram properties must be adjusted using \override
when using the fret-diagram-verbose markup.
The graphical layout of a fret diagram can be customized according to
user preference through the properties of the fret-diagram-interface
.
Details are found at fret-diagram-interface. For a fret diagram
markup , the interface properties belong to Voice.TextScript
.
Customizing markup fret diagrams
Fret diagram properties can be set through
fret-diagram-details
. For markup fret diagrams, overrides
can be applied to the Voice.TextScript
object or directly
to the markup.
<< \chords { c1 c c d } \new Voice = "mel" { \textLengthOn % Set global properties of fret diagram \override Voice.TextScript #'size = #'1.2 \override Voice.TextScript #'fret-diagram-details #'finger-code = #'in-dot \override Voice.TextScript #'fret-diagram-details #'dot-color = #'white %% C major for guitar, no barre, using defaults % terse style c'1^\markup { \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" } %% C major for guitar, barred on third fret % verbose style % size 1.0 % roman fret label, finger labels below string, straight barre c'1^\markup { % standard size \override #'(size . 1.0) { \override #'(fret-diagram-details . ( (number-type . roman-lower) (finger-code . in-dot) (barre-type . straight))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } } %% C major for guitar, barred on third fret % verbose style % landscape orientation, arabic numbers, M for mute string % no barre, fret label down or left, small mute label font c'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (number-type . arabic) (label-dir . -1) (mute-string . "M") (orientation . landscape) (barre-type . none) (xo-font-magnification . 0.4) (xo-padding . 0.3))) { \fret-diagram-verbose #'((mute 6) (place-fret 5 3 1) (place-fret 4 5 2) (place-fret 3 5 3) (place-fret 2 5 4) (place-fret 1 3 1) (barre 5 1 3)) } } %% simple D chord % terse style % larger dots, centered dots, fewer frets % label below string d'1^\markup { \override #'(fret-diagram-details . ( (finger-code . below-string) (dot-radius . 0.35) (dot-position . 0.5) (fret-count . 3))) { \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;" } } } >>
Notation Reference: Text markup commands.
Snippets: Fretted strings.
Internals Reference: fret-diagram-interface.
Fret diagrams can be displayed using the FretBoards
context. By
default, the FretBoards
context will display fret diagrams that
are stored in a lookup table:
\include "predefined-guitar-fretboards.ly" \context FretBoards { \chordmode { c1 d } }
The default predefined fret diagrams are contained in the file
predefined-guitar-fretboards.ly
. Fret diagrams are
stored based on the pitches of a chord and the value of
stringTunings
that is currently in use.
predefined-guitar-fretboards.ly
contains predefined
fret diagrams only for guitar-tuning
. Predefined fret
diagrams can be added for other instruments or other tunings
by following the examples found in
predefined-guitar-fretboards.ly
.
Chord pitches can be entered either as simultaneous music or using chord mode (see Chord mode overview).
\include "predefined-guitar-fretboards.ly" \context FretBoards { \chordmode {c1} <c' e' g'>1 }
It is common that both chord names and fret diagrams are displayed together.
This is achieved by putting a ChordNames
context in parallel with
a FretBoards
context and giving both contexts the same music.
\include "predefined-guitar-fretboards.ly" mychords = \chordmode{ c1 f g } << \context ChordNames { \mychords } \context FretBoards { \mychords } >>
Predefined fret diagrams are transposable, as long as a diagram for the transposed chord is stored in the fret diagram table.
\include "predefined-guitar-fretboards.ly" mychords = \chordmode{ c1 f g } mychordlist = { \mychords \transpose c e { \mychords} } << \context ChordNames { \mychordlist } \context FretBoards { \mychordlist } >>
The predefined fret diagram table contains seven chords (major, minor, augmented, diminished, dominant seventh, major seventh, minor seventh) for each of 17 keys. A complete list of the predefined fret diagrams is shown in Predefined fretboard diagrams. If there is no entry in the table for a chord, the FretBoards engraver will calculate a fret-diagram using the automatic fret diagram functionality described in Automatic fret diagrams.
\include "predefined-guitar-fretboards.ly" mychords = \chordmode{ c1 c:9 } << \context ChordNames { \mychords } \context FretBoards { \mychords } >>
Fret diagrams can be added to the fret diagram table. To add a diagram, you must specify the chord for the diagram, the tuning to be used, and the fret-diagram-terse definition string for the diagram.
\include "predefined-guitar-fretboards.ly" \storePredefinedDiagram \chordmode {c:9} #guitar-tuning #"x;3-2;2-1;3-3;3-4;x;" mychords = \chordmode{ c1 c:9 } << \context ChordNames { \mychords } \context FretBoards { \mychords } >>
Different fret diagrams for the same chord name can be stored using different octaves of pitches.
\include "predefined-guitar-fretboards.ly" \storePredefinedDiagram \chordmode {c'} #guitar-tuning #(offset-fret 2 (chord-shape 'bes)) mychords = \chordmode{ c1 c' } << \context ChordNames { \mychords } \context FretBoards { \mychords } >>
In addition to fret diagrams, LilyPond stores an internal list of chord shapes. The chord shapes are fret diagrams that can be shifted along the neck to different posistions to provide different chords. Chord shapes can be added to the internal list and then used to define predefined fret diagrams.
\include "predefined-guitar-fretboards.ly" % add a new chord shape \addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;" % add some new chords based on the power chord shape \storePredefinedDiagram \chordmode {f'} #guitar-tuning #(chord-shape 'powerf) \storePredefinedDiagram \chordmode {g'} #guitar-tuning #(offset-fret 2 (chord-shape 'powerf)) mychords = \chordmode{ f1 f' g g' } << \context ChordNames { \mychords } \context FretBoards { \mychords } >>
The graphical layout of a fret diagram can be customized according to
user preference through the properties of the fret-diagram-interface
.
Details are found at fret-diagram-interface. For a
predefined fret diagram, the interface properties belong to
FretBoards.FretBoard
.
Customizing fretboard fret diagrams
Fret diagram properties can be set through
fret-diagram-details
. For FretBoard fret diagrams,
overrides are applied to the FretBoards.FretBoard
object.
\include "predefined-guitar-fretboards.ly" \storePredefinedDiagram \chordmode { c' } #guitar-tuning #"x;1-1-(;3-2;3-3;3-4;1-1-);" << \context ChordNames { \chordmode { c1 c c d } } \context FretBoards { % Set global properties of fret diagram \override FretBoards.FretBoard #'size = #'1.2 \override FretBoards.FretBoard #'fret-diagram-details #'finger-code = #'in-dot \override FretBoards.FretBoard #'fret-diagram-details #'dot-color = #'white \chordmode { c \once \override FretBoards.FretBoard #'size = #'1.0 \once \override FretBoards.FretBoard #'fret-diagram-details #'barre-type = #'straight \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-color = #'black \once \override FretBoards.FretBoard #'fret-diagram-details #'finger-code = #'below-string c' \once \override FretBoards.FretBoard #'fret-diagram-details #'barre-type = #'none \once \override FretBoards.FretBoard #'fret-diagram-details #'number-type = #'arabic \once \override FretBoards.FretBoard #'fret-diagram-details #'orientation = #'landscape \once \override FretBoards.FretBoard #'fret-diagram-details #'mute-string = #"M" \once \override FretBoards.FretBoard #'fret-diagram-details #'label-dir = #-1 \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-color = #'black c' \once \override FretBoards.FretBoard #'fret-diagram-details #'finger-code = #'below-string \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-radius = #0.35 \once \override FretBoards.FretBoard #'fret-diagram-details #'dot-position = #0.5 \once \override FretBoards.FretBoard #'fret-diagram-details #'fret-count = #3 d } } \context Voice { c'1 c' c' d' } >>
Notation Reference: Custom tablatures, Automatic fret diagrams, Chord mode overview, Predefined fretboard diagrams.
Installed Files: ly/predefined-guitar-fretboards.ly.
Snippets: Fretted strings.
Internals Reference: fret-diagram-interface.
Fret diagrams can be automatically created from entered notes using the
FretBoards
context. If no predefined diagram is available for
the entered notes in the active stringTunings
, this context
calculates strings and frets that can be used to play the notes.
<< \context ChordNames { \chordmode { f1 g } } \context FretBoards { < f, c f a c' f'>1 < g,\6 b, d g b g'> } \context Staff { \clef "treble_8" < f, c f a c' f'>1 < g, b, d g b' g'> } >>
As no predefined diagrams are loaded by default, automatic calculation of fret diagrams is the default behavior. Once default diagrams are loaded, automatic calculation can be enabled and disabled with predefined commands:
\storePredefinedDiagram <c e g c' e'> #guitar-tuning #"x;3-1-(;5-2;5-3;5-4;3-1-1);" << \context ChordNames { \chordmode { c1 c c } } \context FretBoards { <c e g c' e'>1 \predefinedFretboardsOff <c e g c' e'> \predefinedFretboardsOn <c e g c' e'> } \context Staff { \clef "treble_8" <c e g c' e'>1 <c e g c' e'> <c e g c' e'> } >>
Sometimes the fretboard calculator will be unable to find
an accceptable diagram. This can often be remedied by
manually assigning a note to a string. In many cases, only one
note need be manually placed on a string; the rest of
the notes will then be placed appropriately by the FretBoards
context.
<< \context ChordNames { \chordmode { c1 c } } \context FretBoards { < c g c' e' g'> 1 < c g\4 c' e' g'> 1 } \context Staff { \clef "treble_8" < c g c' e' g'> 1 < c g c' e' g'> 1 } >>
Fingerings can be added to FretBoard fret diagrams.
<< \context ChordNames { \chordmode { c1 d:m } } \context FretBoards { < c-3 e-2 g c'-1 e' > 1 < d a-2 d'-3 f'-1> } \context Staff { \clef "treble_8" < c e g c' e' > 1 < d a d' f'> } >>
The minimum fret to be used in calculating strings and frets for
the FretBoard context can be set with the minimumFret
property.
<< \context ChordNames { \chordmode { d1:m d:m } } \context FretBoards { < d a d' f'> \set FretBoards.minimumFret = #5 < d a d' f'> } \context Staff { \clef "treble_8" < d a d' f'> < d a d' f'> } >>
The strings and frets for the FretBoards
context depend
on the stringTunings
property, which has the same meaning
as in the TabStaff context. See Custom tablatures for
information on the stringTunings
property.
The graphical layout of a fret diagram can be customized according to
user preference through the properties of the fret-diagram-interface
.
Details are found at fret-diagram-interface. For a
FretBoards
fret diagram, the interface properties belong to
FretBoards.FretBoard
.
\predefinedFretboardsOff
,
\predefinedFretboardsOn
.
Notation Reference: Custom tablatures.
Snippets: Fretted strings.
Internals Reference: fret-diagram-interface.
Right-hand fingerings p-i-m-a must be entered within a
chord construct <>
for them to be printed in the score,
even when applied to a single note.
Note: There must be a hyphen after the note and a space
before the closing > .
|
\clef "treble_8" <c-\rightHandFinger #1 >4 <e-\rightHandFinger #2 > <g-\rightHandFinger #3 > <c-\rightHandFinger #4 > <c,-\rightHandFinger #1 e-\rightHandFinger #2 g-\rightHandFinger #3 c-\rightHandFinger #4 >1
For convenience, you can abbreviate \rightHandFinger
to something
short, for example RH
,
#(define RH rightHandFinger)
Placement of right-hand fingerings
It is possible to exercise greater control over the placement of right-hand fingerings by setting a specific property, as demonstrated in the following example.
#(define RH rightHandFinger) \relative c { \clef "treble_8" \set strokeFingerOrientations = #'(up down) <c-\RH #1 e-\RH #2 g-\RH #3 c-\RH #4 >4 \set strokeFingerOrientations = #'(up right down) <c-\RH #1 e-\RH #2 g-\RH #3 c-\RH #4 >4 \set strokeFingerOrientations = #'(left) <c-\RH #1 e-\RH #2 g-\RH #3 c-\RH #4 >2 }
Fingerings, string indications, and right-hand fingerings
This example combines left-hand fingering, string indications, and right-hand fingering.
#(define RH rightHandFinger) \relative c { \clef "treble_8" <c-3\5-\RH #1 >4 <e-2\4-\RH #2 >4 <g-0\3-\RH #3 >4 <c-1\2-\RH #4 >4 }
Snippets: Fretted strings.
Internals Reference: StrokeFinger.
Most of the notational issues associated with guitar music are covered sufficiently in the general fretted strings section, but there are a few more worth covering here. Occasionally users want to create songbook-type documents having only lyrics with chord indications above them. Since Lilypond is a music typesetter, it is not recommended for documents that have no music notation in them. A better alternative is a word processor, text editor, or, for experienced users, a typesetter like GuitarTeX.
This example demonstrates how to include guitar position and barring indications.
\clef "treble_8" b16 d g b e \textSpannerDown \override TextSpanner #'bound-details #'left #'text = #"XII " g16\startTextSpan b16 e g e b g\stopTextSpan e16 b g d
Notation Reference: Text spanners.
Snippets: Fretted strings, Expressive marks.
Special note heads can be used to indicate dampened notes or harmonics. Harmonics are normally further explained with a text markup.
\relative c' { \clef "treble_8" \override Staff.NoteHead #'style = #'cross g8 a b c b4 \override Staff.NoteHead #'style = #'harmonic-mixed d^\markup { \italic { \fontsize #-2 { "harm. 12" }}} <g b>1 }
Snippets: Fretted strings.
Notation Reference: Special note heads, Note head styles.
LilyPond has basic support for the five-string banjo. When making tablatures for five-string banjo, use the banjo tablature format function to get correct fret numbers for the fifth string:
\new TabStaff << \set TabStaff.tablatureFormat = #fret-number-tablature-format-banjo \set TabStaff.stringTunings = #banjo-open-g-tuning { \stemDown g8 d' g'\5 a b g e d' | g4 d''8\5 b' a'\2 g'\5 e'\2 d' | g4 } >>
A number of common tunings for banjo are predefined in LilyPond:
banjo-c-tuning
(gCGBD), banjo-modal-tuning
(gDGCD),
banjo-open-d-tuning
(aDF#AD) and banjo-open-dm-tuning
(aDFAD).
These tunings may be converted to four-string banjo tunings using the
four-string-banjo
function:
\set TabStaff.stringTunings = #(four-string-banjo banjo-c-tuning)
Snippets: Fretted strings.
The file scm/output-lib.scm contains predefined banjo tunings.
Rhythmic music is primarily used for percussion and drum notation, but it can also be used to show the rhythms of melodies.
TODO add more.
Notation Reference: Showing melody rhythms, Instantiating new staves. Percussion in MIDI.
Snippets: Percussion.
Percussion notes may be entered in \drummode
mode, which is
similar to the standard mode for entering notes. The simplest way
to enter percussion notes is to use the \drums
command,
which creates the correct context and entry mode for percussion:
\drums { hihat4 hh bassdrum bd }
This is shorthand for:
\new DrumStaff { \drummode { hihat4 hh bassdrum bd } }
Each piece of percussion has a full name and an abbreviated name, and both can be used in input files. The full list of percussion note names may be found in Percussion notes.
Note that the normal notation of pitches (such as cis4
) in
a DrumStaff
context will cause an error message.
Percussion clefs are added automatically to a DrumStaff
contex, but other clefs may also be used.
There are a few issues concerning MIDI support for percussion instruments; for details please see Percussion in MIDI.
Notation Reference: Percussion in MIDI, Percussion notes.
File: ly/drumpitch-init.ly
Snippets: Percussion.
Drum rolls are indicated with three slashes across the stem. For
quarter notes or longer the three slashes are shown explicitly,
eighth notes are shown with two slashes (the beam being the
third), and drum rolls shorter than eighths have one stem slash to
supplement the beams. This is achieved with the tremolo notation,
:32
, as described in Tremolo repeats. Here is an
example of some snare rolls:
\drums { \time 2/4 sn16 sn8 sn16 sn8 sn8:32 ~ sn8 sn8 sn4:32 ~ sn4 sn8 sn16 sn16 sn4 r4 }
Sticking can be indicated by placing ^"R"
or ^"L"
after the note. The staff-padding
property may be
overridden to achieve a pleasing baseline.
\drums { \repeat unfold 2 { sn16 ^"L" sn^"R" sn^"L" sn^"L" sn^"R" sn^"L" sn^"R" sn^"R" } }
Snippets: Percussion.
Certain pitched percussion instruments (e.g. xylophone, vibraphone, and timpani) are written using with normal staffs. This is covered in other sections of the manual.
Notation Reference: Percussion in MIDI.
Snippets: Percussion.
A percussion part for more than one instrument typically uses a
multiline staff where each position in the staff refers to one
piece of percussion. To typeset the music, the notes must be
interpreted in DrumStaff
and DrumVoice
context.
up = \drummode { crashcymbal4 hihat8 halfopenhihat hh hh hh openhihat } down = \drummode { bassdrum4 snare8 bd r bd sn4 } \new DrumStaff << \new DrumVoice { \voiceOne \up } \new DrumVoice { \voiceTwo \down } >>
The above example shows verbose polyphonic notation. The short polyphonic notation, described in I'm hearing Voices, can also be used if the voices are instantiated by hand first. For example,
\new DrumStaff << \new DrumVoice = "1" { s1*2 } \new DrumVoice = "2" { s1*2 } \drummode { bd4 sn4 bd4 sn4 << { \repeat unfold 16 hh16 } \\ { bd4 sn4 bd4 sn4 } >> } >>
There are also other layout possibilities. To use these, set the
property drumStyleTable
in context DrumVoice
. The
following variables have been predefined:
drums-style
The drum scheme supports six different toms. When there are fewer
toms, simply select the toms that produce the desired result. For
example, to get toms on the three middle lines you use
tommh
, tomml
, and tomfh
.
timbales-style
congas-style
bongos-style
percussion-style
If you do not like any of the predefined lists you can define your own list at the top of your file.
#(define mydrums '( (bassdrum default #f -1) (snare default #f 0) (hihat cross #f 1) (pedalhihat xcircle "stopped" 2) (lowtom diamond #f 3))) up = \drummode { hh8 hh hh hh hhp4 hhp } down = \drummode { bd4 sn bd toml8 toml } \new DrumStaff << \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) \new DrumVoice { \voiceOne \up } \new DrumVoice { \voiceTwo \down } >>
FIXME: MOVE ALL THESE TO LSR! -gp
Here are some examples:
Two Woodblocks, entered with wbh (high woodblock) and wbl (low woodblock)
#(define mydrums '( (hiwoodblock default #t 3) (lowoodblock default #t -2))) %% These lines define the position of the woodblocks in the stave, if You like, You can change it % or You can use special note heads for the woodblocks. woodstaff = { \override Staff.StaffSymbol #'line-positions = #'(-2 3) % this defines a staff with only two lines. It also defines the positions of the two lines \override Staff.BarLine #'bar-size = #3 } %% this is neccessary. If not entered, the barline wuld be too short! \new DrumStaff { \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) %% with this You load Your new drum style table \woodstaff \drummode { \time 2/4 wbl8 wbl16 wbl wbh 8 -> wbl | wbl 8 wbl16 wbh ~ -> wbh wbl 16 r8 | } }
Note that in this special case the length of the barline must
altered with \override Staff.BarLine #'bar-size #number
.
Otherwise it would be too short. And You have also to define the
positions of the to stafflines. For more information about these
delicate things have a look at Staff symbol.
A tambourine, entered with "tamb":
% tambourine-music is entered with "tamb" tambustaff = { \override Staff.StaffSymbol #'line-positions = #'( 0 ) \override Staff.BarLine #'bar-size = #3 \set DrumStaff.instrumentName="Tambourine"} \new DrumStaff { \tambustaff % broken % \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) \drummode { \time 6/8 \repeat "unfold" 2 { tamb8. tamb16 tamb8 tamb tamb tamb | } tamb4. tamb8 tamb tamb | tamb2.*5/6 \startTrillSpan s8 \stopTrillSpan | %% the trick with the scaled duration and the shorter rest is neccessary for the correct ending of the trill-span! } }
Music for Tam-Tam (entered with "tt"):
#(define mydrums '( (tamtam default #t 0) ) ) tamtamstaff = { \override Staff.StaffSymbol #'line-positions = #'( 0 ) \override Staff.BarLine #'bar-size = #3 \set DrumStaff.instrumentName="Tamtam"} \new DrumStaff { \tamtamstaff \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) \drummode { tt 1 \pp \laissezVibrer } }
Two different bells, entered with "cb" (cowbell) and "rb" (ridebell)"
%% bells are enterd with: % "cb" (cowbell) and "rb" (ridebell)" #(define mydrums '( (ridebell default #t 3 ) (cowbell default #t -2))) bellstaff = { \override DrumStaff.StaffSymbol #'line-positions = #'(-2 3) \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) \override Staff.BarLine #'bar-size = #3 \set DrumStaff.instrumentName="Different Bells"} \new DrumStaff { \bellstaff \drummode { \time 2/4 \repeat "unfold" 2 { rb 8 rb cb cb16 rb ~ -> | rb16 rb 8 rb 16 cb 8 cb | } } }
Here an short example by maestro Stravinsky (from "L'hostire du Soldat")
#(define mydrums '( (bassdrum default #t 4 ) (snare default #t -4 ) (tambourine default #t 0) ) ) global = { \time 3/8 s 4. \time 2/4 s 2 *2 \time 3/8 s 4. \time 2/4 s 2 } drumsA = { \context DrumVoice << { \global } {\drummode { \autoBeamOff \stemDown sn 8 \stemUp tamb s8 | sn4 \stemDown sn4 | \stemUp tamb 8 \stemDown sn8 \stemUp sn16 \stemDown sn \stemUp sn8 | \stemDown sn 8 \stemUp tamb s8 | \stemUp sn4 s8 \stemUp tamb | } } >> } drumsB = { \drummode { s 4 bd 8 s 2*2 s 4 bd8 s 4 bd8 s 8 } } \layout { indent = #40 } \score { \new StaffGroup << \new DrumStaff { \set DrumStaff.instrumentName= \markup { \column { "Tambourine" "et" "caisse claire s. timbre" } } \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) \drumsA } \new DrumStaff { \set DrumStaff.instrumentName= "Grosse Caisse" \set DrumStaff.drumStyleTable = #(alist->hash-table mydrums) \drumsB } >> }
Snippets: Percussion.
Internals Reference: DrumStaff, DrumVoice.
Ghost notes for drums and percussion may be created using the
\parenthesize
command detailed in Parentheses.
However, the default \drummode
does not include the
Parenthesis_engraver
plugin which allows this.
\new DrumStaff \with { \consists "Parenthesis_engraver" } << \context DrumVoice = "1" { s1 *2 } \context DrumVoice = "2" { s1 *2 } \drummode { << { hh8[ hh] <hh sn> hh16 < \parenthesize sn > hh < \parenthesize sn > hh8 <hh sn> hh } \\ { bd4 r4 bd8 bd r8 bd } >> } >>
Also note that you must add chords (< >
brackets)
around each \parenthesize
statement.
Snippets: Percussion.
This section includes some elements of music notation that arise when writing for winds.
This section discusses some issues common to most wind instruments.
Many notation issues for wind instruments pertain to breathing and tonguing:
There are also other aspects of musical notation that can apply to wind instruments:
cross
style
of Special note heads.
flageolet
articulation. See List of articulations.
stopped
and open
articulations. See Articulations and ornamentations and List of articulations.
stopped
articulation.
See Articulations and ornamentations.
Changing \flageolet mark size
To make the \flageolet
circle smaller use the following Scheme
function.
smallFlageolet = #(let ((m (make-music 'ArticulationEvent 'articulation-type "flageolet"))) (set! (ly:music-property m 'tweaks) (acons 'font-size -3 (ly:music-property m 'tweaks))) m) \layout { ragged-right = ##f } \relative c'' { d4^\flageolet_\markup { default size } d_\flageolet c4^\smallFlageolet_\markup { smaller } c_\smallFlageolet }
Notation Reference: Breath marks, Slurs, Articulations and ornamentations, List of articulations, Tremolo repeats, Instrument transpositions, Glissando, Grace notes, Falls and doits, Special note heads,
Snippets: Winds
All wind instruments other than the trombone require the use of several fingers to produce each pitch.
TBC
This section includes extra information for writing for bagpipes.
LilyPond contains special definitions for music for the Scottish highland bagpipe; to use them, add
\include "bagpipe.ly"
at the top of your input file. This lets you add the special grace notes
common to bagpipe music with short commands. For example, you could
write \taor
instead of
\grace { \small G32[ d G e] }
bagpipe.ly
also contains pitch definitions for the bagpipe
notes in the appropriate octaves, so you do not need to worry about
\relative
or \transpose
.
\include "bagpipe.ly" { \grg G4 \grg a \grg b \grg c \grg d \grg e \grg f \grA g A }
Bagpipe music nominally uses the key of D Major (even though that
isn't really true). However, since that is the only key that can be used,
the key signature is normally not written out. To set this up correctly,
always start your music with \hideKeySignature
. If you for some
reason want to show the key signature, you can use \showKeySignature
instead.
Some modern music use cross fingering on c and f to flatten those notes.
This can be indicated by cflat
or fflat
. Similarly, the
piobaireachd high g can be written gflat
when it occurs in light
music.
This is what the well known tune Amazing Grace looks like in bagpipe notation.
\include "bagpipe.ly" \layout { indent = 0.0\cm \context { \Score \remove "Bar_number_engraver" } } \header { title = "Amazing Grace" meter = "Hymn" arranger = "Trad. arr." } { \hideKeySignature \time 3/4 \grg \partial 4 a8. d16 \slurd d2 \grg f8[ e32 d16.] \grg f2 \grg f8 e \thrwd d2 \grg b4 \grG a2 \grg a8. d16 \slurd d2 \grg f8[ e32 d16.] \grg f2 \grg e8. f16 \dblA A2 \grg A4 \grg A2 f8. A16 \grg A2 \hdblf f8[ e32 d16.] \grg f2 \grg f8 e \thrwd d2 \grg b4 \grG a2 \grg a8. d16 \slurd d2 \grg f8[ e32 d16.] \grg f2 e4 \thrwd d2. \slurd d2 \bar "|." }
Chords can be entered either as normal notes or in chord mode and displayed using a variety of traditional European chord naming conventions. Chord names and figured bass notation can also be displayed.
Chord mode is used to enter chords using an indicator of the chord structure, rather than the chord pitches.
Chords can be entered as simultaneous music, as discussed in Chorded notes.
Chords can also be entered in “chord mode”, which is an input mode that focuses on the structures of chords in traditional European music, rather than on specific pitches. This is convenient for those who are familiar with using chord names to describe chords. More information on different input modes can be found at Input modes.
\chordmode { c1 g a g c }
Chords entered using chord mode are music elements, and can be transposed just like chords entered using simultaneous music.
Chord mode and note mode can be mixed in sequential music:
<c e g>2 <g b d> \chordmode { c2 f } <c e g>2 <g' b d> \chordmode { f2 g }
Music Glossary: chord.
Notation Reference: Chorded notes, Input modes.
Snippets: Chords
When chord mode and note mode are mixed in sequential music, and
chord mode comes first, the note mode will create a new Staff
context.
\chordmode { c2 f } <c e g>2 <g' b d>
To avoid this behavior, explicitly create the Staff
context:
\new Staff { \chordmode { c2 f } <c e g>2 <g' b d> }
Major triads are entered by including the root and an optional duration:
\chordmode { c2 f4 g }
Minor, augmented, and diminished triads are entered by placing
:
and a quality modifier string after the duration:
\chordmode { c2:m f4:aug g:dim }
Seventh chords can be created:
\chordmode { c1:7 c:m7 c:maj7 c:dim7 c:aug7 }
The table belows shows the actions of the quality modifiers on triads and seventh chords. A more complete table of modifier usage is found at Common chord modifiers.
Modifier | Action |
Example
|
None | The default action; produces a major triad. |
|
m, m7 | The minor chord. This modifier lowers the 3rd and (if present) the 7th step. |
|
dim, dim7 | The diminished chord. This modifier lowers the 3rd, 5th and (if present) the 7th step. |
|
aug | The augmented chord. This modifier raises the 5th step. |
|
maj, maj7 |
The major 7th chord. This modifier adds a raised 7th step. The
7 following maj is optional. Do NOT use this modifier
to create a major triad.
|
|
Notation Reference: Common chord modifiers.
Snippets: Chords.
Chord structures of arbitrary complexity can be created in chord mode. The modifier string can be used to extend a chord, add or remove chord steps, raise or lower chord steps, and add a bass note or create an inversion.
The first number following the :
is taken to be the extent
of the chord. The chord is constructed by sequentially adding
thirds to the root until the specified number has been reached.
If the extent is not a third (e.g., 6), thirds are added up to the
highest third below the extent, and then the step of the extent is
added. The largest possible value for the extent is 13. Any
larger value is interpreted as 13.
\chordmode { c1:2 c:3 c:4 c:5 c1:6 c:7 c:8 c:9 c1:10 c:11 c:12 c:13 c1:14 }
Note that both c:5
and c
produce a C major triad.
Since an unaltered 11 does not sound good when combined with an
unaltered 13, the 11 is removed from a :13
chord (unless it
is added explicitly).
\chordmode { c1:13 c:13.11 c:m13 }
Individual steps can be added to a chord. Additions follow the
extent and are prefixed by a dot (.
).
\chordmode { c1:5.6 c:3.7.8 c:3.6.13 }
Added steps can be as high as desired.
\chordmode { c4:5.15 c:5.20 c:5.25 c:5.30 }
Added chord steps can be altered by suffixing a -
or +
sign to the number. To alter a step that is automatically included
as part of the basic chord structure, add it as an altered step.
\chordmode { c1:7+ c:5+.3- c:3-.5-.7- }
Following any steps to be added, a series of steps to be removed
is introduced in a modifier string with a prefix of ^
.
If more than one step is to be removed, the steps to be
removed are separated by .
following the
initial ^
.
\chordmode { c1^3 c:7^5 c:9^3 c:9^3.5 c:13.11^3.7 }
The modifier sus
can be added to the modifier string to
create suspended chords. This removes the 3rd step from the chord.
Append either 2
or 4
to add the 2nd or 4th step to the
chord. sus
is equivalent to ^3
; sus4
is
equivalent to .4^3
.
\chordmode { c1:sus c:sus2 c:sus4 c:5.4^3 }
Inversions (putting a pitch other than the root on the bottom of the
chord) and added bass notes can be specified by appending
/
pitch to the chord.
\chordmode { c1 c/g c/f }
A bass note that is part of the chord can be added, instead of
moved as part of an inversion, by using /+
pitch.
\chordmode { c1 c/g c/+g }
Chord modifiers that can be used to produce a variety of standard chords are shown in Common chord modifiers.
Notation Reference: Common chord modifiers.
Snippets: Chords
Each step can only be present in a chord once. The following
simply produces the augmented chord, since 5+
is
interpreted last.
\chordmode { c1:5.5-.5+ }
Only the second inversion can be created by adding a bass note. The first inversion requires changing the root of the chord.
\chordmode { c'1: c':/g e:6-3-^5 e:m6-^5 }
Chords can be displayed by name, in addition to the standard display as notes on a staff.
Chord names are printed in the ChordNames
context:
\new ChordNames { \chordmode { c2 f4. g8 } }
Chords can be entered as simultaneous notes or through the use of chord mode. The displayed chord name will be the same, regardless of the mode of entry, unless there are inversions or added bass notes:
<< \new ChordNames { <c e g>2 <f bes c> <f c' e g>1 \chordmode { c2 f:sus4 c1:/f } } { <c e g>2 <f bes c> <f, c' e g>1 \chordmode { c2 f:sus4 c1:/f } } >>
\chords { ... }
is a shortcut notation for
\new ChordNames { \chordmode { ... } }
.
\chords { c2 f4.:m g8:maj7 }
\new ChordNames { \chordmode { c2 f4.:m g8:maj7 } }
Showing chords at changes
Chord names can be displayed only at the start of lines and when the chord changes.
harmonies = \chordmode { c1:m c:m \break c:m c:m d } << \new ChordNames { \set chordChanges = ##t \harmonies } \new Staff { \relative c' { \harmonies } } >>
Simple lead sheet
When put together, chord names, a melody, and lyrics form a lead sheet:
<< \chords { c2 g:sus4 f e } \relative c'' { a4 e c8 e r4 b2 c4( d) } \addlyrics { One day this shall be free __ } >>
Music Glossary: chord.
Notation Reference: Writing music in parallel.
Snippets: Chords.
Internals Reference: ChordNames, ChordName, Chord_name_engraver, Volta_engraver, Bar_engraver.
Chords containing inversions or altered bass notes are not named properly if entered using simultaneous music.
There is no unique system for naming chords. Different musical traditions use different names for the same set of chords. There are also different symbols displayed for a given chord name. The names and symbols displayed for chord names are customizable.
The basic chord name layout is a system for Jazz music, proposed by Klaus Ignatzek (see Literature list). The chord naming system can be modified as described below. An alternate jazz chord system has been developed using these modifications. The Ignatzek and alternate Jazz notation are shown on the chart in Chord name chart.
In addition to the different naming systems, different note names
are used for the root in different languages. The predefined
variables \germanChords
, \semiGermanChords
,
\italianChords
and \frenchChords
set these variables.
The effect is demonstrated here:
If none of the existing settings give the desired output, the chord name display can be tuned through the following properties.
chordRootNamer
majorSevenSymbol
chordRootNamer
to identify a major 7 chord. Predefined
options are whiteTriangleMarkup
and
blackTriangleMarkup
.
chordNoteNamer
chordRootNamer
. The chordNoteNamer
property can be set
to a specialized function to change this behavior. For example, the
bass note can be printed in lower case.
chordNameSeparator
chordNameSeparator
, you can use any desired markup
for a separator.
chordNameExceptions
chordRootNamer
output to create the chord name.
chordPrefixSpacer
chordPrefixSpacer
.
The spacer is not used when the root is altered.
\whiteTriangleMarkup
,
\blackTriangleMarkup
,
\germanChords
,
\semiGermanChords
,
\italianChords
,
\frenchChords
.
The property chordNameExceptions
can be used to store a list of
special notations for specific chords.
% modify maj9 and 6(add9) % Exception music is chords with markups chExceptionMusic = { <c e g b d'>1-\markup { \super "maj9" } <c e g a d'>1-\markup { \super "6(add9)" } } % Convert music to list and prepend to existing exceptions. chExceptions = #( append ( sequential-music-to-chord-exceptions chExceptionMusic #t) ignatzekExceptions) theMusic = \chordmode { g1:maj9 g1:6.9 \set chordNameExceptions = #chExceptions g1:maj9 g1:6.9 } \layout { ragged-right = ##t } << \context ChordNames \theMusic \context Voice \theMusic >>
The layout of the major 7 can be tuned with
majorSevenSymbol
.
\version "2.11.51" \header { texidoc = "The layout of the major 7 can be tuned with @code{majorSevenSymbol}." } \chords { c:7+ \set majorSevenSymbol = \markup { "j7" } c:7+ }
Adding bar lines to ChordNames context
To add bar line indications in the ChordNames
context, add the
Bar_engraver
.
\new ChordNames \with { \override BarLine #'bar-size = #4 \consists "Bar_engraver" } \chordmode { f1:maj7 f:7 bes:7 }
Volta under chords
By adding the Volta_engraver
to the relevant
staff, volte can be put under chords.
\score { << \chords { c1 c1 } \new Staff \with { \consists "Volta_engraver" } { \repeat volta 2 { c'1 } \alternative { c' } } >> \layout { \context { \Score \remove "Volta_engraver" } } }
Changing chord separator
The separator between different parts of a chord name can be set to any markup.
\chords { c:7sus4 \set chordNameSeparator = \markup { \typewriter | } c:7sus4 }
Notation Reference: Chord name chart, Common chord modifiers.
Installed Files: scm/chords-ignatzek.scm, scm/chord-entry.scm, ly/chord-modifier-init.ly.
Snippets: Chords.
Chord names are determined from both the pitches that are present
in the chord and the information on the chord structure that may
have been entered in \chordmode
. If the simultaneous pitches
method of entering chords is used, undesired names result from
inversions or bass notes.
myChords = \relative c' { \chordmode { c1 c/g c/f } <c e g>1 <g c e> <f c' e g> } << \new ChordNames { \myChords } \new Staff { \myChords } >>
Figured bass notation can be displayed.
LilyPond has support for figured bass, also called thorough bass or basso continuo:
<< \new Voice { \clef bass dis4 c d ais g fis} \new FiguredBass { \figuremode { < 6 >4 < 7\+ >8 < 6+ [_!] > < 6 >4 <6 5 [3+] > < _ >4 < 6 5/>4 } } >>
The support for figured bass consists of two parts: there is an
input mode, introduced by \figuremode
, that accepts
entry of bass figures, and there is a context named
FiguredBass
that takes care of displaying
BassFigure
objects. Figured bass can also be displayed
in Staff
contexts.
\figures{ ... }
is a shortcut notation for
\new FiguredBass { \figuremode { ... } }
.
Although the support for figured bass may superficially resemble chord
support, it is much simpler. \figuremode
mode simply
stores the figures and the FiguredBass
context prints them
as entered. There is no conversion to pitches.
Music Glossary: figured bass.
Snippets: Chords
\figuremode
is used to switch the input mode to figure mode.
More information on different input modes can be
found at Input modes.
In figure mode, a group of bass figures is delimited by
<
and >
. The duration is entered after the >
.
\new FiguredBass { \figuremode { <6 4>2 } }
Accidentals (including naturals) can be added to figures:
\figures { <7! 6+ 4-> <5++> <3--> }
Augmented and diminished steps can be indicated:
\figures { <6\+ 5/> <7/> }
A backward slash through a figure (typically used for raised sixth steps) can be created:
\figures { <6> <6\\> }
Vertical spaces and brackets can be be included in figures:
\figures { <[12 _!] 8 [6 4]> }
Any text markup can be inserted as a figure:
\figures { <\markup { \tiny \number 6 \super (1) } 5> }
Continuation lines can be used to indicate repeated figures:
<< { \clef bass e4 d c b, e4 d c b, } \figures { \bassFigureExtendersOn <6 4>4 <6 3> <7 3> <7 3> \bassFigureExtendersOff <6 4>4 <6 3> <7 3> <7 3> } >>
In this case, the extender lines replace existing figures, unless the continuation lines have been explicitly terminated.
<< \figures { \bassFigureExtendersOn <6 4>4 <6 4> <6\! 4\!> <6 4> } { \clef bass d4 d c c } >>
The table below summarizes the figure modifiers available.
Modifier | Purpose |
Example
|
+, -, ! | Accidentals |
|
\+, / | Augmented and diminished steps |
|
\\ | Raised sixth step |
|
\! | End of continuation line |
|
\bassFigureExtendersOn
,
\bassFigureExtendersOff
.
Changing the positions of figured bass alterations
Accidentals and plus signs can appear before or after the numbers,
depending on the figuredBassAlterationDirection
and
figuredBassPlusDirection
properties.
\figures { <6\+> <5+> <6 4-> r \set figuredBassAlterationDirection = #RIGHT <6\+> <5+> <6 4-> r \set figuredBassPlusDirection = #RIGHT <6\+> <5+> <6 4-> r \set figuredBassAlterationDirection = #LEFT <6\+> <5+> <6 4-> r }
Snippets: Chords.
Internals Reference: BassFigure, BassFigureAlignment, BassFigureLine, BassFigureBracket, BassFigureContinuation, FiguredBass.
Figured bass can be displayed using the FiguredBass
context,
or in most staff contexts.
When displayed in a FiguredBass
context, the vertical location
of the figures is independent of the notes on the staff.
<< \relative c'' { c4 c'8 r8 c,4 c' } \new FiguredBass { \figuremode { <4>4 <10 6>8 s8 <6 4>4 <6 4> } } >>
In the example above, the FiguredBass
context must be
explicitly instantiated to avoid creating a second (empty) staff.
Figured bass can also be added to Staff
contexts
directly. In this case, the vertical position of the
figures is adjusted automatically.
<< \new Staff = myStaff \figuremode { <4>4 <10 6>8 s8 <6 4>4 <6 4> } %% Put notes on same Staff as figures \context Staff = myStaff { \clef bass c4 c'8 r8 c4 c' } >>
When added in a Staff
context, figured bass can be displayed above
or below the staff.
<< \new Staff = myStaff \figuremode { <4>4 <10 6>8 s8 \bassFigureStaffAlignmentDown <6 4>4 <6 4> } %% Put notes on same Staff as figures \context Staff = myStaff { \clef bass c4 c'8 r8 c4 c' } >>
\bassFigureStaffAlignmentDown
,
\bassFigureStaffAlignmentUp
,
\bassFigureStaffAlignmentNeutral
.
Snippets: Chords.
Internals Reference: BassFigure, BassFigureAlignment, BassFigureLine, BassFigureBracket, BassFigureContinuation, FiguredBass.
To ensure that continuation lines work properly, it is safest to use the same rhythm in the figure line as in the bass line.
<< { \clef bass \repeat unfold 4 { f16. g32 } f8. es16 d8 es } \figures { \bassFigureExtendersOn % The extenders are correct here, with the same rhythm as the bass \repeat unfold 4 { <6 4->16. <6 4->32 } <5>8. r16 <6>8 <6\! 5-> } >> << { \clef bass \repeat unfold 4 { f16. g32 } f8. es16 d8 es } \figures { \bassFigureExtendersOn % The extenders are incorrect here, even though the timing is the same <6 4->4 <6 4->4 <5>8. r16 <6>8 <6\! 5-> } >>
When using extender lines, adjacent figures with the same number in a different figure location can cause the figure positions to invert.
<< { fis4 g g, e' } \figures { \bassFigureExtendersOn <6 5>4 <5\! 4> < 5 _!> <6> } >>
To avoid this problem, simply turn on extenders after the figure that begins the extender line and turn them off at the end of the extender line.
<< { fis4 g g, e' } \figures { <6 5>4 <5 4> \bassFigureExtendersOn < 5 _!>4 <6> \bassFigureExtendersOff } >>
Support for ancient notation includes features for mensural notation and Gregorian chant notation, as well as limited support for figured bass notation.
Many graphical objects provide a style
property, see
By manipulating these grob properties, the typographical appearance of a specific type of notation can be accommodated without needing to introduce any new notational concepts.
In addition to the standard articulation signs described in Articulations and ornamentations, specific articulation signs for Gregorian chant are provided.
Other aspects of ancient notation cannot be easily expressed by changing a style property of a graphical object or by adding articulation signs. Some notational concepts are introduced specifically for ancient notation,
To start typesetting without worrying too much about the details on how to customize a context, there are predefined contexts for Gregorian chant and mensural notation. They set up predefined style-specific voice and staff contexts, and allow one to proceed directly with note entry:
There is limited support for figured bass notation from the Baroque period:
For ancient notation, a note head style other than the default
style
may be chosen. This is accomplished by setting the style
property of
the NoteHead object to baroque
, neomensural
,
mensural
or petrucci
.
The baroque
style differs from the default
style by:
maxima
notehead, and
\breve
note heads.
The neomensural
, mensural
, and petrucci
styles differ from
the baroque
style by:
The mensural
and petrucci
styles aim to emulate the appearance
of historic printed music. The petrucci
style uses larger note
heads.
The following example demonstrates the petrucci
style
\set Score.skipBars = ##t \autoBeamOff \override NoteHead #'style = #'petrucci a'\maxima a'\longa a'\breve a'1 a'2 a'4 a'8 a'16 a'
When typesetting a piece in Gregorian chant notation, the
Vaticana_ligature_engraver automatically selects the proper
note heads, so there is no need to explicitly set the note head style.
Still, the note head style can be set, e.g., to vaticana_punctum
to
produce punctum neumes. Similarly, the
Mensural_ligature_engraver automatically assembles mensural
ligatures. See Ligatures, for how ligature engravers work.
Note head styles, gives an overview of all available note head styles.
Use the glyph-name-alist
property of grob Accidental and
KeySignature to select ancient accidentals.
As shown, not all accidentals are supported by each style. When trying to access an unsupported accidental, LilyPond will switch to a different style, as demonstrated in
Similarly to local accidentals, the style of the key signature can be
controlled by the glyph-name-alist
property of the
KeySignature grob.
Notation Reference: Pitches, Accidentals, and Automatic accidentals, give a general introduction of the use of accidentals. Key signature, gives a general introduction of the use of key signatures.
Internals Reference: KeySignature.
Use the style
property of grob Rest to select
ancient rests. Supported styles are classical
,
neomensural
, and mensural
. classical
differs
from the default
style only in that the quarter rest looks like
a horizontally mirrored 8th rest. The neomensural
style suits
well for, e.g., the incipit of a transcribed mensural piece of music.
The mensural
style finally mimics the appearance of rests as
in historic prints of the 16th century.
The following example demonstrates the neomensural
style
\set Score.skipBars = ##t \override Rest #'style = #'neomensural r\longa r\breve r1 r2 r4 r8 r16
There are no 32th and 64th rests specifically for the mensural or neo-mensural style. Instead, the rests from the default style will be taken. See
There are no rests in Gregorian chant notation; instead, it uses Divisiones.
Notation Reference: Rests, gives a general introduction into the use of rests.
LilyPond supports a variety of clefs, many of them ancient.
The following table shows all ancient clefs that are supported via the
\clef
command. Some of the clefs use the same glyph, but
differ only with respect to the line they are printed on. In such
cases, a trailing number in the name is used to enumerate these clefs.
Still, you can manually force a clef glyph to be typeset on an
arbitrary line, as described in Clef. The note printed to the
right side of each clef in the example column denotes the c'
with respect to that clef.
Description | Supported Clefs |
Example
|
modern style mensural C clef |
neomensural-c1 , neomensural-c2 ,neomensural-c3 , neomensural-c4
|
|
petrucci style mensural C clefs, for use on different staff lines (the examples show the 2nd staff line C clef) |
petrucci-c1 , petrucci-c2 ,petrucci-c3 , petrucci-c4 ,petrucci-c5
|
|
petrucci style mensural F clef |
petrucci-f
|
|
petrucci style mensural G clef |
petrucci-g
|
|
historic style mensural C clef |
mensural-c1 , mensural-c2 ,mensural-c3 , mensural-c4
|
|
historic style mensural F clef |
mensural-f
|
|
historic style mensural G clef |
mensural-g
|
|
Editio Vaticana style do clef |
vaticana-do1 , vaticana-do2 ,vaticana-do3
|
|
Editio Vaticana style fa clef |
vaticana-fa1 , vaticana-fa2
|
|
Editio Medicaea style do clef |
medicaea-do1 , medicaea-do2 ,medicaea-do3
|
|
Editio Medicaea style fa clef |
medicaea-fa1 , medicaea-fa2
|
|
historic style hufnagel do clef |
hufnagel-do1 , hufnagel-do2 ,hufnagel-do3
|
|
historic style hufnagel fa clef |
hufnagel-fa1 , hufnagel-fa2
|
|
historic style hufnagel combined do/fa clef |
hufnagel-do-fa
|
|
Modern or Neo-mensural style means “as is typeset in modern editions of transcribed mensural music.”
Petrucci style means “inspired by music published by the famous engraver Petrucci (1466-1539).”
Historic style means “as was typeset or written in historic editions other than those of Petrucci.”
Editio XXX style means “as is/was printed in Editio XXX.”
Petrucci used C clefs with differently balanced left-side vertical beams, depending on which staff line it is printed.
Notation Reference: see Clef.
The mensural g clef is mapped to the Petrucci g clef.
Use the flag-style
property of grob Stem to
select ancient flags. Besides the default
flag style,
only the mensural
style is supported
\override Stem #'flag-style = #'mensural \override Stem #'thickness = #1.0 \override NoteHead #'style = #'mensural \autoBeamOff c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32
Note that the innermost flare of each mensural flag always is vertically aligned with a staff line.
There is no particular flag style for neo-mensural notation. Hence, when typesetting the incipit of a transcribed piece of mensural music, the default flag style should be used. There are no flags in Gregorian chant notation.
TODO: nothing here yet ...
The attachment of ancient flags to stems is slightly off due to a change in early 2.3.x.
Vertically aligning each flag with a staff line assumes that stems always end either exactly on or exactly in the middle between two staff lines. This may not always be true when using advanced layout features of classical notation (which however are typically out of scope for mensural notation).
There is limited support for mensuration signs (which are similar to, but
not exactly the same as time signatures). The glyphs are hard-wired to
particular time fractions. In other words, to get a particular mensuration
sign with the \time n/m
command, n
and m
have to be
chosen according to the following table
Use the style
property of grob TimeSignature to
select ancient time signatures. Supported styles are
neomensural
and mensural
. The above table uses the
neomensural
style. This style is appropriate for the
incipit of transcriptions of mensural pieces. The mensural
style mimics the look of historical printings of the 16th century.
The following examples show the differences in style,
Notation Reference: Time signature, gives a general introduction to the use of time signatures.
Ratios of note durations do not change with the time signature. For example, the ratio of 1 breve = 3 semibreves (tempus perfectum) must be made by hand, by setting
breveTP = #(ly:make-duration -1 0 3 2) ... { c\breveTP f1 }
This sets breveTP
to 3/2 times 2 = 3 times a whole note.
The old6/8alt
symbol (an alternate symbol for 6/8) is not
addressable with \time
. Use a \markup
instead
In addition to the standard articulation signs described in section Articulations and ornamentations, articulation signs for ancient notation are provided. These are specifically designed for use with notation in Editio Vaticana style.
\include "gregorian-init.ly" \score { \new VaticanaVoice { \override TextScript #'font-family = #'typewriter \override TextScript #'font-shape = #'upright \override Script #'padding = #-0.1 a\ictus_"ictus" \break a\circulus_"circulus" \break a\semicirculus_"semicirculus" \break a\accentus_"accentus" \break \[ a_"episem" \episemInitium \pes b \flexa a b \episemFinis \flexa a \] } }
TODO: nothing here yet ...
Some articulations are vertically placed too closely to the corresponding note heads.
The episem line is not displayed in many cases. If it is displayed, the right end of the episem line is often too far to the right.
A custos (plural: custodes; Latin word for ‘guard’) is a symbol that appears at the end of a staff. It anticipates the pitch of the first note(s) of the following line thus helping the performer to manage line breaks during performance.
Custodes were frequently used in music notation until the 17th century. Nowadays, they have survived only in a few particular forms of musical notation such as contemporary editions of Gregorian chant like the editio vaticana. There are different custos glyphs used in different flavors of notational style.
For typesetting custodes, just put a Custos_engraver into the
Staff context when declaring the \layout
block,
as shown in the following example
\layout { \context { \Staff \consists Custos_engraver Custos \override #'style = #'mensural } }
The result looks like this
The custos glyph is selected by the style
property. The styles
supported are vaticana
, medicaea
, hufnagel
, and
mensural
. They are demonstrated in the following fragment
Internals Reference: Custos.
Examples:
A divisio (plural: divisiones; Latin word for ‘division’) is a staff context symbol that is used to structure Gregorian music into phrases and sections. The musical meaning of divisio minima, divisio maior, and divisio maxima can be characterized as short, medium, and long pause, somewhat like the breathmarks from Breath marks. The finalis sign not only marks the end of a chant, but is also frequently used within a single antiphonal/responsorial chant to mark the end of each section.
To use divisiones, include the file gregorian-init.ly. It
contains definitions that you can apply by just inserting
\divisioMinima
, \divisioMaior
, \divisioMaxima
,
and \finalis
at proper places in the input. Some editions use
virgula or caesura instead of divisio minima.
Therefore, gregorian-init.ly also defines \virgula
and
\caesura
\virgula
,
\caesura
,
\divisioMinima
,
\divisioMaior
,
\divisioMaxima
,
\finalis
.
Notation Reference: Breath marks.
Internals Reference: BreathingSign.
Examples:
A ligature is a graphical symbol that represents at least two distinct notes. Ligatures originally appeared in the manuscripts of Gregorian chant notation to denote ascending or descending sequences of notes.
Ligatures are entered by enclosing them in \[
and \]
.
Some ligature styles may need additional input syntax specific for
this particular type of ligature. By default, the
LigatureBracket engraver just puts a square bracket
above the ligature
\transpose c c' { \[ g c a f d' \] a g f \[ e f a g \] }
To select a specific style of ligatures, a proper ligature engraver has to be added to the Voice context, as explained in the following subsections. Only white mensural ligatures are supported with certain limitations.
TODO: nothing here yet ...
Ligatures need special spacing that has not yet been implemented. As a result, there is too much space between ligatures most of the time, and line breaking often is unsatisfactory. Also, lyrics do not correctly align with ligatures.
Accidentals must not be printed within a ligature, but instead need to be collected and printed in front of it.
The syntax still uses the deprecated infix style \[ music expr
\]
. For consistency reasons, it will eventually be changed to
postfix style note\[ ... note\]
. Alternatively, the file
gregorian-init.ly can be included; it provides a scheme
function
\ligature music expr
with the same effect and is believed to be stable.
There is limited support for white mensural ligatures.
To engrave white mensural ligatures, in the layout block put the Mensural_ligature_engraver into the Voice context, and remove the Ligature_bracket_engraver, like this
\layout { \context { \Voice \remove Ligature_bracket_engraver \consists Mensural_ligature_engraver } }
There is no additional input language to describe the shape of a white mensural ligature. The shape is rather determined solely from the pitch and duration of the enclosed notes. While this approach may take a new user a while to get accustomed to, it has the great advantage that the full musical information of the ligature is known internally. This is not only required for correct MIDI output, but also allows for automatic transcription of the ligatures.
For example,
\set Score.timing = ##f \set Score.defaultBarType = "empty" \override NoteHead #'style = #'neomensural \override Staff.TimeSignature #'style = #'neomensural \clef "petrucci-g" \[ c'\maxima g \] \[ d\longa c\breve f e d \] \[ c'\maxima d'\longa \] \[ e'1 a g\breve \]
Without replacing Ligature_bracket_engraver with Mensural_ligature_engraver, the same music transcribes to the following
TODO: nothing here yet ...
Horizontal spacing is poor.
There is limited support for Gregorian square neumes notation (following the style of the Editio Vaticana). Core ligatures can already be typeset, but essential issues for serious typesetting are still lacking, such as (among others) horizontal alignment of multiple ligatures, lyrics alignment and proper handling of accidentals.
The following table contains the extended neumes table of the 2nd volume of the Antiphonale Romanum (Liber Hymnarius), published 1983 by the monks of Solesmes.
Neuma aut Neumarum Elementa |
Figurae Rectae |
Figurae Liquescentes Auctae |
Figurae Liquescentes Deminutae |
1. Punctum
|
| ||
2. Virga
|
| ||
3. Apostropha vel Stropha
|
| ||
4. Oriscus
|
| ||
5. Clivis vel Flexa
|
| ||
6. Podatus vel Pes
|
| ||
7. Pes Quassus
|
| ||
8. Quilisma Pes
|
| ||
9. Podatus Initio Debilis
|
| ||
10. Torculus
|
| ||
11. Torculus Initio Debilis
|
| ||
12. Porrectus
|
| ||
13. Climacus
|
| ||
14. Scandicus
|
| ||
15. Salicus
|
| ||
16. Trigonus
|
|
Unlike most other neumes notation systems, the input language for
neumes does not reflect the typographical appearance, but is designed
to focus on musical meaning. For example, \[ a \pes b
\flexa g \]
produces a Torculus consisting of three Punctum heads,
while \[ a \flexa g \pes b \]
produces a Porrectus with a
curved flexa shape and only a single Punctum head. There is no
command to explicitly typeset the curved flexa shape; the decision of
when to typeset a curved flexa shape is based on the musical
input. The idea of this approach is to separate the musical aspects
of the input from the notation style of the output. This way, the
same input can be reused to typeset the same music in a different
style of Gregorian chant notation.
The following table shows the code fragments that produce the
ligatures in the above neumes table. The letter in the first column
in each line of the below table indicates to which ligature in the
above table it refers. The second column gives the name of the
ligature. The third column shows the code fragment that produces this
ligature, using g
, a
, and b
as example pitches.
# | Name |
Input Language
|
a | Punctum |
\[ b \]
|
b | Punctum Inclinatum |
\[ \inclinatum b \]
|
c |
Punctum Auctum Ascendens |
\[ \auctum \ascendens b \]
|
d |
Punctum Auctum Descendens |
\[ \auctum \descendens b \]
|
e |
Punctum Inclinatum Auctum |
\[ \inclinatum \auctum b \]
|
f |
Punctum Inclinatum Parvum |
\[ \inclinatum \deminutum b \]
|
g | Virga |
\[ \virga b \]
|
h | Stropha |
\[ \stropha b \]
|
i | Stropha Aucta |
\[ \stropha \auctum b \]
|
j | Oriscus |
\[ \oriscus b \]
|
k | Clivis vel Flexa |
\[ b \flexa g \]
|
l |
Clivis Aucta Descendens |
\[ b \flexa \auctum \descendens g \]
|
m |
Clivis Aucta Ascendens |
\[ b \flexa \auctum \ascendens g \]
|
n | Cephalicus |
\[ b \flexa \deminutum g \]
|
o | Podatus vel Pes |
\[ g \pes b \]
|
p |
Pes Auctus Descendens |
\[ g \pes \auctum \descendens b \]
|
q |
Pes Auctus Ascendens |
\[ g \pes \auctum \ascendens b \]
|
r | Epiphonus |
\[ g \pes \deminutum b \]
|
s | Pes Quassus |
\[ \oriscus g \pes \virga b \]
|
t |
Pes Quassus Auctus Descendens |
\[ \oriscus g \pes \auctum \descendens b \]
|
u | Quilisma Pes |
\[ \quilisma g \pes b \]
|
v |
Quilisma Pes Auctus Descendens |
\[ \quilisma g \pes \auctum \descendens b \]
|
w | Pes Initio Debilis |
\[ \deminutum g \pes b \]
|
x |
Pes Auctus Descendens Initio Debilis |
\[ \deminutum g \pes \auctum \descendens b \]
|
y | Torculus |
\[ a \pes b \flexa g \]
|
z |
Torculus Auctus Descendens |
\[ a \pes b \flexa \auctum \descendens g \]
|
A | Torculus Deminutus |
\[ a \pes b \flexa \deminutum g \]
|
B | Torculus Initio Debilis |
\[ \deminutum a \pes b \flexa g \]
|
C |
Torculus Auctus Descendens Initio Debilis |
\[ \deminutum a \pes b \flexa \auctum \descendens g \]
|
D |
Torculus Deminutus Initio Debilis |
\[ \deminutum a \pes b \flexa \deminutum g \]
|
E | Porrectus |
\[ a \flexa g \pes b \]
|
F |
Porrectus Auctus Descendens |
\[ a \flexa g \pes \auctum \descendens b \]
|
G | Porrectus Deminutus |
\[ a \flexa g \pes \deminutum b \]
|
H | Climacus |
\[ \virga b \inclinatum a \inclinatum g \]
|
I | Climacus Auctus |
\[ \virga b \inclinatum a \inclinatum \auctum g \]
|
J | Climacus Deminutus |
\[ \virga b \inclinatum a \inclinatum \deminutum g \]
|
K | Scandicus |
\[ g \pes a \virga b \]
|
L |
Scandicus Auctus Descendens |
\[ g \pes a \pes \auctum \descendens b \]
|
M | Scandicus Deminutus |
\[ g \pes a \pes \deminutum b \]
|
N | Salicus |
\[ g \oriscus a \pes \virga b \]
|
O | Salicus Auctus Descendens |
\[ g \oriscus a \pes \auctum \descendens b \]
|
P | Trigonus |
\[ \stropha b \stropha b \stropha a \]
|
The ligatures listed above mainly serve as a limited, but still
representative pool of Gregorian ligature examples. Virtually, within
the ligature delimiters \[
and \]
, any number of heads
may be accumulated to form a single ligature, and head prefixes like
\pes
, \flexa
, \virga
, \inclinatum
,
etc. may be mixed in as desired. The use of the set of rules that
underlies the construction of the ligatures in the above table is
accordingly extrapolated. This way, infinitely many different
ligatures can be created.
Augmentum dots, also called morae, are added with the music
function \augmentum
. Note that \augmentum
is
implemented as a unary music function rather than as head prefix. It
applies to the immediately following music expression only. That is,
\augmentum \virga c
will have no visible effect. Instead, say
\virga \augmentum c
or \augmentum {\virga c}
. Also
note that you can say \augmentum {a g}
as a shortcut for
\augmentum a \augmentum g
.
\include "gregorian-init.ly" \score { \new VaticanaVoice { \[ \augmentum a \flexa \augmentum g \] \augmentum g } }
The following head prefixes are supported
\virga
,
\stropha
,
\inclinatum
,
\auctum
,
\descendens
,
\ascendens
,
\oriscus
,
\quilisma
,
\deminutum
,
\cavum
,
\linea
.
Head prefixes can be accumulated, though restrictions apply. For
example, either \descendens
or \ascendens
can be applied
to a head, but not both to the same head.
Two adjacent heads can be tied together with the \pes
and
\flexa
infix commands for a rising and falling line of melody,
respectively.
Use the unary music function \augmentum
to add augmentum dots.
TODO: nothing here yet ...
When an \augmentum
dot appears at the end of the last staff
within a ligature, it is sometimes vertically placed wrong. As a
workaround, add an additional skip note (e.g. s8
) as last note
of the staff.
\augmentum
should be implemented as a head prefix rather than a
unary music function, such that \augmentum
can be intermixed
with head prefixes in arbitrary order.
The predefined VaticanaVoiceContext
and
VaticanaStaffContext
can be used to engrave a piece of
Gregorian chant in the style of the Editio Vaticana. These contexts
initialize all relevant context properties and grob properties to
proper values, so you can immediately go ahead entering the chant, as
the following excerpt demonstrates
\include "gregorian-init.ly" \score { << \new VaticanaVoice = "cantus" { \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima \[ f\melisma \pes a c' c' \pes d'\melismaEnd \] c' \divisioMinima \break \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima } \new Lyrics \lyricsto "cantus" { San- ctus, San- ctus, San- ctus } >> }
TODO: nothing here yet ...
The predefined MensuralVoiceContext
and
MensuralStaffContext
can be used to engrave a piece in
mensural style. These contexts initialize all relevant context
properties and grob properties to proper values, so you can
immediately go ahead entering the chant, as the following excerpt
demonstrates
\score { << \new MensuralVoice = "discantus" \transpose c c' { \override Score.BarNumber #'transparent = ##t { c'1\melisma bes a g\melismaEnd f\breve \[ f1\melisma a c'\breve d'\melismaEnd \] c'\longa c'\breve\melisma a1 g1\melismaEnd fis\longa^\signumcongruentiae } } \new Lyrics \lyricsto "discantus" { San -- ctus, San -- ctus, San -- ctus } >> }
TODO: nothing here yet ...
TBC
TBC
TBC
TBC
In European music from before about 1600, singers were often expected to chromatically alter notes at their own initiative. This is called musica ficta. In modern transcriptions, these accidentals are usually printed over the note.
Support for such suggested accidentals is included, and can be
switched on by setting suggestAccidentals
to true.
fis gis \set suggestAccidentals = ##t ais bis
This will treat every subsequent accidental as musica ficta
until it is unset with \set suggestAccidentals = ##f
. A more
convenient way is to use \once
:
fis gis \once \set suggestAccidentals = ##t ais ais bis
Internals Reference: Accidental_engraver engraver and the AccidentalSuggestion object.
TBC
The purpose of this section is to highlight musical notation issues that are relevant to traditions outside the Western tradition.
This section highlights issues that are relevant to notating Arabic music.
Arabic music so far has been mainly an oral tradition. When music is transcribed, it is usually in a sketch format, on which performers are expected to improvise significantly. Increasingly, Western notation, with a few variations, is adopted in order to communicate and preserve Arabic music.
Some elements of Western musical notation such as the transcription of chords or independent parts, are not required to typeset the more traditional Arabic pieces. There are however some different issues, such as the need to indicate medium intervals that are somewhere between a semi-tone and a tone, in addition to the minor and major intervals that are used in Western music. There is also the need to group and indicate a large number of different maqams (modes) that are part of Arabic music.
In general, Arabic music notation does not attempt to precisely indicate microtonal elements that are present in musical practice.
Several issues that are relevant to Arabic music are covered elsewhere:
Notation Reference: Note names in other languages, Key signature, Manual beams.
Snippets: World music.
The more traditional Arabic note names can be quite long and are
not suitable for the purpose of music writing, so they are not
used. English note names are not very familiar in Arabic music
education, so Italian or Solfege note names (do, re, mi, fa,
sol, la, si
) are used instead. Modifiers (accidentals) can also
be used, as discussed in Note names in other languages.
For example, this is how the Arabic rast scale can be notated:
\include "arabic.ly" \relative do' { do re misb fa sol la sisb do sisb la sol fa misb re do }
The symbol for semi-flat does not match the symbol which is used
in Arabic notation. The \dwn
symbol defined in
arabic.ly
may be used preceding a flat symbol as a work
around if it is important to use the specific Arabic semi-flat
symbol. The appearance of the semi-flat symbol in the key
signature cannot be altered by using this method.
\include "arabic.ly" \relative do' { \set Staff.extraNatural = ##f dod dob dosd \dwn dob dobsb dodsd do do }
Notation Reference: Note names in other languages.
Snippets: World music.
In addition to the minor and major key signatures, the following
key signatures are defined in arabic.ly
: bayati,
rast, sikah, iraq, and
kurd. These key signatures define a small number of
maqam groups rather than the large number of maqams that are in
common use.
In general, a maqam uses the key signature of its group, or a neighbouring group, and varying accidentals are marked throughout the music.
For example to indicate the key signature of a maqam muhayer piece:
\key re \bayati
Here re is the default pitch of the muhayer maqam, and bayati is the name of the base maqam in the group.
While the key signature indicates the group, it is common for the title to indicate the more specific maqam, so in this example, the name of maqam muhayer should appear in the title.
Other maqams in the same bayati group, as shown in the table below: (bayati, hussaini, saba, and ushaq) can be indicated in the same way. These are all variations of the base and most common maqam in the group, which is bayati. They usually differ from the base maqam in their upper tetrachords, or certain flow details that don't change their fundamental nature, as siblings.
The other maqam in the same group (Nawa) is related to bayati by modulation which is indicated in the table in parenthesis for those maqams that are modulations of their base maqam. Arabic maqams admit of only limited modulations, due to the nature of Arabic musical instruments. Nawa can be indicated as follows:
\key sol \bayati
In Arabic music, the same term such as bayati that is used to indicate a maqam group, is also a maqam which is usually the most important in the group, and can also be thought of as a base maqam.
Here is one suggested grouping that maps the more common maqams to key signatures:
maqam group | key | finalis | Other maqmas in group (finalis)
|
---|---|---|---|
ajam | major | sib | jaharka (fa)
|
bayati | bayati | re | hussaini, muhayer, saba, ushaq, nawa (sol)
|
hijaz | kurd | re | shahnaz, shad arban (sol), hijazkar (do)
|
iraq | iraq | sisb | -
|
kurd | kurd | re | hijazkar kurd (do)
|
nahawand | minor | do | busalik (re), farah faza (sol)
|
nakriz | minor | do | nawa athar, hisar (re)
|
rast | rast | do | mahur, yakah (sol)
|
sikah | sikah | misb | huzam
|
Non-traditional key signatures
The commonly used \key
command sets the keySignature
property, in the Staff
context.
To create non-standard key signatures, set this property directly. The format of this command is a list:
\set Staff.keySignature = #`(((octave . step) . alter) ((octave
. step) . alter) ...)
where, for each element in the list,
octave
specifies the octave (0 being the octave from middle C to
the B above), step
specifies the note within the octave (0 means
C and 6 means B), and alter
is ,SHARP ,FLAT ,DOUBLE-SHARP
etc. (Note the leading comma.)
Alternatively, for each item in the list, using the more concise format
(step . alter)
specifies that the same alteration should hold in
all octaves.
Here is an example of a possible key signature for generating a whole-tone scale:
\relative c' { \set Staff.keySignature = #`(((0 . 3) . ,SHARP) ((0 . 5) . ,FLAT) ((0 . 6) . ,FLAT)) c4 d e fis aes4 bes c2 }
Notation Reference: Key signature.
Learning Manual: Accidentals and key signatures.
Internals Reference: KeySignature.
Snippets: World music, Pitches.
Some Arabic and Turkish music classical forms such as Semai use unusual time signatures such as 10/8. This may lead to an automatic grouping of notes that is quite different from existing typeset music, where notes may not be grouped on the beat, but in a manner that is difficult to match by adjusting automatic beaming. You can override this by switching off automatic beaming and beaming the notes manually. Where matching existing typeset music is not an issue, you may still want to adjust the beaming behaviour and/or use compound time signatures.
Compound time signatures
Odd 20th century time signatures (such as "5/8") can often be played as compound time signatures (e.g. "3/8 + 2/8"), which combine two or more inequal metrics. LilyPond can make such music quite easy to read and play, by explicitly printing the compound time signatures and adapting the automatic beaming behavior. (Graphic measure grouping indications can also be added; see the appropriate snippet in this database.)
#(define (compound-time one two num) (markup #:override '(baseline-skip . 0) #:number (#:line ((#:column (one num)) #:vcenter "+" (#:column (two num)))) )) \relative { \override Staff.TimeSignature #'stencil = #ly:text-interface::print \override Staff.TimeSignature #'text = #(compound-time "2" "3" "8") \time 5/8 #(override-auto-beam-setting '(end 1 8 5 8) 1 4) c8 d e fis gis c8 fis, gis e d c8 d e4 gis8 }
Arabic improvisation
For improvisations or taqasim which are
temporarily free, the time signature can be omitted and
\cadenzaOn
can be used. Adjusting the accidental style
might be required, since the absence of bar lines will cause the
accidental to be marked only once. Here is an example of what
could be the start of a hijaz improvisation:
\include "arabic.ly" \relative sol' { \key re \kurd #(set-accidental-style 'forget) \cadenzaOn sol4 sol sol sol fad mib sol1 fad8 mib re4. r8 mib1 fad sol }
Notation Reference: Manual beams, Automatic beams, Unmetered music, Automatic accidentals, Setting automatic beam behavior, Time signature.
Snippets: World music.
Here is a template that also uses the start of a Turkish Semai that is familiar in Arabic music education in order to illustrate some of the peculiarities of Arabic music notation, such as medium intervals and unusual modes that are discussed in this section.
\include "arabic.ly" \score { \relative re' { \set Staff.extraNatural = ##f \set Staff.autoBeaming = ##f \key re \bayati \time 10/8 re4 re'8 re16 [misb re do] sisb [la sisb do] re4 r8 re16 [misb do re] sisb [do] la [sisb sol8] la [sisb] do [re] misb fa4 fa16 [misb] misb8. [re16] re8 [misb] re [do] sisb do4 sisb8 misb16 [re do sisb] la [do sisb la] la4 r8 } \header { title = "Semai Muhayer" composer = "Jamil Bek" } }
Snippets: World music
There are also various web sites that explain maqams and some provide audio examples such as :
There are some variations in the details of how maqams are grouped, despite agreement on the criteria of grouping maqams that are related through common lower tetra chords, or through modulation.
Oud methods by the following authors, contain examples of mainly Turkish and Arabic compositions.
This section deals with general LilyPond input and output issues, rather than specific notation.
The main format of input for LilyPond are text files. By convention,
these files end with .ly
.
A \score
block must contain a single music expression
delimited by curly brackets:
\score { ... }
Note: There must be only one outer music expression in
a score block, and it must be surrounded by
curly brackets.
|
This single music expression may be of any size, and may contain other music expressions to any complexity. All of these examples are music expressions:
{ c'4 c' c' c' }
{ { c'4 c' c' c'} { d'4 d' d' d'} }
<< \new Staff { c'4 c' c' c' } \new Staff { d'4 d' d' d' } >>
{ \new GrandStaff << \new StaffGroup << \new Staff { \flute } \new Staff { \oboe } >> \new StaffGroup << \new Staff { \violinI } \new Staff { \violinII } >> >> }
Comments are one exception to this general rule. (For others see
File structure.) Both single-line comments and comments
delimited by %{ .. %}
may be placed anywhere within an
input file. They may be placed inside or outside a \score
block, and inside or outside the single music expression within a
\score
block.
Learning Manual:
Working on input files, Music expressions explained, Score is a (single) compound musical expression.
A document may contain multiple pieces of music and text. Examples
of these are an etude book, or an orchestral part with multiple
movements. Each movement is entered with a \score
block,
\score { ..music.. }
and texts are entered with a \markup
block,
\markup { ..text.. }
All the movements and texts which appear in the same .ly
file
will normally be typeset in the form of a single output file.
\score { .. } \markup { .. } \score { .. }
However, if you want multiple output files from the same .ly
file, then you can add multiple \book
blocks, where each such
\book
block will result in a separate output. If you do not
specify any \book
block in the file, LilyPond will implicitly
treat the full file as a single \book
block, see File structure. One important exception is within lilypond-book documents,
where you explicitly have to add a \book
block, otherwise only
the first \score
or \markup
will appear in the output.
The header for each piece of music can be put inside the \score
block. The piece
name from the header will be printed before
each movement. The title for the entire book can be put inside the
\book
, but if it is not present, the \header
which is at
the top of the file is inserted.
\header { title = "Eight miniatures" composer = "Igor Stravinsky" } \score { ... \header { piece = "Romanze" } } \markup { ..text of second verse.. } \markup { ..text of third verse.. } \score { ... \header { piece = "Menuetto" } }
A .ly
file may contain any number of toplevel expressions, where a
toplevel expression is one of the following:
\paper
, \midi
, and
\layout
. Such a definition at the toplevel changes the default
book-wide settings. If more than one such definition of
the same type is entered at the top level any definitions in the later
expressions have precedence.
#(set-default-paper-size "a7" 'landscape)
or
#(ly:set-option 'point-and-click #f)
.
\header
block. This sets the global header block. This
is the block containing the definitions for book-wide settings, like
composer, title, etc.
\score
block. This score will be collected with other
toplevel scores, and combined as a single \book
.
This behavior can be changed by setting the variable
toplevel-score-handler
at toplevel. The default handler is
defined in the init file ../scm/lily.scm.
\book
block logically combines multiple movements
(i.e., multiple \score
blocks) in one document. If there
are a number of \score
s, one output file will be created
for each \book
block, in which all corresponding movements
are concatenated. The only reason to explicitly specify
\book
blocks in a .ly
file is if you wish to create
multiple output files from a single input file. One exception is
within lilypond-book documents, where you explicitly have to add
a \book
block if you want more than a single \score
or \markup
in the same example. This behavior can be
changed by setting the variable toplevel-book-handler
at
toplevel. The default handler is defined in the init file
../scm/lily.scm.
{ c'4 d' e'2 }
This will add the piece in a \score
and format it in a
single book together with all other toplevel \score
s and music
expressions. In other words, a file containing only the above
music expression will be translated into
\book { \score { \new Staff { \new Voice { { c'4 d' e'2 } } } } \layout { } \header { } }
This behavior can be changed by setting the variable
toplevel-music-handler
at toplevel. The default handler is
defined in the init file ../scm/lily.scm.
\markup { 2. The first line verse two. }
Markup texts are rendered above, between or below the scores or music expressions, wherever they appear.
foo = { c4 d e d }
This can be used later on in the file by entering \foo
. The
name of an variable should have alphabetic characters only; no
numbers, underscores or dashes.
The following example shows three things that may be entered at toplevel
\layout { % Don't justify the output ragged-right = ##t } \header { title = "Do-re-mi" } { c'4 d' e2 }
At any point in a file, any of the following lexical instructions can be entered:
\version
\include
\sourcefilename
\sourcefileline
%
sign.
%{ .. %}
.
Learning Manual: How LilyPond input files work.
Almost all printed music includes a title and the composer's name; some pieces include a lot more information.
Titles are created for each \score
block, as well as for the full
input file (or \book
block).
The contents of the titles are taken from the \header
blocks.
The header block for a book supports the following
dedication
title
subtitle
subsubtitle
poet
composer
meter
opus
arranger
instrument
piece
breakbefore
copyright
tagline
Here is a demonstration of the fields available. Note that you may use any Formatting text, commands in the header.
\paper { line-width = 9.0\cm paper-height = 10.0\cm } \book { \header { dedication = "dedicated to me" title = \markup \center-column { "Title first line" "Title second line, longer" } subtitle = "the subtitle," subsubtitle = #(string-append "subsubtitle LilyPond version " (lilypond-version)) poet = "Poet" composer = \markup \center-column { "composer" \small "(1847-1973)" } texttranslator = "Text Translator" meter = \markup { \teeny "m" \tiny "e" \normalsize "t" \large "e" \huge "r" } arranger = \markup { \fontsize #8.5 "a" \fontsize #2.5 "r" \fontsize #-2.5 "r" \fontsize #-5.3 "a" \fontsize #7.5 "nger" } instrument = \markup \bold \italic "instrument" piece = "Piece" } \score { { c'1 } \header { piece = "piece1" opus = "opus1" } } \markup { and now... } \score { { c'1 } \header { piece = "piece2" opus = "opus2" } } }
As demonstrated before, you can use multiple \header
blocks.
When same fields appear in different blocks, the latter is used.
Here is a short example.
\header { composer = "Composer" } \header { piece = "Piece" } \score { \new Staff { c'4 } \header { piece = "New piece" % overwrite previous one } }
If you define the \header
inside the \score
block, then
normally only the piece
and opus
headers will be printed.
Note that the music expression must come before the \header
.
\score { { c'4 } \header { title = "title" % not printed piece = "piece" opus = "opus" } }
You may change this behavior (and print all the headers when defining
\header
inside \score
) by using
\paper{ printallheaders=##t }
The default footer is empty, except for the first page, where the
copyright
field from \header
is inserted, and the last
page, where tagline
from \header
is added. The default
tagline is “Music engraving by LilyPond (version)”.2
Headers may be completely removed by setting them to false.
\header { tagline = ##f composer = ##f }
A more advanced option is to change the definitions of the following
variables in the \paper
block. The init file
../ly/titling-init.ly lists the default layout.
bookTitleMarkup
scoreTitleMarkup
\score
block. Typically, it has
the name of the movement (piece
field).
oddHeaderMarkup
evenHeaderMarkup
By default, headers are defined such that the page number is on the outside edge, and the instrument is centered.
oddFooterMarkup
evenFooterMarkup
By default, the footer has the copyright notice on the first, and the tagline on the last page.
The following definition will put the title flush left, and the composer flush right on a single line.
\paper { bookTitleMarkup = \markup { \fill-line { \fromproperty #'header:title \fromproperty #'header:composer } } }
A particular place of a score can be marked using the \label
command, either at top-level or inside music. This label can then be
referred to in a markup, to get the number of the page where the marked
point is placed, using the \page-ref
markup command.
\header { tagline = ##f } \book { \label #'firstScore \score { { c'1 \pageBreak \mark A \label #'markA c' } } \markup { The first score begins on page \page-ref #'firstScore "0" "?" } \markup { Mark A is on page \page-ref #'markA "0" "?" } }
The \page-ref
markup command takes three arguments:
#'firstScore
;
The reason why a gauge is needed is that, at the time markups are interpreted, the page breaking has not yet occurred, so the page numbers are not yet known. To work around this issue, the actual markup interpretation is delayed to a later time; however, the dimensions of the markup have to be known before, so a gauge is used to decide these dimensions. If the book has between 10 and 99 pages, it may be "00", ie. a two digit number.
A table of contents is included using the \markuplines \table-of-contents
command. The elements which should appear in the table of contents are
entered with the \tocItem
command, which may be used either at
top-level, or inside a music expression.
\markuplines \table-of-contents \pageBreak \tocItem \markup "First score" \score { { c' % ... \tocItem \markup "Some particular point in the first score" d' % ... } } \tocItem \markup "Second score" \score { { e' % ... } }
The markups which are used to format the table of contents are defined
in the \paper
block. The default ones are tocTitleMarkup
,
for formatting the title of the table, and tocItemMarkup
, for
formatting the toc elements, composed of the element title and page
number. These variables may be changed by the user:
\paper { %% Translate the toc title into French: tocTitleMarkup = \markup \huge \column { \fill-line { \null "Table des matières" \null } \hspace #1 } %% use larger font size tocItemMarkup = \markup \large \fill-line { \fromproperty #'toc:text \fromproperty #'toc:page } }
Note how the toc element text and page number are referred to in
the tocItemMarkup
definition.
New commands and markups may also be defined to build more elaborated table of contents:
\paper
block
In the following example, a new style is defined for entering act names in the table of contents of an opera:
\paper { tocActMarkup = \markup \large \column { \hspace #1 \fill-line { \null \italic \fromproperty #'toc:text \null } \hspace #1 } } tocAct = #(define-music-function (parser location text) (markup?) (add-toc-item! 'tocActMarkup text))
Init files: ../ly/toc-init.ly.
A large project may be split up into separate files. To refer to another file, use
\include "otherfile.ly"
The line \include "otherfile.ly"
is equivalent to pasting the
contents of otherfile.ly into the current file at the place
where the \include
appears. For example, in a large
project you might write separate files for each instrument part
and create a “full score” file which brings together the
individual instrument files. Normally the included file will
define a number of variables which then become available
for use in the full score file. Tagged sections can be
marked in included files to assist in making them usable in
different places in a score, see Different editions from one source.
Files in the current working directory may be referenced by
specifying just the file name after the \include
command.
Files in other locations may be included by giving either a full
path reference or a relative path reference (but use the UNIX
forward slash, /, rather than the DOS/Windows back slash, \, as the
directory separator.) For example, if stuff.ly is located
one directory higher than the current working directory, use
\include "../stuff.ly"
or if the included orchestral parts files are all located in a subdirectory called parts within the current directory, use
\include "parts/VI.ly" \include "parts/VII.ly" ... etc
Files which are to be included can also contain \include
statements of their own. These second-level
\include
statements are not interpreted until they have
been brought into the main file, so the file names they specify
must all be relative to the directory containing the main file,
not the directory containing the included file.
Files can also be included from a directory in a search path specified as an option when invoking LilyPond from the command line. The included files are then specified using just their file name. For example, to compile main.ly which includes files located in a subdirectory called parts by this method, cd to the directory containing main.ly and enter
lilypond --include=parts main.ly
and in main.ly write
\include "VI.ly" \include "VII.ly" ... etc
Files which are to be included in many scores may be placed in
the LilyPond directory ../ly. (The location of this
directory is installation-dependent - see of information
Other sources of information). These files can then be included simply by
naming them on an \include
statement. This is how the
language-dependent files like english.ly are included.
LilyPond includes a number of files by default when you start
the program. These includes are not apparent to the user, but the
files may be identified by running lilypond --verbose
from
the command line. This will display a list of paths and files that
LilyPond uses, along with much other information. Alternatively,
the more important of these files are discussed in sources of information
Other sources of information. These files may be edited, but changes to
them will be lost on installing a new version of LilyPond.
Some simple examples of using \include
are shown in
Scores and parts.
Learning Manual: Other sources of information, Scores and parts.
If an included file is given a name which is the same as one in LilyPond's installation files, LilyPond's file from the installation files takes precedence.
Several mechanisms are available to facilitate the generation of different versions of a score from the same music source. Variables are perhaps most useful for combining lengthy sections of music and/or annotation in various ways, while tags are more useful for selecting one from several alternative shorter sections of music. Whichever method is used, separating the notation from the structure of the score will make it easier to change the structure while leaving the notation untouched.
If sections of the music are defined in variables they can be reused in different parts of the score, see pieces with variables Organizing pieces with variables. For example, an a cappella vocal score frequently includes a piano reduction of the parts for rehearsal purposes which is identical to the vocal music, so the music need be entered only once. Music from two variables may be combined on one staff, see Automatic part combining. Here is an example:
sopranoMusic = \relative c'' { a4 b c b8( a)} altoMusic = \relative g' { e4 e e f } tenorMusic = \relative c' { c4 b e d8( c) } bassMusic = \relative c' { a4 gis a d, } allLyrics = \lyricmode {King of glo -- ry } << \new Staff = "Soprano" \sopranoMusic \new Lyrics \allLyrics \new Staff = "Alto" \altoMusic \new Lyrics \allLyrics \new Staff = "Tenor" { \clef "treble_8" \tenorMusic } \new Lyrics \allLyrics \new Staff = "Bass" { \clef "bass" \bassMusic } \new Lyrics \allLyrics \new PianoStaff << \new Staff = "RH" { \set Staff.printPartCombineTexts = ##f \partcombine \sopranoMusic \altoMusic } \new Staff = "LH" { \set Staff.printPartCombineTexts = ##f \clef "bass" \partcombine \tenorMusic \bassMusic } >> >>
Separate scores showing just the vocal parts or just the piano part can be produced by changing just the structural statements, leaving the musical notation unchanged.
For lengthy scores, the variable definitions may be placed in separate files which are then included, see Including LilyPond files.
The \tag #'
partA command marks a music expression
with the name partA.
Expressions tagged in this way can be selected or filtered out by
name later, using either \keepWithTag #'
name or
\removeWithTag #'
name. The result of applying these filters
to tagged music is as follows:
Filter | Result
|
---|---|
Tagged music preceded by \keepWithTag #' name
| Untagged music and music tagged with name is included;
music tagged with any other tag name is excluded.
|
Tagged music preceded by \removeWithTag #' name
| Untagged music and music tagged with any tag name other than
name is included; music tagged with name is
excluded.
|
Tagged music not preceded by either \keepWithTag or
\removeWithTag
| All tagged and untagged music is included.
|
The arguments of the \tag
, \keepWithTag
and
\removeWithTag
commands should be a symbol
(such as #'score
or #'part
), followed
by a music expression.
In the following example, we see two versions of a piece of music, one showing trills with the usual notation, and one with trills explicitly expanded:
music = \relative g' { g8. c32 d \tag #'trills {d8.\trill } \tag #'expand {\repeat unfold 3 {e32 d} } c32 d } \score { \keepWithTag #'trills \music } \score { \keepWithTag #'expand \music }
Alternatively, it is sometimes easier to exclude sections of music:
music = \relative g' { g8. c32 d \tag #'trills {d8.\trill } \tag #'expand {\repeat unfold 3 {e32 d} } c32 d } \score { \removeWithTag #'expand \music } \score { \removeWithTag #'trills \music }
Tagged filtering can be applied to articulations, texts, etc. by prepending
-\tag #'your-tag
to an articulation. For example, this would define a note with a conditional fingering indication and a note with a conditional annotation:
c1-\tag #'finger ^4 c1-\tag #'warn ^"Watch!"
Multiple tags may be placed on expressions with multiple
\tag
entries:
music = \relative c'' { \tag #'a \tag #'both { a a a a } \tag #'b \tag #'both { b b b b } } << \keepWithTag #'a \music \keepWithTag #'b \music \keepWithTag #'both \music >>
Multiple \removeWithTag
filters may be applied to a single
music expression to remove several differently named tagged sections:
music = \relative c'' { \tag #'A { a a a a } \tag #'B { b b b b } \tag #'C { c c c c } \tag #'D { d d d d } } { \removeWithTag #'B \removeWithTag #'C \music }
Two or more \keepWithTag
filters applied to a single music
expression will cause all tagged sections to be removed, as
the first filter will remove all tagged sections except the one
named, and the second filter will remove even that tagged section.
Learning Manual: Organizing pieces with variables.
Notation Reference: Automatic part combining, Including LilyPond files.
LilyPond uses the character repertoire defined by the Unicode consortium and ISO/IEC 10646. This defines a unique name and code point for the character sets used in virtually all modern languages and many others too. Unicode can be implemented using several different encodings. LilyPond uses the UTF-8 encoding (UTF stands for Unicode Transformation Format) which represents all common Latin characters in one byte, and represents other characters using a variable length format of up to four bytes.
The actual appearance of the characters is determined by the glyphs defined in the particular fonts available - a font defines the mapping of a subset of the Unicode code points to glyphs. LilyPond uses the Pango library to layout and render multi-lingual texts.
Lilypond does not perform any input-encoding conversions. This means that any text, be it title, lyric text, or musical instruction containing non-ASCII characters, must be encoded in UTF-8. The easiest way to enter such text is by using a Unicode-aware editor and saving the file with UTF-8 encoding. Most popular modern editors have UTF-8 support, for example, vim, Emacs, jEdit, and GEdit do. All MS Windows systems later than NT use Unicode as their native character encoding, so even Notepad can edit and save a file in UTF-8 format. A more functional alternative for Windows is BabelPad.
If a LilyPond input file containing a non-ASCII character is not saved in UTF-8 format the error message
FT_Get_Glyph_Name () error: invalid argument
will be generated.
Here is an example showing Cyrillic, Hebrew and Portuguese text:
To enter a single character for which the Unicode escape sequence is known but which is not available in the editor being used, enter
#(ly:export (ly:wide-char->utf-8 #x03BE))
where in this example x03BE
is the hexadecimal code for the
Unicode U+03BE character, which has the Unicode name “Greek Small
Letter Xi”. Any Unicode hexadecimal code may be substituted, and
if all special characters are entered in this format it is not
necessary to save the input file in UTF-8 format.
The ly:export
format may be used in text within \mark
or
\markup
commands but not in lyrics.
Displaying a music expression in LilyPond notation can be
done using the music function \displayLilyMusic
. For example,
{ \displayLilyMusic \transpose c a, { c e g a bes } }
will display
{ a, cis e fis g }
By default, LilyPond will print these messages to the console along
with all the other messages. To split up these messages and save
the results of \display{STUFF}
, redirect the output to
a file.
lilypond file.ly >display.txt
It is possible to quote small fragments of a large score directly from the output. This can be compared to clipping a piece of a paper score with scissors.
This is done by defining the measures that need to be cut out separately. For example, including the following definition
\layout { clip-regions = #(list (cons (make-rhythmic-location 5 1 2) (make-rhythmic-location 7 3 4))) }
will extract a fragment starting halfway the fifth measure, ending in
the seventh measure. The meaning of 5 1 2
is: after a 1/2 note
in measure 5, and 7 3 4
after 3 quarter notes in measure 7.
More clip regions can be defined by adding more pairs of rhythmic-locations to the list.
In order to use this feature, LilyPond must be invoked with
-dclip-systems
. The clips are output as EPS files, and are
converted to PDF and PNG if these formats are switched on as well.
For more information on output formats, see Invoking lilypond.
When entering or copying music, usually only the music near the end (where you are adding notes) is interesting to view and correct. To speed up this correction process, it is possible to skip typesetting of all but the last few measures. This is achieved by putting
showLastLength = R1*5 \score { ... }
in your source file. This will render only the last 5 measures
(assuming 4/4 time signature) of every \score
in the input
file. For longer pieces, rendering only a small part is often an order
of magnitude quicker than rendering it completely
Skipping parts of a score can be controlled in a more fine-grained
fashion with the property Score.skipTypesetting
. When it is
set, no typesetting is performed at all.
This property is also used to control output to the MIDI file. Note that it skips all events, including tempo and instrument changes. You have been warned.
\relative c'' { c8 d \set Score.skipTypesetting = ##t e e e e e e e e \set Score.skipTypesetting = ##f c d b bes a g c2 }
In polyphonic music, Score.skipTypesetting
will affect all
voices and staves, saving even more time.
MIDI (Musical Instrument Digital Interface) is a standard for connecting and controlling digital instruments. A MIDI file is a series of notes in a number of tracks. It is not an actual sound file; you need special software to translate between the series of notes and actual sounds.
Pieces of music can be converted to MIDI files, so you can listen to what was entered. This is convenient for checking the music; octaves that are off or accidentals that were mistyped stand out very much when listening to the MIDI output.
The midi output allocates a channel for each staff, and one for global settings. Therefore the midi file should not have more than 15 staves (or 14 if you do not use drums). Other staves will remain silent.
To create a MIDI output file from a LilyPond input file, add a
\midi
block to a score, for example,
\score { ...music... \midi { } }
If there is a \midi
block in a \score
with no
\layout
block, only MIDI output will be produced. When
notation is needed too, a \layout
block must be also be
present.
\score { ...music... \midi { } \layout { } }
Pitches, rhythms, ties, dynamics, and tempo changes are interpreted and translated correctly to the MIDI output. Dynamic marks, crescendi and decrescendi translate into MIDI volume levels. Dynamic marks translate to a fixed fraction of the available MIDI volume range. Crescendi and decrescendi make the volume vary linearly between their two extremes. The effect of dynamic markings on the MIDI output can be removed completely, see MIDI block.
The initial tempo and later tempo changes can be specified
with the \tempo
command within the music notation. These
are reflected in tempo changes in the MIDI output. This command
will normally result in the metronome mark being printed, but this
can be suppressed, see Metronome marks. An alternative way
of specifying the inital or overall MIDI tempo is described below,
see MIDI block.
The MIDI instrument to be used is specified by setting the
Staff.midiInstrument
property to the instrument name.
The name should be chosen from the list in MIDI instruments.
\new Staff { \set Staff.midiInstrument = "glockenspiel" ...notes... }
\new Staff \with {midiInstrument = "cello"} { ...notes... }
If the selected instrument does not exactly match an instrument from
the list of MIDI instruments, the Grand Piano ("acoustic grand"
)
instrument is used.
Changing MIDI output to one channel per voice
When outputting MIDI, the default behavior is for each staff to represent one MIDI channel, with all the voices on a staff amalgamated. This minimizes the risk of running out of MIDI channels, since there are only 16 available per track.
However, by moving the Staff_performer
to the Voice
context, each voice on a staff can have its own MIDI channel, as is
demonstrated by the following example: despite being on the same staff,
two MIDI channels are created, each with a different
midiInstrument
.
\score { \new Staff << \new Voice \relative c''' { \set midiInstrument = #"flute" \voiceOne \key g \major \time 2/2 r2 g-"Flute" ~ g fis ~ fis4 g8 fis e2 ~ e4 d8 cis d2 } \new Voice \relative c'' { \set midiInstrument = #"clarinet" \voiceTwo b1-"Clarinet" a2. b8 a g2. fis8 e fis2 r } >> \layout { } \midi { \context { \Staff \remove "Staff_performer" } \context { \Voice \consists "Staff_performer" } \context { \Score tempoWholesPerMinute = #(ly:make-moment 72 2) } } }
Changes in the MIDI volume take place only on starting a note, so crescendi and decrescendi cannot affect the volume of a single note.
Not all midi players correctly handle tempo changes in the midi output. Players that are known to work include MS Windows Media Player and timidity.
A \midi
block must appear within a score block if MIDI output
is required. It is analogous to the layout block, but somewhat
simpler. Often, the \midi
block is left empty, but it
can contain context rearrangements, new context definitions or code
to set the values of properties. For example, the following will
set the initial tempo exported to a MIDI file without causing a tempo
indication to be printed:
\score { ...music... \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 72 4) } } }
In this example the tempo is set to 72 quarter note beats per minute. This kind of tempo specification cannot take a dotted note length as an argument. If one is required, break the dotted note into smaller units. For example, a tempo of 90 dotted quarter notes per minute can be specified as 270 eighth notes per minute:
tempoWholesPerMinute = #(ly:make-moment 270 8)
Context definitions follow precisely the same syntax as those
within a \layout
block. Translation modules for sound are
called performers. The contexts for MIDI output are defined in
../ly/performer-init.ly,
see Other sources of information.
For example, to remove the effect of dynamics
from the MIDI output, insert the following lines in the
\midi{ }
block.
\midi { ... \context { \Voice \remove "Dynamic_performer" } }
MIDI output is created only when a \midi
block is included
within a score block defined with a \score
command. If it
is placed within an explicitly instantiated score context (i.e.
within a \new Score
block) the file will fail. To solve
this, enclose the \new Score
and the \midi
commands
in a \score
block.
\score { \new Score { ...notes... } \midi { } }
The following items of notation are reflected in the MIDI output:
:
[number]’
The following items of notation have no effect on the MIDI output:
:
[number]’
With a few minor additions, all types of repeats can be represented
in the MIDI output. This is achieved by applying the
\unfoldRepeats
music function. This function changes all
repeats to unfold repeats.
\unfoldRepeats { \repeat tremolo 8 {c'32 e' } \repeat percent 2 { c''8 d'' } \repeat volta 2 {c'4 d' e' f'} \alternative { { g' a' a' g' } {f' e' d' c' } } } \bar "|."
When creating a score file using \unfoldRepeats
for MIDI,
it is necessary to make two \score
blocks: one for MIDI
(with unfolded repeats) and one for notation (with volta, tremolo,
and percent repeats). For example,
\score { ..music.. \layout { .. } } \score { \unfoldRepeats ..music.. \midi { .. } }
MIDI dynamics are implemented by the Dynamic_performer which lives by default in the Voice context. It is possible to control the overall MIDI volume, the relative volume of dynamic markings and the relative volume of different instruments.
Dynamic marks are translated to a fixed fraction of the available
MIDI volume range. The default fractions range from 0.25 for
ppppp to 0.95 for fffff. The set of dynamic
marks and the associated fractions can be seen in
../scm/midi.scm, see Other sources of information.
This set of fractions may be changed or extended by providing a
function which takes a dynamic mark as its argument and returns the
required fraction, and setting
Score.dynamicAbsoluteVolumeFunction
to this function.
For example, if a rinforzando dynamic marking,
\rfz
, is required, this will not by default
have any effect on the MIDI volume, as this dynamic marking is not
included in the default set. Similarly, if a new dynamic marking
has been defined with make-dynamic-script
that too will not
be included in the default set. The following example shows how the
MIDI volume for such dynamic markings might be added. The Scheme
function sets the fraction to 0.9 if a dynamic mark of rfz is
found, or calls the default function otherwise.
#(define (myDynamics dynamic) (if (equal? dynamic "rfz") 0.9 (default-dynamic-absolute-volume dynamic))) \score { \new Staff { \set Staff.midiInstrument = "cello" \set Score.dynamicAbsoluteVolumeFunction = #myDynamics \new Voice { \relative c'' { a\pp b c-\rfz } } } \layout {} \midi {} }
Alternatively, if the whole table of fractions needs to be redefined, it would be better to use the default-dynamic-absolute-volume procedure in ../scm/midi.scm and the associated table as a model. The final example in this section shows how this might be done.
The minimum and maximum overall volume of MIDI dynamic markings is
controlled by setting the properties midiMinimumVolume
and
midiMaximumVolume
at the Score
level. These
properties have an effect only on dynamic marks, so if they
are to apply from the start of the score a dynamic mark must be
placed there. The fraction corresponding to each dynamic mark is
modified with this formula
midiMinimumVolume + (midiMaximumVolume - midiMinimumVolume) * fraction
In the following example the dynamic range of the overall MIDI volume is limited to the range 0.2 - 0.5.
\score { << \new Staff { \key g \major \time 2/2 \set Staff.midiInstrument = #"flute" \new Voice \relative c''' { r2 g\mp g fis ~ fis4 g8 fis e2 ~ e4 d8 cis d2 } } \new Staff { \key g \major \set Staff.midiInstrument = #"clarinet" \new Voice \relative c'' { b1\p a2. b8 a g2. fis8 e fis2 r } } >> \layout { } \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 72 2) midiMinimumVolume = #0.2 midiMaximumVolume = #0.5 } } }
If the minimum and maximum MIDI volume properties are set in
the Staff
context the relative volumes of the MIDI
instruments can be controlled. This gives a basic instrument
equalizer, which can enhance the quality of the MIDI output
remarkably.
In this example the volume of the clarinet is reduced relative to the volume of the flute. There must be a dynamic mark on the first note of each instrument for this to work correctly.
\score { << \new Staff { \key g \major \time 2/2 \set Staff.midiInstrument = #"flute" \set Staff.midiMinimumVolume = #0.7 \set Staff.midiMaximumVolume = #0.9 \new Voice \relative c''' { r2 g\mp g fis ~ fis4 g8 fis e2 ~ e4 d8 cis d2 } } \new Staff { \key g \major \set Staff.midiInstrument = #"clarinet" \set Staff.midiMinimumVolume = #0.3 \set Staff.midiMaximumVolume = #0.6 \new Voice \relative c'' { b1\p a2. b8 a g2. fis8 e fis2 r } } >> \layout { } \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 72 2) } } }
If the MIDI minimum and maximum volume properties are not set LilyPond will, by default, apply a small degree of equalization to a few instruments. The instruments and the equalization applied are shown in the table instrument-equalizer-alist in ../scm/midi.scm.
This basic default equalizer can be replaced by setting
instrumentEqualizer
in the Score
context to a new
Scheme procedure which accepts a MIDI instrument name as its only
argument and returns a pair of fractions giving the minimum and
maximum volumes to be applied to that instrument. This replacement
is done in the same way as shown for resetting the
dynamicAbsoluteVolumeFunction
at the start of this section.
The default equalizer, default-instrument-equalizer, in
../scm/midi.scm shows how such a procedure might be written.
The following example sets the relative flute and clarinet volumes to the same values as the previous example.
#(define my-instrument-equalizer-alist '()) #(set! my-instrument-equalizer-alist (append '( ("flute" . (0.7 . 0.9)) ("clarinet" . (0.3 . 0.6))) my-instrument-equalizer-alist)) #(define (my-instrument-equalizer s) (let ((entry (assoc s my-instrument-equalizer-alist))) (if entry (cdr entry)))) \score { << \new Staff { \key g \major \time 2/2 \set Score.instrumentEqualizer = #my-instrument-equalizer \set Staff.midiInstrument = #"flute" \new Voice \relative c''' { r2 g\mp g fis ~ fis4 g8 fis e2 ~ e4 d8 cis d2 } } \new Staff { \key g \major \set Staff.midiInstrument = #"clarinet" \new Voice \relative c'' { b1\p a2. b8 a g2. fis8 e fis2 r } } >> \layout { } \midi { \context { \Score tempoWholesPerMinute = #(ly:make-moment 72 2) } } }
Percussion instruments are generally notated in a DrumStaff
context and when notated in this way they are outputted correctly
to MIDI channel 10, but some pitched percussion instruments,
like the xylophone, marimba, vibraphone, timpani, etc., are
treated like “normal” instruments and music for these instruments
should be entered in a normal Staff
context, not a
DrumStaff
context, to obtain the correct MIDI output.
Some non-pitched percussion sounds included in the general MIDI
standard, like melodic tom, taiko drum, synth drum, etc., cannot
be reached via MIDI channel 10, so the notation for such
instruments should also be entered in a normal Staff
context, using suitable normal pitches.
Many percussion instruments are not included in the general MIDI standard, e.g. castanets. The easiest, although unsatisfactory, method of producing some MIDI output when writing for such instruments is to substitute the nearest sound from the standard set.
Because the general MIDI standard does not contain rim shots, the sidestick is used for this purpose instead.
The global paper layout is determined by three factors: the page layout, the line breaks, and the spacing. These all influence each other. The choice of spacing determines how densely each system of music is set. This influences where line breaks are chosen, and thus ultimately, how many pages a piece of music takes.
Globally speaking, this procedure happens in four steps: first, flexible distances (‘springs’) are chosen, based on durations. All possible line breaking combinations are tried, and a ‘badness’ score is calculated for each. Then the height of each possible system is estimated. Finally, a page breaking and line breaking combination is chosen so that neither the horizontal nor the vertical spacing is too cramped or stretched.
Settings which influence layout may be placed in two blocks.
The \paper {...}
block is placed outside any
\score {...}
blocks and contains settings that
relate to the entire document. The \layout {...}
block is placed within a \score {...}
block and
contains settings for that particular score. If you have
only one \score {...}
block the two have the same
effect. In general the commands shown in this chapter can
be placed in either.
This section deals with the boundaries that define the area within which music can be printed.
To change the paper size, there are two commands,
#(set-default-paper-size "a4")
\paper { #(set-paper-size "a4") }
The first command sets the size of all pages. The second command sets the
size
of the pages that the \paper
block applies to – if the \paper
block is at the top of the file, then it will apply to all pages. If the
\paper
block is inside a \book
, then the paper size will only
apply to that book.
Support for the following paper sizes are included by default,
a6
, a5
, a4
, a3
, legal
, letter
,
11x17
(also known as tabloid).
Extra sizes may be added by editing the definition for
paper-alist
in the initialization file scm/paper.scm.
If the symbol landscape
is supplied as an argument to
set-default-paper-size
, the pages will be rotated by 90 degrees,
and wider line widths will be set correspondingly.
#(set-default-paper-size "a6" 'landscape)
Setting the paper size will adjust a number of \paper
variables
(such as margins). To use a particular paper size with altered
\paper
variables, set the paper size before setting the variables.
LilyPond will do page layout, set margins, and add headers and footers to each page.
The default layout responds to the following settings in the
\paper
block.
first-page-number
- The value of the page number of the first page. Default is 1.
print-first-page-number
- If set to true, will print the page number in the first page. Default is false.
print-page-number
- If set to false, page numbers will not be printed. Default is true.
paper-width
- The width of the page. The default is taken from the current paper size, see Paper size.
paper-height
- The height of the page. The default is taken from the current paper size, see Paper size.
top-margin
- Margin between header and top of the page. Default is 5mm.
bottom-margin
- Margin between footer and bottom of the page. Default is 6mm.
left-margin
- Margin between the left side of the page and the beginning of the music. Unset by default, which means that the margins is determined based on the
paper-width
andline-width
to center the score on the paper.line-width
- The length of the systems. Default is
paper-width
minus 20mm.head-separation
- Distance between the top-most music system and the page header. Default is 4mm.
foot-separation
- Distance between the bottom-most music system and the page footer. Default is 4mm.
page-top-space
- Distance from the top of the printable area to the center of the first staff. This only works for staves which are vertically small. Big staves are set with the top of their bounding box aligned to the top of the printable area. Default is 12mm.
ragged-bottom
- If set to true, systems will not be spread vertically across the page. This does not affect the last page. Default is false.
This should be set to true for pieces that have only two or three systems per page, for example orchestral scores.
ragged-last-bottom
- If set to false, systems will be spread vertically to fill the last page. Default is true.
Pieces that amply fill two pages or more should have this set to true.
system-count
- This variable, if set, specifies into how many lines a score should be broken. Unset by default.
between-system-space
- This dimensions determines the distance between systems. It is the ideal distance between the center of the bottom staff of one system and the center of the top staff of the next system. Default is 20mm.
Increasing this will provide a more even appearance of the page at the cost of using more vertical space.
between-system-padding
- This dimension is the minimum amount of white space that will always be present between the bottom-most symbol of one system, and the top-most of the next system. Default is 4mm.
Increasing this will put systems whose bounding boxes almost touch farther apart.
page-breaking-between-system-padding
- This variable tricks the page breaker into thinking that
between-system-padding
is set to something different than it really is. For example, if this variable is set to something substantially larger thanbetween-system-padding
, then the page-breaker will put fewer systems on each page.horizontal-shift
- All systems (including titles and system separators) are shifted by this amount to the right. Page markup, such as headers and footers are not affected by this. The purpose of this variable is to make space for instrument names at the left. Default is 0.
after-title-space
- Amount of space between the title and the first system. Default is 5mm.
before-title-space
- Amount of space between the last system of the previous piece and the title of the next. Default is 10mm.
between-title-space
- Amount of space between consecutive titles (e.g., the title of the book and the title of a piece). Default is 2mm.
printallheaders
- Setting this to #t will print all headers for each \score in the output. Normally only the piece and opus \headers are printed.
systemSeparatorMarkup
- This contains a markup object, which will be inserted between systems. This is often used for orchestral scores. Unset by default.
The markup command
\slashSeparator
is provided as a sensible default, for exampleblank-page-force
- The penalty for having a blank page in the middle of a score. This is not used by
ly:optimal-breaking
since it will never consider blank pages in the middle of a score. Default value is 10.blank-last-page-force
- The penalty for ending the score on an odd-numbered page. Default value is 0.
page-spacing-weight
- The relative importance of page (vertical) spacing and line (horizontal) spacing. High values will make page spacing more important. Default value is 10.
auto-first-page-number
- The page breaking algorithm is affected by the first page number being odd or even. If this variable is set to #t, the page breaking algorithm will decide whether to start with an odd or even number. This will result in the first page number remaining as is or being increased by one.
The header and footer are created by the functions make-footer and make-header, defined in \paper. The default implementations are in ly/paper-defaults.ly and ly/titling-init.ly.
The page layout itself is done by two functions in the \paper block, page-music-height and page-make-stencil. The former tells the line-breaking algorithm how much space can be spent on a page, the latter creates the actual page given the system to put on it.
You can define paper block values in Scheme. In that case mm, in, pt, and cm are variables defined in paper-defaults.ly with values in millimeters. That is why the value 2 cm must be multiplied in the example
\paper { #(define bottom-margin (* 2 cm)) }
Example:
\paper{ paper-width = 2\cm top-margin = 3\cm bottom-margin = 3\cm ragged-last-bottom = ##t }
This second example centers page numbers at the bottom of every page.
\paper { print-page-number = ##t print-first-page-number = ##t oddHeaderMarkup = \markup \fill-line { " " } evenHeaderMarkup = \markup \fill-line { " " } oddFooterMarkup = \markup { \fill-line { \bold \fontsize #3 \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } } evenFooterMarkup = \markup { \fill-line { \bold \fontsize #3 \on-the-fly #print-page-number-check-first \fromproperty #'page:page-number-string } } }
You can also define these values in Scheme. In that case mm
,
in
, pt
, and cm
are variables defined in
paper-defaults.ly with values in millimeters. That is why the
value must be multiplied in the example
\paper { #(define bottom-margin (* 2 cm)) }
The header and footer are created by the functions make-footer
and make-header
, defined in \paper
. The default
implementations are in ly/paper-defaults.ly and
ly/titling-init.ly.
The page layout itself is done by two functions in the
\paper
block, page-music-height
and
page-make-stencil
. The former tells the line-breaking algorithm
how much space can be spent on a page, the latter creates the actual
page given the system to put on it.
The option right-margin is defined but doesn't set the right margin
yet. The value for the right margin has to be defined adjusting the
values of left-margin
and line-width
.
The default page header puts the page number and the instrument
field from the \header
block on a line.
The titles (from the \header{}
section) are treated as a
system, so ragged-bottom
and ragged-last-bottom
will
add space between the titles and the first system of the score.
The default staff size is set to 20 points. This may be changed in two ways:
To set the staff size globally for all scores in a file (or
in a book
block, to be precise), use set-global-staff-size
.
#(set-global-staff-size 14)
This sets the global default size to 14pt staff height and scales all fonts accordingly.
To set the staff size individually for each score, use
\score{ ... \layout{ #(layout-set-staff-size 15) } }
The Feta font provides musical symbols at eight different sizes. Each font is tuned for a different staff size: at a smaller size the font becomes heavier, to match the relatively heavier staff lines. The recommended font sizes are listed in the following table:
font name staff height (pt) staff height (mm) use
feta11 11.22 3.9 pocket scores
feta13 12.60 4.4
feta14 14.14 5.0
feta16 15.87 5.6
feta18 17.82 6.3 song books
feta20 20 7.0 standard parts
feta23 22.45 7.9
feta26 25.2 8.9
These fonts are available in any sizes. The context property
fontSize
and the layout property staff-space
(in
StaffSymbol) can be used to tune the size for individual
staves. The sizes of individual staves are relative to the global size.
This manual: Selecting notation font size.
layout-set-staff-size
does not change the distance between the
staff lines.
While \paper
contains settings that relate to the page formatting
of the whole document, \layout
contains settings for score-specific
layout.
\layout { indent = 2.0\cm \context { \Staff \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6) } \context { \Voice \override TextScript #'padding = #1.0 \override Glissando #'thickness = #3 } }
This manual: Changing context default settings.
Line breaks are normally determined automatically. They are chosen
so that lines look neither cramped nor loose, and consecutive
lines have similar density. Occasionally you might want to
override the automatic breaks; you can do this by specifying
\break
. This will force a line break at this point. However,
line breaks can only occur at the end of ‘complete’ bars, i.e.,
where there are no notes or tuplets left ‘hanging’ over the bar
line. If you want to have a line break where there is no bar line,
you can force an invisible bar line by entering \bar ""
,
although again there must be no notes left hanging over in any of
the staves at this point, or it will be ignored.
The opposite command, \noBreak
, forbids a line break at the
bar line where it is inserted.
The most basic settings influencing line spacing are indent
and line-width
. They are set in the \layout
block.
They control the indentation of the first line of music, and the
lengths of the lines.
If ragged-right
is set to true in the \layout
block,
then systems end at their natural horizontal length, instead of
being spread horizontally to fill the whole line. This is useful
for short fragments, and for checking how tight the natural
spacing is.
The option ragged-last
is similar to ragged-right
,
but affects only the last line of the piece.
\layout { indent = #0 line-width = #150 ragged-last = ##t }
For line breaks at regular intervals use \break
separated by
skips and repeated with \repeat
. For example, this would
cause the following 28 measures (assuming 4/4 time) to be broken
every 4 measures, and only there:
<< \repeat unfold 7 { s1 \noBreak s1 \noBreak s1 \noBreak s1 \break } the real music >>
Internals: LineBreakEvent.
A linebreaking configuration can be saved as a .ly
file
automatically. This allows vertical alignments to be stretched to
fit pages in a second formatting run. This is fairly new and
complicated. More details are available in
Spacing.
Line breaks can only occur if there is a ‘proper’ bar line. A note which is hanging over a bar line is not proper, such as
c4 c2 << c2 {s4 \break } >> % this does nothing c2 c4 | % a break here would work c4 c2 c4 ~ \break % as does this break c4 c2 c4
This can be avoided by removing the Forbid_line_break_engraver
.
Note that manually forced line breaks have to be added in parallel
with the music.
\new Voice \with { \remove Forbid_line_break_engraver } { c4 c2 << c2 {s4 \break } >> % now the break is allowed c2 c4 }
Similarly, line breaks are normally forbidden when beams cross bar
lines. This behavior can be changed by setting
\override Beam #'breakable = ##t
.
The default page breaking may be overridden by inserting
\pageBreak
or \noPageBreak
commands. These commands are
analogous to \break
and \noBreak
. They should be
inserted at a bar line. These commands force and forbid a page-break
from happening. Of course, the \pageBreak
command also forces
a line break.
The \pageBreak
and \noPageBreak
commands may also be
inserted at top-level, between scores and top-level markups.
There are also analogous settings to ragged-right
and
ragged-last
which have the same effect on vertical spacing:
ragged-bottom
and ragged-last-bottom
. If set to
##t
the systems on all pages or just the last page
respectively will not be justified vertically.
For more details see Vertical spacing.
Page breaks are computed by the page-breaking
function. LilyPond
provides three algorithms for computing page breaks,
ly:optimal-breaking
, ly:page-turn-breaking
and
ly:minimal-breaking
. The default is ly:optimal-breaking
,
but the value can be changed in the \paper
block:
\paper{ #(define page-breaking ly:page-turn-breaking) }
The old page breaking algorithm is called
optimal-page-breaks
. If you are having trouble with the new page
breakers, you can enable the old one as a workaround.
The ly:optimal-breaking
function is LilyPond's default method of
determining page breaks. It attempts to find a page breaking that minimizes
cramping and stretching, both horizontally and vertically. Unlike
ly:page-turn-breaking
, it has no concept of page turns.
Often it is necessary to find a page breaking configuration so that there is
a rest at the end of every second page. This way, the musician can turn the
page without having to miss notes. The ly:page-turn-breaking
function
attempts to find a page breaking minimizing cramping and stretching, but with
the additional restriction that it is only allowed to introduce page turns
in specified places.
There are two steps to using this page breaking function. First, you
must enable it in the \paper
block, as explained in Page breaking. Then you must tell the function where you would like to allow
page breaks.
There are two ways to achieve the second step. First, you can specify each
potential page turn manually, by inserting \allowPageTurn
into your
input file at the appropriate places.
If this is too tedious, you can add a Page_turn_engraver
to a Staff or
Voice context. The Page_turn_engraver
will scan the context for
sections without notes (note that it does not scan for rests; it scans for
the absence of notes. This is so that single-staff polyphony with rests in one
of the parts does not throw off the Page_turn_engraver
). When it finds
a sufficiently long section without notes, the Page_turn_engraver
will
insert an \allowPageTurn
at the final bar line in that section, unless
there is a ‘special’ bar line (such as a double bar), in which case the
\allowPageTurn
will be inserted at the final ‘special’ bar line in
the section.
The Page_turn_engraver
reads the context property
minimumPageTurnLength
to determine how long a note-free section must
be before a page turn is considered. The default value for
minimumPageTurnLength
is #(ly:make-moment 1 1)
. If you want
to disable page turns, you can set it to something very large.
\new Staff \with { \consists "Page_turn_engraver" } { a4 b c d | R1 | % a page turn will be allowed here a4 b c d | \set Staff.minimumPageTurnLength = #(ly:make-moment 5 2) R1 | % a page turn will not be allowed here a4 b r2 | R1*2 | % a page turn will be allowed here a1 }
The Page_turn_engraver
detects volta repeats. It will only allow a page
turn during the repeat if there is enough time at the beginning and end of the
repeat to turn the page back. The Page_turn_engraver
can also disable
page turns if the repeat is very short. If you set the context property
minimumRepeatLengthForPageTurn
then the Page_turn_engraver
will
only allow turns in repeats whose duration is longer than this value.
The page turning commands, \pageTurn
, \noPageTurn
and
\allowPageTurn
, may also be used at top-level, between scores and
top-level markups.
\pageTurn
\noPageTurn
\allowPageTurn
There should only be one Page_turn_engraver
in a score. If there is more
than one, they will interfere with each other.
The ly:minimal-breaking
function performs minimal computations to
calculate the page breaking: it fills a page with as many systems as
possible before moving to the next one. Thus, it may be preferred for
scores with many pages, where the other page breaking functions could be
too slow or memory demanding, or a lot of texts. It is enabled using:
\paper { #(define page-breaking ly:minimal-breaking) }
Lily sometimes rejects explicit \break
and \pageBreak
commands. There are two commands to override this behavior:
\override NonMusicalPaperColumn #'line-break-permission = ##f \override NonMusicalPaperColumn #'page-break-permission = ##f
When line-break-permission
is overridden to false, Lily will insert
line breaks at explicit \break
commands and nowhere else. When
page-break-permission
is overridden to false, Lily will insert
page breaks at explicit \pageBreak
commands and nowhere else.
\paper { indent = #0 ragged-right = ##t ragged-bottom = ##t } \score { \new Score \with { \override NonMusicalPaperColumn #'line-break-permission = ##f \override NonMusicalPaperColumn #'page-break-permission = ##f } { \new Staff { \repeat unfold 2 { c'8 c'8 c'8 c'8 } \break \repeat unfold 4 { c'8 c'8 c'8 c'8 } \break \repeat unfold 6 { c'8 c'8 c'8 c'8 } \break \repeat unfold 8 { c'8 c'8 c'8 c'8 } \pageBreak \repeat unfold 8 { c'8 c'8 c'8 c'8 } \break \repeat unfold 6 { c'8 c'8 c'8 c'8 } \break \repeat unfold 4 { c'8 c'8 c'8 c'8 } \break \repeat unfold 2 { c'8 c'8 c'8 c'8 } } } }
Line- and page-breaking information usually appears within note entry directly.
\new Score { \new Staff { \repeat unfold 2 { c'4 c'4 c'4 c'4 } \break \repeat unfold 3 { c'4 c'4 c'4 c'4 } } }
This makes \break
and \pageBreak
commands easy to enter but mixes
music entry with information that specifies how music should lay out
on the page. You can keep music entry and line- and page-breaking
information in two separate places by introducing an extra voice to
contain the breaks. This extra voice
contains only skips together with \break
, pageBreak
and other
breaking layout information.
\new Score { \new Staff << \new Voice { s1 * 2 \break s1 * 3 \break s1 * 6 \break s1 * 5 \break } \new Voice { \repeat unfold 2 { c'4 c'4 c'4 c'4 } \repeat unfold 3 { c'4 c'4 c'4 c'4 } \repeat unfold 6 { c'4 c'4 c'4 c'4 } \repeat unfold 5 { c'4 c'4 c'4 c'4 } } >> }
This pattern becomes especially helpful when overriding
line-break-system-details
and the other useful but long properties of
NonMusicalPaperColumnGrob
, as explained in Vertical spacing.
\new Score { \new Staff << \new Voice { \overrideProperty "Score.NonMusicalPaperColumn" #'line-break-system-details #'((Y-offset . 0)) s1 * 2 \break \overrideProperty "Score.NonMusicalPaperColumn" #'line-break-system-details #'((Y-offset . 35)) s1 * 3 \break \overrideProperty "Score.NonMusicalPaperColumn" #'line-break-system-details #'((Y-offset . 70)) s1 * 6 \break \overrideProperty "Score.NonMusicalPaperColumn" #'line-break-system-details #'((Y-offset . 105)) s1 * 5 \break } \new Voice { \repeat unfold 2 { c'4 c'4 c'4 c'4 } \repeat unfold 3 { c'4 c'4 c'4 c'4 } \repeat unfold 6 { c'4 c'4 c'4 c'4 } \repeat unfold 5 { c'4 c'4 c'4 c'4 } } >> }
Vertical spacing is controlled by three things: the amount of space available (i.e., paper size and margins), the amount of space between systems, and the amount of space between staves inside a system.
The height of each system is determined automatically. To prevent staves from bumping into each other, some minimum distances are set. By changing these, you can put staves closer together. This reduces the amount of space each system requires, and may result in having more systems per page.
Normally staves are stacked vertically. To make staves maintain a
distance, their vertical size is padded. This is done with the
property minimum-Y-extent
. When applied to a
VerticalAxisGroup, it controls the size of a horizontal
line, such as a staff or a line of lyrics. minimum-Y-extent
takes a pair of numbers, so
if you want to make it smaller than its default #'(-4 . 4)
then you could set
\override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
This sets the vertical size of the current staff to 3 staff spaces on
either side of the center staff line. The value (-3 . 3)
is
interpreted as an interval, where the center line is the 0, so the
first number is generally negative. The numbers need not match;
for example, the staff can be made larger at the bottom by setting
it to (-6 . 4)
.
After page breaks are determined, the vertical spacing within each
system is reevaluated in order to fill the page more evenly; if a page
has space left over, systems are stretched in order to fill that space.
The amount of stretching can be configured though the max-stretch
property of the VerticalAlignment grob. By default,
max-stretch
is set to zero, disabling stretching. To enable
stretching, a sane value for max-stretch
is ly:align-interface::calc-max-stretch
.
In some situations, you may want to stretch most of a system while
leaving some parts fixed. For example, if a piano part occurs in the
middle of an orchestral score, you may want to leave the piano staves
close to each other while stretching the rest of the score. The
keep-fixed-while-stretching
property of
VerticalAxisGroup can be used to achieve this. When set
to ##t
, this property keeps its staff (or line of lyrics) from
moving relative to the one directly above it. In the example above,
you would override keep-fixed-while-stretching
to ##t
in
the second piano staff:
#(set-default-paper-size "a6") #(set-global-staff-size 14.0) \book { \paper { ragged-last-bottom = ##f } \new Score \with { \override VerticalAlignment #'max-stretch = #ly:align-interface::calc-max-stretch } { \new GrandStaff << \new StaffGroup << \new Staff {c' d' e' f'} \new Staff {c' d' e' f'} \new Staff {c' d' e' f'} >> \new PianoStaff << \new Staff {c' d' e' f'} \new Staff \with { \override VerticalAxisGroup #'keep-fixed-while-stretching = ##t } {c' d' e' f'} >> \new StaffGroup << \new Staff {c' d' e' f'} \new Staff {c' d' e' f'} >> >> } }
Internals: Vertical alignment of staves is handled by the VerticalAlignment object. The context parameters specifying the vertical extent are described in connection with the Axis_group_engraver.
Example files:
Space between systems are controlled by four \paper
variables,
\paper { between-system-space = 1.5\cm between-system-padding = #1 ragged-bottom=##f ragged-last-bottom=##f }
When only a couple of flat systems are placed on a page, the resulting
vertical spacing may be non-elegant: one system at the top of the page,
and the other at the bottom, with a huge gap between them. To avoid this
situation, the space added between the systems can be limited. This
feature is activated by setting to #t
the
page-limit-inter-system-space
variable in the \paper
block. The paper variable page-limit-inter-system-space-factor
determines how much the space can be increased: for instance, the value
1.3
means that the space can be 30% larger than what it would be
on a ragged-bottom page.
In the following example, if the inter system space were not limited,
the second system of page 1 would be placed at the page bottom. By
activating the space limitation, the second system is placed closer to
the first one. By setting page-limit-inter-system-space-factor
to
1
, the spacing would the same as on a ragged-bottom page, like
the last one.
#(set-default-paper-size "a6") \book { \paper { page-limit-inter-system-space = ##t page-limit-inter-system-space-factor = 1.3 oddFooterMarkup = \markup "page bottom" evenFooterMarkup = \markup "page bottom" oddHeaderMarkup = \markup \fill-line { "page top" \fromproperty #'page:page-number-string } evenHeaderMarkup = \markup \fill-line { "page top" \fromproperty #'page:page-number-string } } \new Staff << \repeat unfold 4 { g'4 g' g' g' \break } { s1*2 \pageBreak } >> }
One way to understand the VerticalAxisGroup
and \paper
settings explained in the previous two sections is as a collection of
different settings that primarily concern the amount of vertical padding
different staves and systems running down the page.
It is possible to approach vertical spacing in a different way using
NonMusicalPaperColumn #'line-break-system-details
. Where
VerticalAxisGroup
and \paper
settings specify vertical padding,
NonMusicalPaperColumn #'line-break-system-details
specifies exact
vertical positions on the page.
NonMusicalPaperColumn #'line-break-system-details
accepts an associative
list of five different settings:
X-offset
Y-offset
alignment-offsets
alignment-extra-space
fixed-alignment-extra-space
Grob overrides, including the overrides for NonMusicalPaperColumn
below, can occur in any of three different places in an input file:
\context
block
\with
block
When we override NonMusicalPaperColumn
, we use the usual
\override
command in \context
blocks and in the
\with
block. On the other hand, when we override
NonMusicalPaperColumn
in the middle of note entry,
use the special \overrideProperty
command. Here are some
example NonMusicalPaperColumn
overrides with the special
\overrideProperty
command:
\overrideProperty NonMusicalPaperColumn #'line-break-system-details #'((X-offset . 20)) \overrideProperty NonMusicalPaperColumn #'line-break-system-details #'((Y-offset . 40)) \overrideProperty NonMusicalPaperColumn #'line-break-system-details #'((X-offset . 20) (Y-offset . 40)) \override NonMusicalPaperColumn #'line-break-system-details #'((alignment-offsets . (0 -15))) \override NonMusicalPaperColumn #'line-break-system-details #'((X-offset . 20) (Y-offset . 40) (alignment-offsets . (0 -15)))
To understand how each of these different settings work, we begin by looking at an example that includes no overrides at all.
This score isolates line- and page-breaking information in a dedicated voice. This technique of creating a breaks voice will help keep layout separate from music entry as our example becomes more complicated. See Using an extra voice for breaks.
Explicit \breaks
evenly divide the music into six measures per
line. Vertical spacing results from LilyPond's defaults. To set
the vertical startpoint of each system explicitly, we can set
the Y-offset
pair in the line-break-system-details
attribute of the NonMusicalPaperColumn
grob:
Note that line-break-system-details
takes an associative list of
potentially many values, but that we set only one value here. Note,
too, that the Y-offset
property here determines the exact vertical
position on the page at which each new system will render.
Now that we have set the vertical startpoint of each system
explicitly, we can also set the vertical startpoint of each staff
within each system manually. We do this using the alignment-offsets
subproperty of line-break-system-details
.
Note that here we assign two different values to the
line-break-system-details
attribute of the
NonMusicalPaperColumn
grob. Though the
line-break-system-details
attribute alist accepts many
additional spacing parameters (including, for example, a corresponding
X-offset
pair), we need only set the Y-offset
and
alignment-offsets
pairs to control the vertical startpoint of
every system and every staff. Finally, note that alignment-offsets
specifies the vertical positioning of staves but not of staff groups.
Some points to consider:
alignment-offsets
, lyrics count as a staff.
X-offset
,
Y-offset
and alignment-offsets
are interpreted as multiples
of the distance between adjacent staff lines. Positive values move staves
and lyrics up, negative values move staves and lyrics down.
NonMusicalPaperColumn #'line-break-system-details
settings given here allow the positioning of staves and systems anywhere
on the page, it is possible to violate paper or margin boundaries or even
to print staves or systems on top of one another. Reasonable values
passed to these different settings will avoid this.
Warning: two-pass vertical spacing is deprecated and will be removed in a future version of LilyPond. Systems are now stretched automatically in a single pass. See Vertical spacing inside a system.
In order to automatically stretch systems so that they should fill the space left on a page, a two-pass technique can be used:
The ragged-bottom
property adds space between systems, while
the two-pass technique adds space between staves inside a system.
To allow this behavior, a tweak-key
variable has to be set in
each score \layout
block, and the tweaks included in each score
music, using the \scoreTweak
music function.
%% include the generated page layout file: \includePageLayoutFile \score { \new StaffGroup << \new Staff << %% Include this score tweaks: \scoreTweak "scoreA" { \clef french c''1 \break c''1 } >> \new Staff { \clef soprano g'1 g'1 } \new Staff { \clef mezzosoprano e'1 e'1 } \new Staff { \clef alto g1 g1 } \new Staff { \clef bass c1 c1 } >> \header { piece = "Score with tweaks" } %% Define how to name the tweaks for this score: \layout { #(define tweak-key "scoreA") } }
For the first pass, the dump-tweaks
option should be set to
generate the page layout file.
lilypond -dbackend=null -d dump-tweaks <file>.ly lilypond <file>.ly
Intuitively, there are some objects in musical notation that belong to the staff and there are other objects that should be placed outside the staff. Objects belonging outside the staff include things such as rehearsal marks, text and dynamic markings (from now on, these will be called outside-staff objects). LilyPond's rule for the vertical placement of outside-staff objects is to place them as close to the staff as possible but not so close that they collide with another object.
LilyPond uses the outside-staff-priority
property to determine
whether a grob is an outside-staff object: if outside-staff-priority
is a number, the grob is an outside-staff object. In addition,
outside-staff-priority
tells LilyPond in which order the objects
should be placed.
First, LilyPond places all the objects that do not belong outside
the staff. Then it sorts the outside-staff objects according to their
outside-staff-priority
(in increasing order). One by one, LilyPond
takes the outside-staff objects and places them so that they do
not collide with any objects that have already been placed. That
is, if two outside-staff grobs are competing for the same space, the one
with the lower outside-staff-priority
will be placed closer to
the staff.
c4_"Text"\pp r2. \once \override TextScript #'outside-staff-priority = #1 c4_"Text"\pp % this time the text will be closer to the staff r2. % by setting outside-staff-priority to a non-number, % we disable the automatic collision avoidance \once \override TextScript #'outside-staff-priority = ##f \once \override DynamicLineSpanner #'outside-staff-priority = ##f c4_"Text"\pp % now they will collide
The vertical padding between an outside-staff object and the
previously-positioned grobs can be controlled with
outside-staff-padding
.
\once \override TextScript #'outside-staff-padding = #0 a'^"This text is placed very close to the note" \once \override TextScript #'outside-staff-padding = #3 c^"This text is padded away from the previous text" c^"This text is placed close to the previous text"
TODO: this example doesn't work any more ?
By default, outside-staff objects are placed without regard to
their horizontal distance from the previously-positioned grobs. This
can lead to situations in which objects are placed very close to each
other horizontally. Setting outside-staff-horizontal-padding
causes an object to be offset vertically so that such a situation
doesn't occur.
% the markup is too close to the following note c2^"Text" c''2 % setting outside-staff-horizontal-padding fixes this R1 \once \override TextScript #'outside-staff-horizontal-padding = #1 c,,2^"Text" c''2
The spacing engine translates differences in durations into stretchable
distances (‘springs’) of differing lengths. Longer durations get
more space, shorter durations get less. The shortest durations get a
fixed amount of space (which is controlled by
shortest-duration-space
in the SpacingSpanner
object). The longer the duration, the more space it gets: doubling a
duration adds a fixed amount (this amount is controlled by
spacing-increment
) of space to the note.
For example, the following piece contains lots of half, quarter, and 8th notes; the eighth note is followed by 1 note head width (NHW). The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
c2 c4. c8 c4. c8 c4. c8 c8 c8 c4 c4 c4
Normally, spacing-increment
is set to 1.2 staff space, which is
approximately the width of a note head, and
shortest-duration-space
is set to 2.0, meaning that the
shortest note gets 2.4 staff space (2.0 times the
spacing-increment
) of horizontal space. This space is counted
from the left edge of the symbol, so the shortest notes are generally
followed by one NHW of space.
If one would follow the above procedure exactly, then adding a single 32nd note to a score that uses 8th and 16th notes, would widen up the entire score a lot. The shortest note is no longer a 16th, but a 32nd, thus adding 1 NHW to every note. To prevent this, the shortest duration for spacing is not the shortest note in the score, but rather the one which occurs most frequently.
The most common shortest duration is determined as follows: in every
measure, the shortest duration is determined. The most common shortest
duration is taken as the basis for the spacing, with the stipulation
that this shortest duration should always be equal to or shorter than
an 8th note. The shortest duration is printed when you run
lilypond
with the --verbose
option.
These durations may also be customized. If you set the
common-shortest-duration
in SpacingSpanner, then
this sets the base duration for spacing. The maximum duration for this
base (normally an 8th), is set through base-shortest-duration
.
Notes that are even shorter than the common shortest note are followed by a space that is proportional to their duration relative to the common shortest note. So if we were to add only a few 16th notes to the example above, they would be followed by half a NHW:
c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4
In the introduction (see Engraving), it was explained that stem
directions influence spacing. This is controlled with the
stem-spacing-correction
property in the
NoteSpacing, object. These are generated for every
Voice context. The StaffSpacing
object
(generated in Staff context) contains the same property
for controlling the stem/bar line spacing. The following example shows
these corrections, once with default settings, and once with
exaggerated corrections:
Proportional notation is supported; see Proportional notation.
Internals: SpacingSpanner, NoteSpacing, StaffSpacing, and SeparationItem.
There is no convenient mechanism to manually override spacing. The following work-around may be used to insert extra space into a score.
\once \override Score.SeparationItem #'padding = #1
No work-around exists for decreasing the amount of space.
New sections with different spacing parameters can be started with
newSpacingSection
. This is useful when there are
sections with a different notions of long and short notes.
In the following example, the time signature change introduces a new section, and hence the 16ths notes are spaced wider.
\time 2/4 c4 c8 c c8 c c4 c16[ c c8] c4 \newSpacingSection \time 4/16 c16[ c c8]
The \newSpacingSection
command creates a new
SpacingSpanner object, and hence new \override
s
may be used in that location.
Horizontal spacing may be altered with the
base-shortest-duration
property. Here
we compare the same music; once without altering
the property, and then altered. Larger values
of ly:make-moment
will produce smaller
music. Note that ly:make-moment
constructs
a duration, so 1 4
is a longer duration
than 1 16
.
\score { \relative c'' { g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 | g4 e e2 | f4 d d2 | c4 e g g | c,1 | d4 d d d | d4 e f2 | e4 e e e | e4 f g2 | g4 e e2 | f4 d d2 | c4 e g g | c,1 | } }
\score { \relative c'' { g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 | g4 e e2 | f4 d d2 | c4 e g g | c,1 | d4 d d d | d4 e f2 | e4 e e e | e4 f g2 | g4 e e2 | f4 d d2 | c4 e g g | c,1 | } \layout { \context { \Score \override SpacingSpanner #'base-shortest-duration = #(ly:make-moment 1 16) } } }
By default, spacing in tuplets depends on various non-duration
factors (such as accidentals, clef changes, etc). To disregard
such symbols and force uniform equal-duration spacing, use
Score.SpacingSpanner #'uniform-stretching
. This
property can only be changed at the beginning of a score,
\new Score \with { \override SpacingSpanner #'uniform-stretching = ##t } << \new Staff{ \times 4/5 { c8 c8 c8 c8 c8 } c8 c8 c8 c8 } \new Staff{ c8 c8 c8 c8 \times 4/5 { c8 c8 c8 c8 c8 } } >>
When strict-note-spacing
is set, notes are spaced without
regard for clefs, bar lines, and grace notes,
\override Score.SpacingSpanner #'strict-note-spacing = ##t \new Staff { c8[ c \clef alto c \grace { c16[ c] } c8 c c] c32[ c32] }
The most basic settings influencing the spacing are indent
and
line-width
. They are set in the \layout
block. They
control the indentation of the first line of music, and the lengths of
the lines.
If ragged-right
is set to true in the \layout
block, then
systems ends at their natural horizontal length, instead of being spread
horizontally to fill the whole line. This is useful for
short fragments, and for checking how tight the natural spacing is.
The option ragged-last
is similar to ragged-right
, but
only affects the last line of the piece. No restrictions are put on
that line. The result is similar to formatting text paragraphs. In a
paragraph, the last line simply takes its natural horizontal length.
\layout { indent = #0 line-width = #150 ragged-last = ##t }
LilyPond supports proportional notation, a type of horizontal spacing in which each note consumes an amount of horizontal space exactly equivalent to its rhythmic duration. This type of proportional spacing is comparable to horizontal spacing on top of graph paper. Some late 20th- and early 21st-century scores use proportional notation to clarify complex rhythmic relationships or to facilitate the placement of timelines or other graphics directly in the score.
LilyPond supports five different settings for proportional notation, which may be used together or alone:
proportionalNotationDuration
uniform-stretching
strict-note-spacing
\remove Separating_line_group_engraver
\override PaperColumn #'used = ##t
In the examples that follow, we explore these five different proportional notation settings and examine how these settings interact.
We start with the following one-measure example, which uses classical spacing with ragged-right turned on.
\new Score << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } >>
Notice that the half note which begins the measure takes up far less than half of the horizontal space of the measure. Likewise, the sixteenth notes and sixteenth-note quintuplets (or twentieth notes) which end the measure together take up far more than half the horizontal space of the measure.
In classical engraving, this spacing may be exactly what we want because we can borrow horizontal space from the half note and conserve horizontal space across the measure as a whole.
On the other hand, if we want to insert a measured timeline or other graphic above or below our score, we need proportional notation. We turn proportional notation on with the proportionalNotationDuration setting.
\new Score \with { proportionalNotationDuration = #(ly:make-moment 1 20) } << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } >>
The half note at the beginning of the measure and the faster notes in the second half of the measure now occupy equal amounts of horizontal space. We could place a measured timeline or graphic above or below this example.
The proportionalNotationDuration
setting is a context setting that
lives in Score
. Recall that context settings appear in one of
three locations in our input file – in a \with
block, in a
\context
block, or directly in music entry
preceded by the \set
command. As with all
context settings, users can pick which of the three different
locations they would like to set proportionalNotationDuration
.
The proportionalNotationDuration
setting takes a single argument,
which is the reference duration against which all music will be
spaced. The LilyPond Scheme function make-moment takes two arguments
– a numerator and denominator which together express some fraction of
a whole note. The call #(ly:make-moment 1 20)
therefore produces a
reference duration of a twentieth note. The values
#(ly:make-moment 1 16)
, #(ly:make-moment 1 8)
, and
#(ly:make-moment 3 97)
are all possible as well.
How do we select the right reference duration to pass to
proportionalNotationDuration
? Usually by a process of trial and error,
beginning with a duration close to the fastest (or smallest) duration
in the piece. Smaller reference durations space music loosely; larger
reference durations space music tightly.
\new Score \with { proportionalNotationDuration = #(ly:make-moment 1 8) } << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } >> \new Score \with { proportionalNotationDuration = #(ly:make-moment 1 16) } << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } >> \new Score \with { proportionalNotationDuration = #(ly:make-moment 1 32) } << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } >>
Note that too large a reference duration – such as the eighth note, above – spaces music too tightly and can cause note head collisions. Note also that proportional notation in general takes up more horizontal space that does classical spacing. Proportional spacing provides rhythmic clarity at the expense of horizontal space.
Next we examine how to optimally space overlapping tuplets.
We start by examining what happens to our original example, with classical spacing, when we add a second staff with a different type of tuplet.
\new Score << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } \new RhythmicStaff { \times 8/9 { c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 } } >>
The spacing is bad because the evenly notes of the bottom staff do not
stretch uniformly. Classical engraving includes very few complex
triplets and so classical engraving rules can generate this type of
result. Setting proportionalNotationDuration
remedies this
situation considerably.
\new Score \with { proportionalNotationDuration = #(ly:make-moment 1 20) } << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } \new RhythmicStaff { \times 8/9 { c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 } } >>
But if we look very carefully we can see that notes of the second half
of the 9-tuplet space ever so slightly more widely than do the notes
of the first half of the 9-tuplet. To ensure uniform stretching, we
turn on uniform-stretching
, which is a property of
SpacingSpanner
.
\new Score \with { proportionalNotationDuration = #(ly:make-moment 1 20) \override SpacingSpanner #'uniform-stretching = ##t } << \new RhythmicStaff { c'2 c'16 c'16 c'16 c'16 \times 4/5 { c'16 c'16 c'16 c'16 c'16 } } \new RhythmicStaff { \times 8/9 { c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 c'8 } } >>
Our two-staff example now spaces exactly, our rhythmic relationships are visually clear, and we can include a measured timeline or graphic if we want.
Note that the LilyPond's proportional notation package expects that all proportional scores set the SpacingSpanner's 'uniform-stretching attribute to ##t. Setting proportionalNotationDuration without also setting the SpacingSpanner's 'uniform-stretching attribute to ##t will, for example, cause Skips to consume an incorrect amount of horizontal space.
The SpacingSpanner is an abstract grob that lives in the Score context. As with our settings of proportionalNotationDuration, overrides to the SpacingSpanner can occur in any of three different places in our input file – in the Score \with block, in a Score \context block, or in note entry directly.
There is by default only one SpacingSpanner
per Score
. This
means that, by default, uniform-stretching
is either turned on for the
entire score or turned off for the entire score. We can, however,
override this behavior and turn on different spacing features at
different places in the score. We do this with the command
\newSpacingSection
. See New spacing area, for more info.
Next we examine the effects of the Separating_line_group_engraver
and
see why proportional scores frequently remove this engraver. The following
example shows that there is a small amount of “preferatory” space
just before the first note in each system.
\paper { indent = #0 } \new Staff { c'1 \break c'1 }
The amount of this preferatory space is the same whether after a time
signature, a key signature or a clef. Separating_line_group_engraver
is responsible for this space. Removing Separating_line_group_engraver
reduces this space to zero.
\paper { indent = #0 } \new Staff \with { \remove Separating_line_group_engraver } { c'1 \break c'1 }
Nonmusical elements like time signatures, key signatures, clefs and accidentals are problematic in proportional notation. None of these elements has rhythmic duration. But all of these elements consume horizontal space. Different proportional scores approach these problems differently.
It may be possible to avoid spacing problems with key signatures simply by not having any. This is a valid option since most proportional scores are contemporary music. The same may be true of time signatures, especially for those scores that include a measured timeline or other graphic. But these scores are exceptional and most proportional scores include at least some time signatures. Clefs and accidentals are even more essential.
So what strategies exist for spacing nonmusical elements in a
proportional context? One good option is the strict-note-spacing
property of SpacingSpanner
. Compare the two scores below:
\new Staff { \set Score.proportionalNotationDuration = #(ly:make-moment 1 16) c''8 c''8 c''8 \clef alto d'8 d'2 } \new Staff { \set Score.proportionalNotationDuration = #(ly:make-moment 1 16) \override Score.SpacingSpanner #'strict-note-spacing = ##t c''8 c''8 c''8 \clef alto d'8 d'2 }
Both scores are proportional, but the spacing in the first score is too loose because of the clef change. The spacing of the second score remains strict, however, because strict-note-spacing is turned on. Turning on strict-note-spacing causes the width of time signatures, key signatures, clefs and accidentals to play no part in the spacing algorithm.
In addition to the settings given here, there are other settings that frequently appear in proportional scores. These include:
\override SpacingSpanner #'strict-grace-spacing = ##t
tupletFullLength = ##t
\override Beam #'breakable = ##t
\override Glissando #'breakable = ##t
\override TextSpanner #'breakable = ##t
\remove Forbid_line_break_engraver in the Voice context
These settings space grace notes strictly, extend tuplet brackets to mark both rhythmic start- and stop-points, and allow spanning elements to break across systems and pages. See the respective parts of the manual for these related settings.
Sometimes you can end up with one or two staves on a second (or third, or fourth...) page. This is annoying, especially if you look at previous pages and it looks like there is plenty of room left on those.
When investigating layout issues, annotate-spacing
is an
invaluable tool. This command prints the values of various layout
spacing variables; for more details see the following section,
Displaying spacing.
To graphically display the dimensions of vertical layout variables
that may be altered for page formatting, set
annotate-spacing
in the \paper
block:
#(set-default-paper-size "a6" 'landscape) \book { \score { { c4 } } \paper { annotate-spacing = ##t } }
All layout dimensions are displayed in staff spaces, regardless of
the units specified in the \paper
or \layout
block.
For example, paper-height
has a value of 59.75 staff
spaces, using the default staff size of 20 points, which is
equivalent to 148 millimeters, the height of a6
paper in
landscape orientation. The pairs (a,b) are intervals,
where a is the lower edge and b the upper edge of the
interval.
The output of annotate-spacing
reveals vertical dimensions
in great detail. For details about modifying margins and other
layout variables, see Page formatting.
Other than margins, there are a few other options to save space:
\paper { between-system-padding = #0.1 between-system-space = #0.1 ragged-last-bottom = ##f ragged-bottom = ##f }
\paper { system-count = #10 }
e4 c g\f c \override DynamicText #'extra-offset = #'( -2.2 . 2.0) e4 c g\f c
SpacingSpanner
. For more
details, see Changing horizontal spacing. The following
example illustrates the default spacing:
\score { \relative c'' { g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 | g4 e e2 | } }
The next example modifies common-shortest-duration
from a
value of 1/4
to 1/2
. The quarter note is the most
common and shortest duration in this example, so by making this
duration longer, a ‘squeezing’ effect occurs:
\score { \relative c'' { g4 e e2 | f4 d d2 | c4 d e f | g4 g g2 | g4 e e2 | } \layout { \context { \Score \override SpacingSpanner #'common-shortest-duration = #(ly:make-moment 1 2) } } }
The common-shortest-duration
property cannot be modified
dynamically, so it must always be placed in a \context
block so that it applies to the whole score.
Notation Reference: Page formatting, Changing horizontal spacing.
N.B. This Chapter is still being developed at present.
The purpose of LilyPond's design is to provide the finest quality output by default. Nevertheless, it may happen that you need to change this default layout. The layout is controlled through a large number of ‘knobs and switches’ collectively called ‘properties’. A tutorial introduction to accessing and modifying these properties can be found in the Learning Manual, see Tweaking output. This should be read first. This chapter covers similar ground, but in a style more appropriate to a reference manual.
The definitive description of the controls available for tuning can be found in a separate document: the Internals Reference. That manual lists all the variables, functions and options available in LilyPond. It is written as a HTML document, which is available on-line, and is also included with the LilyPond documentation package.
This section describes what contexts are, and how to modify them.
Contexts are arranged heirarchically:
This is the top level notation context. No other context can contain a Score context. By default the Score context handles the administration of time signatures and makes sure that items such as clefs, time signatures, and key-signatures are aligned across staves.
A Score context is instantiated implicitly when a
\score {...}
or \layout {...}
block is
processed, or explicitly when a \new Score
command is
executed.
StaffGroup
Groups staves while adding a bracket on the left side, grouping the staves together. The bar lines of the contained staves are connected vertically. StaffGroup only consists of a collection of staves, with a bracket in front and spanning bar lines.
ChoirStaff
Identical to StaffGroup except that the bar lines of the contained staves are not connected vertically.
GrandStaff
A group of staves, with a brace on the left side, grouping the staves together. The bar lines of the contained staves are connected vertically.
PianoStaff
TODO No longer correct? Check. -td
Just like GrandStaff but with a forced distance between the staves, so cross staff beaming and slurring can be used.
InnerStaffGroup
TODO -td
InnerChoirStaff
TODO -td
Staff
Handles clefs, bar lines, keys, accidentals. It can contain Voice contexts.
RhythmicStaff
Like Staff but for printing rhythms. Pitches are ignored; the notes are printed on one line.
TabStaff
Context for generating tablature. By default lays the music expression out as a guitar tablature, printed on six lines.
DrumStaff
Handles typesetting for percussion. Can contain DrumVoice
VaticanaStaff
Same as Staff, except that it is designed for typesetting a piece in gregorian style.
MensuralStaff
Same as Staff, except that it is designed for typesetting a piece in mensural style.
Voice-level contexts initialise certain properties and start appropriate engravers. Being bottom-level contexts, they cannot contain other contexts.
Voice
Corresponds to a voice on a staff. This context handles the conversion of dynamic signs, stems, beams, super- and sub-scripts, slurs, ties, and rests. You have to instantiate this explicitly if you require multiple voices on the same staff.
VaticanaVoice
Same as Voice, except that it is designed for typesetting a piece in gregorian style.
MensuralVoice
Same as Voice, with modifications for typesetting a piece in mensural style.
Lyrics
Corresponds to a voice with lyrics. Handles the printing of a single line of lyrics.
DrumVoice
The voice context used in a percussion staff.
FiguredBass
The context in which BassFigure objects are created from
input entered in \figuremode
mode.
TabVoice
The voice context used within a TabStaff context. Usually left to be created implicitly.
ChordNames
Typesets chord names.
——————————————–
TODO
Then the following, which I don't know what to do with:
* GregorianTranscriptionVoice * GregorianTranscriptionStaff
* FretBoards Engraves fretboards from chords. Not easy... Not documented. There is now some documentation on FretBoards in the NR, under instrument-specific notation – cds.
* NoteNames
* CueVoice Not documented * Global Hard coded entry point for LilyPond. Cannot be tuned. * Devnull Silently discards all musical information given to this context.
For scores with only one voice and one staff, contexts are created automatically. For more complex scores, it is necessary to create them by hand. There are three commands that do this.
\new
, and it also the quickest to type.
It is prepended to a music expression, for example
\new type music expression
where type is a context name (like Staff
or
Voice
). This command creates a new context, and starts
interpreting the music expression with that.
A practical application of \new
is a score with many
staves. Each part that should be on its own staff, is preceded with
\new Staff
.
<< \new Staff { c4 c } \new Staff { d4 d } >>
The \new
command may also give a name to the context,
\new type = id music
However, this user specified name is only used if there is no other context already earlier with the same name.
\new
, the \context
command also directs a music
expression to a context object, but gives the context an explicit name. The
syntax is
\context type = id music
This form will search for an existing context of type type called id. If that context does not exist yet, a new context with the specified name is created. This is useful if the context is referred to later on. For example, when setting lyrics the melody is in a named context
\context Voice = "tenor" music
so the texts can be properly aligned to its notes,
\new Lyrics \lyricsto "tenor" lyrics
Another possible use of named contexts is funneling two different music expressions into one context. In the following example, articulations and notes are entered separately,
music = { c4 c4 } arts = { s4-. s4-> }
They are combined by sending both to the same Voice
context,
<< \new Staff \context Voice = "A" \music \context Voice = "A" \arts >>
With this mechanism, it is possible to define an Urtext (original edition), with the option to put several distinct articulations on the same notes.
\context type music
This is similar to \context
with =
id, but matches
any context of type type, regardless of its given name.
This variant is used with music expressions that can be interpreted at
several levels. For example, the \applyOutput
command (see
Running a function on all layout objects). Without an explicit
\context
, it is usually applied to Voice
\applyOutput #'context #function % apply to Voice
To have it interpreted at the Score
or Staff
level use
these forms
\applyOutput #'Score #function \applyOutput #'Staff #function
Notation contexts (like Score
and Staff
) not only
store properties,
they also contain plug-ins called ‘engravers’ that create notation
elements. For example, the Voice
context contains a
Note_head_engraver
and the Staff
context contains a
Key_signature_engraver
.
For a full a description of each plug-in, see Engravers and Performers. Every context described in Contexts lists the engravers used for that context.
It can be useful to shuffle around these plug-ins. This is done by
starting a new context with \new
or \context
, and
modifying it,
\new context \with { \consists ... \consists ... \remove ... \remove ... etc. } { ..music.. }
where the ... should be the name of an engraver. Here is a simple
example which removes Time_signature_engraver
and
Clef_engraver
from a Staff
context,
<< \new Staff { f2 g } \new Staff \with { \remove "Time_signature_engraver" \remove "Clef_engraver" } { f2 g2 } >>
In the second staff there are no time signature or clef symbols. This is a rather crude method of making objects disappear since it will affect the entire staff. This method also influences the spacing, which may or may not be desirable. More sophisticated methods of blanking objects are shown in Visibility and color of objects.
The next example shows a practical application. Bar lines and time
signatures are normally synchronized across the score. This is done
by the Timing_translator
and Default_bar_line_engraver
.
This plug-in keeps an administration of time signature, location
within the measure, etc. By moving these engraver from Score
to
Staff
context, we can have a score where each staff has its own
time signature.
\new Score \with { \remove "Timing_translator" \remove "Default_bar_line_engraver" } << \new Staff \with { \consists "Timing_translator" \consists "Default_bar_line_engraver" } { \time 3/4 c4 c c c c c } \new Staff \with { \consists "Timing_translator" \consists "Default_bar_line_engraver" } { \time 2/4 c4 c c c c c } >>
The adjustments of the previous subsections (
The set command, Modifying context plug-ins, and
Overview of modifying properties) can also be entered
separately from the music in the \layout
block,
\layout { ... \context { \Staff \set fontSize = #-2 \override Stem #'thickness = #4.0 \remove "Time_signature_engraver" } }
The \Staff
command brings in the existing definition of the
staff context so that it can be modified.
The statements
\set fontSize = #-2 \override Stem #'thickness = #4.0 \remove "Time_signature_engraver"
affect all staves in the score. Other contexts can be modified analogously.
The \set
keyword is optional within the \layout
block, so
\context { ... fontSize = #-2 }
will also work.
It is not possible to collect context changes in a variable and apply
them to a \context
definition by referring to that variable.
The \RemoveEmptyStaffContext
will overwrite your current
\Staff
settings. If you wish to change the defaults for a
staff which uses \RemoveEmptyStaffContext
, you must do so
after calling \RemoveEmptyStaffContext
, ie
\layout { \context { \RemoveEmptyStaffContext \override Stem #'thickness = #4.0 } }
TODO: add \with in here.
Specific contexts, like Staff
and Voice
, are made of
simple building blocks. It is possible to create new types of
contexts with different combinations of engraver plug-ins.
The next example shows how to build a different type of
Voice
context from scratch. It will be similar to
Voice
, but only prints centered slash note heads. It can be used
to indicate improvisation in jazz pieces,
These settings are defined within a \context
block inside a
\layout
block,
\layout { \context { ... } }
In the following discussion, the example input shown should go in place of the ... in the previous fragment.
First it is necessary to define a name for the new context:
\name ImproVoice
Since it is similar to the Voice
, we want commands that work
on (existing) Voice
s to remain working. This is achieved by
giving the new context an alias Voice
,
\alias Voice
The context will print notes and instructive texts, so we need to add the engravers which provide this functionality,
\consists Note_heads_engraver \consists Text_engraver
but we only need this on the center line,
\consists Pitch_squash_engraver squashedPosition = #0
The Pitch_squash_engraver modifies note heads (created
by Note_heads_engraver) and sets their vertical
position to the value of squashedPosition
, in this case 0
,
the center line.
The notes look like a slash, and have no stem,
\override NoteHead #'style = #'slash \override Stem #'transparent = ##t
All these plug-ins have to cooperate, and this is achieved with a
special plug-in, which must be marked with the keyword \type
.
This should always be Engraver_group
.
\type "Engraver_group"
Put together, we get
\context { \name ImproVoice \type "Engraver_group" \consists "Note_heads_engraver" \consists "Text_engraver" \consists Pitch_squash_engraver squashedPosition = #0 \override NoteHead #'style = #'slash \override Stem #'transparent = ##t \alias Voice }
Contexts form hierarchies. We want to hang the ImproVoice
under Staff
, just like normal Voice
s. Therefore, we
modify the Staff
definition with the \accepts
command,
\context { \Staff \accepts ImproVoice }
The opposite of \accepts
is \denies
,
which is sometimes needed when reusing existing context definitions.
Putting both into a \layout
block, like
\layout { \context { \name ImproVoice ... } \context { \Staff \accepts "ImproVoice" } }
Then the output at the start of this subsection can be entered as
\relative c'' { a4 d8 bes8 \new ImproVoice { c4^"ad lib" c c4 c^"undress" c c_"while playing :)" } a1 }
New contexts may be aligned above or below existing contexts. This could be useful in setting up a vocal staff (Vocal ensembles) and in ossia,
Suppose we want to move the fingering indication in the fragment below:
c-2 \stemUp f
If you visit the documentation on fingering instructions (in Fingering instructions), you will notice:
See alsoInternals Reference: Fingering.
Follow the link to Fingering. At the top of the page, you will see
Fingering objects are created by: Fingering_engraver and New_fingering_engraver.
By following related links inside the program reference, we can follow the flow of information within the program:
fingering-event
is in Music expressions named
FingeringEvent
This path goes against the flow of information in the program: it starts from the output, and ends at the input event. You could also start at an input event, and read with the flow of information, eventually ending up at the output object(s).
The program reference can also be browsed like a normal document. It contains chapters on Music definitions, on Translation, and the Backend. Every chapter lists all the definitions used and all properties that may be tuned.
The HTML page that we found in the previous section describes the layout object called Fingering. Such an object is a symbol within the score. It has properties that store numbers (like thicknesses and directions), but also pointers to related objects. A layout object is also called a Grob, which is short for Graphical Object. For more details about Grobs, see grob-interface.
The page for Fingering
lists the definitions for the
Fingering
object. For example, the page says
padding
(dimension, in staff space):
0.5
which means that the number will be kept at a distance of at least 0.5 of the note head.
Each layout object may have several functions as a notational or typographical element. For example, the Fingering object has the following aspects
Each of these aspects is captured in so-called interfaces, which are listed on the Fingering page at the bottom
This object supports the following interfaces: item-interface, self-alignment-interface, side-position-interface, text-interface, text-script-interface, font-interface, finger-interface, and grob-interface.
Clicking any of the links will take you to the page of the respective object interface. Each interface has a number of properties. Some of them are not user-serviceable (‘Internal properties’), but others can be modified.
We have been talking of the Fingering
object, but actually it
does not amount to much. The initialization file (see
Other sources of information)
scm/define-grobs.scm shows the soul of the ‘object’,
(Fingering . ((padding . 0.5) (avoid-slur . around) (slur-padding . 0.2) (staff-padding . 0.5) (self-alignment-X . 0) (self-alignment-Y . 0) (script-priority . 100) (stencil . ,ly:text-interface::print) (direction . ,ly:script-interface::calc-direction) (font-encoding . fetaNumber) (font-size . -5) ; don't overlap when next to heads. (meta . ((class . Item) (interfaces . (finger-interface font-interface text-script-interface text-interface side-position-interface self-alignment-interface item-interface))))))
As you can see, the Fingering
object is nothing more than a
bunch of variable settings, and the webpage in the Internals Reference
is directly generated from this definition.
Recall that we wanted to change the position of the 2 in
c-2 \stemUp f
Since the 2 is vertically positioned next to its note, we have to
meddle with the interface associated with this positioning. This is
done using side-position-interface
. The page for this interface
says
side-position-interface
Position a victim object (this one) next to other objects (the support). The property
direction
signifies where to put the victim object relative to the support (left or right, up or down?)
Below this description, the variable padding
is described as
padding
- (dimension, in staff space)
Add this much extra space between objects that are next to each other.
By increasing the value of padding
, we can move the
fingering away from the note head. The following command inserts
3 staff spaces of white
between the note and the fingering:
\once \override Voice.Fingering #'padding = #3
Inserting this command before the Fingering object is created,
i.e., before c2
, yields the following result:
\once \override Voice.Fingering #'padding = #3 c-2 \stemUp f
In this case, the context for this tweak is Voice
. This
fact can also be deduced from the program reference, for the page for
the Fingering_engraver plug-in says
Fingering_engraver is part of contexts: ... Voice
Another thing that is needed, is an overview of the various naming conventions:
scheme functions: lowercase-with-hyphens (incl. one-word names) scheme functions: ly:plus-scheme-style music events, music classes and music properties: as-scheme-functions Grob interfaces: scheme-style backend properties: scheme-style (but X and Y!) contexts (and MusicExpressions and grobs): Capitalized or CamelCase context properties: lowercaseFollowedByCamelCase engravers: Capitalized_followed_by_lowercase_and_with_underscores
Which of these are conventions and which are rules? Which are rules of the underlying language, and which are LP-specific?
Each context is responsible for creating certain types of graphical objects. The settings used for printing these objects are also stored by context. By changing these settings, the appearance of objects can be altered.
The syntax for this is
\override context.name #'property = #value
Here name is the name of a graphical object, like
Stem
or NoteHead
, and property is an internal
variable of the formatting system (‘grob property’ or ‘layout
property’). The latter is a symbol, so it must be quoted. The
subsection Modifying properties, explains what to fill in
for name, property, and value. Here we only
discuss the functionality of this command.
The command
\override Staff.Stem #'thickness = #4.0
makes stems thicker (the default is 1.3, with staff line thickness as a
unit). Since the command specifies Staff
as context, it only
applies to the current staff. Other staves will keep their normal
appearance. Here we see the command in action:
c4 \override Staff.Stem #'thickness = #4.0 c4 c4 c4
The \override
command changes the definition of the Stem
within the current Staff
. After the command is interpreted
all stems are thickened.
Analogous to \set
, the context argument may be left out,
causing the default context Voice
to be used. Adding
\once
applies the change during one timestep only.
c4 \once \override Stem #'thickness = #4.0 c4 c4
The \override
must be done before the object is
started. Therefore, when altering Spanner objects such as slurs
or beams, the \override
command must be executed at the moment
when the object is created. In this example,
\override Slur #'thickness = #3.0 c8[( c \override Beam #'thickness = #0.6 c8 c])
the slur is fatter but the beam is not. This is because the command for
Beam
comes after the Beam is started, so it has no effect.
Analogous to \unset
, the \revert
command for a context
undoes an \override
command; like with \unset
, it only
affects settings that were made in the same context. In other words, the
\revert
in the next example does not do anything.
\override Voice.Stem #'thickness = #4.0 \revert Staff.Stem #'thickness
Some tweakable options are called ‘subproperties’ and reside inside properties. To tweak those, use commands of the form
\override context.name #'property #'subproperty = #value
such as
\override Stem #'details #'beamed-lengths = #'(4 4 3)
Internals: OverrideProperty, RevertProperty, PropertySet, Backend, and All layout objects.
The back-end is not very strict in type-checking object properties. Cyclic references in Scheme values for properties can cause hangs or crashes, or both.
\set
command
Each context can have different properties, variables contained
in that context. They can be changed during the interpretation step.
This is achieved by inserting the \set
command in the music,
\set context.prop = #value
For example,
R1*2 \set Score.skipBars = ##t R1*2
This command skips measures that have no notes. The result is that
multi-rests are condensed. The value assigned is a Scheme object. In
this case, it is #t
, the boolean True value.
If the context argument is left out, then the current bottom-most
context (typically ChordNames
, Voice
, or
Lyrics
) is used. In this example,
c8 c c c \set autoBeaming = ##f c8 c c c
the context argument to \set
is left out, so automatic
beaming is switched off in the current Voice. Note that
the bottom-most context does not always contain the property that you
wish to change – for example, attempting to set the skipBars
property (of the bottom-most context, in this case Voice
) will
have no effect.
R1*2 \set skipBars = ##t R1*2
Contexts are hierarchical, so if a bigger context was specified, for
example Staff
, then the change would also apply to all
Voice
s in the current stave. The change is applied
‘on-the-fly’, during the music, so that the setting only affects the
second group of eighth notes.
There is also an \unset
command,
\unset context.prop
which removes the definition of prop. This command removes the definition only if it is set in context, so
\set Staff.autoBeaming = ##f
introduces a property setting at Staff
level. The setting also
applies to the current Voice
. However,
\unset Voice.autoBeaming
does not have any effect. To cancel this setting, the \unset
must be specified on the same level as the original \set
. In
other words, undoing the effect of Staff.autoBeaming = ##f
requires
\unset Staff.autoBeaming
Like \set
, the context argument does not have to be
specified for a bottom context, so the two statements
\set Voice.autoBeaming = ##t \set autoBeaming = ##t
are equivalent.
Settings that should only apply to a single time-step can be entered
with \once
, for example in
c4 \once \set fontSize = #4.7 c4 c4
the property fontSize
is unset automatically after the second
note.
A full description of all available context properties is in the program reference, see Tunable context properties.
\override
commandCommands which change output generally look like
\override Voice.Stem #'thickness = #3.0
To construct this tweak we must determine these bits of information:
Voice
.
Stem
.
thickness
.
3.0
.
Some tweakable options are called ‘subproperties’ and reside inside properties. To tweak those, use commands in the form
\override Stem #'details #'beamed-lengths = #'(4 4 3)
For many properties, regardless of the data type of the property, setting the
property to false ( ##f
) will result in turning it off, causing
LilyPond to ignore that property entirely. This is particularly useful for
turning off grob properties which may otherwise be causing problems.
We demonstrate how to glean this information from the notation manual and the program reference.
\tweak
command
In some cases, it is possible to take a short-cut for tuning
graphical objects. For objects that are created directly from
an item in the input file, you can use the \tweak
command.
For example:
< c \tweak #'color #red d g \tweak #'duration-log #1 a > 4 -\tweak #'padding #8 -^
But the main use of the \tweak
command is to modify just
one of a number of notation elements which start at the same musical
moment, like the notes of a chord, or tuplet brackets which start
at the same time.
For an introduction to the syntax and uses of the tweak command see Tweaking methods.
The \tweak
command sets a property in the following object
directly, without requiring the grob name or context to be
specified. For this to work, it is necessary for the \tweak
command to remain immediately adjacent to the object to which it is
to apply after the input file has been converted to a music stream.
This is often not the case, as many additional elements are inserted
into the music stream implicitly. For example, when a note which is
not part of a chord is processed, Lilypond implicitly inserts a
ChordEvent
event before the note, so separating the tweak
from the note. However, if chord symbols are placed round the
tweak and the note, the \tweak
command comes after the
ChordEvent
in the music stream, so remaining adjacent to the
note, and able to modify it.
So, this works:
<\tweak #'color #red c>4
but this does not:
\tweak #'color #red c4
When several similar items are placed at the same musical moment,
the \override
command cannot be used to modify just one of
them – this is where the \tweak
command must be used.
Items which may appear more than once at the same musical moment
include the following:
and \tweak
may be used to modify any single occurrence of
these items.
Notably the \tweak
command cannot be used to modify stems,
beams or accidentals, since these are generated later by note heads,
rather than by music elements in the input stream. Nor can a
\tweak
command be used to modify clefs or time signatures,
since these become separated from any preceding \tweak
command in the input stream by the automatic insertion of extra
elements required to specify the context.
But the \tweak
command can be used as an alternative to
the \override
command to modify those notational elements
that do not cause any additional implicit elements to be added
before them in the music stream. For example, slurs may be
modified in this way:
c-\tweak #'thickness #5 ( d e f)
Also several \tweak
commands may be placed before a
notational element – all affect it:
c -\tweak #'style #'dashed-line -\tweak #'dash-fraction #0.2 -\tweak #'thickness #3 -\tweak #'color #red \glissando f'
The music stream which is generated from a section of an input file,
including any automatically inserted elements, may be examined,
see Displaying music expressions. This may be helpful in
determining what may be modified by a \tweak
command.
Learning Manual: Tweaking methods.
Notation Reference: Displaying music expressions.
The \tweak
command cannot be used inside a variable.
The \tweak
commands cannot be used in \lyricmode
.
The \tweak
command cannot be used to modify the control
points of just one of several ties in a chord, other than the first
one encountered in the input file.
\set
vs. \override
We have seen two methods of changing properties: \set
and
\override
. There are actually two different kinds of
properties.
Contexts can have properties, which are usually named in
studlyCaps
. They mostly control the translation from
music to notation, eg. localKeySignature
(for determining
whether to print accidentals), measurePosition
(for
determining when to print a bar line). Context properties can
change value over time while interpreting a piece of music;
measurePosition
is an obvious example of
this. Context properties are modified with \set
.
There is a special type of context property: the element
description. These properties are named in StudlyCaps
(starting with capital letters). They contain the
‘default settings’ for said graphical object as an
association list. See scm/define-grobs.scm
to see what kind of settings there are. Element descriptions
may be modified with \override
.
\override
is actually a shorthand;
\override context.name #'property = #value
is more or less equivalent to
\set context.name #'property = #(cons (cons 'property value) <previous value of context)
The value of context
(the alist) is used to initialize
the properties of individual grobs. Grobs also have
properties, named in Scheme style, with
dashed-words
. The values of grob properties change
during the formatting process: formatting basically amounts
to computing properties using callback functions.
fontSize
is a special property: it is equivalent to
entering \override ... #'font-size
for all pertinent
objects. Since this is a common change, the special
property (modified with \set
) was created.
The way in which the notation contained within an input file is interpreted is determined by the current input mode.
Chord mode
This is activated with the \chordmode
command, and causes
input to be interpreted with the syntax of chord notation, see
Chord notation. Chords are rendered as notes on a staff.
Chord mode is also activated with the \chords
command.
This also creates a new ChordNames
context and
causes the following input to be interpreted with the syntax of
chord notation and rendered as chord names in the ChordNames
context, see Printing chord names.
Drum mode
This is activated with the \drummode
command, and causes
input to be interpreted with the syntax of drum notation, see
Basic percussion notation.
Drum mode is also activated with the \drums
command.
This also creates a new DrumStaff
context and causes the
following input to be interpreted with the syntax of drum notation
and rendered as drum symbols on a drum staff, see Basic percussion notation.
Figure mode
This is activated with the \figuremode
command, and causes
input to be interpreted with the syntax of figured bass, see
Entering figured bass.
Figure mode is also activated with the \figures
command.
This also creates a new FiguredBass
context and causes the
following input to be interpreted with the figured bass syntax
and rendered as figured bass symbols in the FiguredBass
context, see Introduction to figured bass.
Fret and tab modes
There are no special input modes for entering fret and tab symbols.
To create tab diagrams, enter notes or chords in note mode and
render them in a TabStaff
context, see
Default tablatures.
To create fret diagrams above a staff, you have two choices.
You can either use the FretBoards
context (see
Automatic fret diagrams or you can enter them as a markup
above the notes using the \fret-diagram
command (see
Fret diagram markups).
Lyrics mode
This is activated with the \lyricmode
command, and causes
input to be interpreted as lyric syllables with optional durations
and associated lyric modifiers, see Vocal music.
Lyric mode is also activated with the \addlyrics
command.
This also creates a new Lyrics
context and an implicit
\lyricsto
command which associates the following lyrics
with the preceding music.
Markup mode
This is activated with the \markup
command, and causes
input to be interpreted with the syntax of markup, see
Text markup commands.
Note mode
This is the default mode or it may be activated with the
\notemode
command. Input is interpreted as pitches,
durations, markup, etc and typeset as musical notation on a staff.
It is not normally necessary to specify note mode explicitly, but it may be useful to do so in certain situations, for example if you are in lyric mode, chord mode or any other mode and want to insert something that only can be done with note mode syntax.
For example, to indicate dynamic markings for the verses of a choral pieces it is necessary to enter note mode to interpret the markings:
{ c4 c4 c4 c4 } \addlyrics { \notemode{\set stanza = \markup{ \dynamic f 1. } } To be sung loudly } \addlyrics { \notemode{\set stanza = \markup{ \dynamic p 2. } } To be sung quietly }
In typesetting music the direction and placement of many items is a matter of choice. For example, the stems of notes can be directed up or down; lyrics, dynamics, and other expressive marks may be placed above or below the staff; text may be aligned left, right or center; etc. Most of these choices may be left to be determined automatically by LilyPond, but in some cases it may be desirable to force a particular direction or placement.
Default actions
By default some directions are always up or always down (e.g. dynamics or fermata), while other things can alternate between up or down based on the stem direction (like slurs or accents).
Context layout
Contexts are positioned in a system from top to bottom in the order in which they are encountered. Note, however, that a context will be created implicitly if a command is encountered when there is no suitable context available to contain it.
The default order in which contexts are laid out can be changed, see Aligning contexts
Articulation direction indicators
When adding articulations to notes the direction indicator,
^
(meaning “up”), _
(meaning “down”) or
-
(meaning “use default direction”), can usually be
omitted, in which case -
is assumed. But a direction
indicator is always required before
\tweak
commands
\markup
commands
\tag
commands
-1
-.
, ->
, --
The direction property
The position or direction of many layout objects is controlled
by the direction
property.
The value of the direction
property may be
set to 1
, meaning “up” or “above”, or to -1
,
meaning “down” or “below”. The symbols UP
and
DOWN
may be used instead of 1
and -1
respectively. The default direction may be specified by setting
direction
to 0
or CENTER
. Alternatively,
in many cases predefined commands
exist to specify the direction. These are all of the form
\xxxUp
, xxxDown
, xxxNeutral
where xxxNeutral
means “use the default direction”.
See Within-staff objects.
In a few cases, arpeggio being the only common example, the value
of the direction
property specifies whether the object
is to be placed to the right or left of the parent object. In
this case -1
or LEFT
means “to the left” and
1
or RIGHT
means “to the right”. 0
or CENTER
means “use the default” direction, as before.
To be written
Many objects of musical notation extend over several notes or even several bars. Examples are slurs, beams, tuplet brackets, volta repeat brackets, crescendi, trills, and glissandi. Such objects are collectively called “spanners”, and have special properties to control their appearance and behaviour. Some of these properties are common to all spanners; others are restricted to a sub-set of the spanners.
All spanners support the spanner-interface
. A few, esentially
those that draw a straight line between the two objects, support in
addition the line-spanner-interface
.
spanner-interface
This interface provides two properties that apply to several spanners.
The minimum-length
property
The minimum length of the spanner is specified by the
minimum-length
property. Increasing this usually has the
necessary effect of increasing the spacing of the notes between the
two end points. However, this override has no effect on
many spanners, as their length is determined by other considerations.
A few examples where it is effective are shown below.
a~a a % increase the length of the tie -\tweak #'minimum-length #5 ~a
a1 \compressFullBarRests R1*23 % increase the length of the rest bar \once \override MultiMeasureRest #'minimum-length = #20 R1*23 a1
a \< a a a \! % increase the length of the hairpin \override Hairpin #'minimum-length = #20 a \< a a a \!
This override can also be used to increase the length of slurs and phrasing slurs:
a( a) a -\tweak #'minimum-length #5 ( a) a\( a\) a -\tweak #'minimum-length #5 \( a\)
For some layout objects, the minimum-length
property becomes
effective only if the set-spacing-rods
procedure is called
explicitly. To do this, the springs-and-rods
property should
be set to ly:spanner::set-spacing-rods
. For example,
the minimum length of a glissando has no effect unless the
springs-and-rods
property is set:
% default e \glissando c' % not effective alone \once \override Glissando #'minimum-length = #20 e, \glissando c' % effective only when both overrides are present \once \override Glissando #'minimum-length = #20 \once \override Glissando #'springs-and-rods = #ly:spanner::set-spacing-rods e, \glissando c'
The same is true of the Beam
object:
% not effective alone \once \override Beam #'minimum-length = #20 e8 e e e % effective only when both overrides are present \once \override Beam #'minimum-length = #20 \once \override Beam #'springs-and-rods = #ly:spanner::set-spacing-rods e8 e e e
The to-barline
property
The second useful property of the spanner-interface
is
to-barline
. By default this is true, causing hairpins and
other spanners which are terminated on the first note of a measure to
end instead on the immediately preceding bar line. If set to false,
the spanner will extend beyond the bar line and end on the note
itself:
a \< a a a a \! a a a \break \override Hairpin #'to-barline = ##f a \< a a a a \! a a a
This property is not effective for all spanners. For example,
seting it to #t
has no effect on slurs or phrasing slurs
or on other spanners for which terminating on the bar line would
not be meaningful.
line-spanner-interface
Objects which support the line-spanner-interface
include
DynamicTextSpanner
Glissando
TextSpanner
TrillSpanner
VoiceFollower
The routine responsible for drawing the stencils for these spanners is
ly:line-interface::print
. This routine determines the
exact location of the two end points and draws a line
between them, in the style requested. The locations of the two
end points of the spanner are computed on-the-fly, but it is
possible to override their Y-coordinates. The
properties which need to be specified are nested
two levels down within the property hierarchy, but the syntax of
the \override
command is quite simple:
e2 \glissando b \once \override Glissando #'bound-details #'left #'Y = #3 \once \override Glissando #'bound-details #'right #'Y = #-2 e2 \glissando b
The units for the Y
property are staff-space
s,
with the center line of the staff being the zero point.
For the glissando, this is the value for Y
at the
X-coordinate corresponding to the center point of each note head,
if the line is imagined to be extended to there.
If Y
is not set, the value is computed from the vertical
position of the corresponding attachment point of the spanner.
In case of a line break, the values for the end points are
specified by the left-broken
and right-broken
sub-lists of bound-details
. For example:
\override Glissando #'breakable = ##t \override Glissando #'bound-details #'right-broken #'Y = #-3 c1 \glissando \break f1
A number of further properties of the left
and
right
sub-lists of the bound-details
property
may be modified in the same way as Y
:
Y
staff-space
s
offset from the staff center line. By default, it is the center of
the bound object, so a glissando points to the vertical center of
the note head.
For horizontal spanners, such as text spanners and trill spanners,
it is hardcoded to 0.
attach-dir
-1
(or
LEFT
) makes the line start/end at the left side of the note
head it is attached to.
X
stencil
text
be used instead.
text
\override TextSpanner #'bound-details #'left #'text = \markup { \small \bold Slower } c2\startTextSpan b c a\stopTextSpan
stencil-align-dir-y
stencil-offset
X
and
Y
sub-properties. Setting either stencil-align-dir-y
or stencil-offset
will move the symbol at the edge vertically
relative to the end point of the line:
\override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #-2 \override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #UP \override TextSpanner #'bound-details #'left #'text = #"ggg" \override TextSpanner #'bound-details #'right #'text = #"hhh" c4^\startTextSpan c c c \stopTextSpan
Note that negative values move the text up, contrary to the
effect that might be expected, as a value of -1
or
DOWN
means align the bottom edge of the text with
the spanner line. A value of 1
or UP
aligns
the top edge of the text with the spanner line.
arrow
#t
produces an arrowhead at the
end of the line.
padding
The music function \endSpanners
terminates the spanner
which starts on the immediately following note prematurely. It
is terminated after exactly one note, or at the following bar line
if to-barline
is true and a bar line occurs before the next
note.
\endSpanners c2 \startTextSpan c2 c2 \endSpanners c2 \< c2 c2
When using \endSpanners
it is not necessary to close
\startTextSpan with \stopTextSpan, nor is it necessary to close
hairpins with \!
.
Internals Reference: TextSpanner, Glissando, VoiceFollower, TrillSpanner, line-spanner-interface.
There are four main ways in which the visibility of layout objects
can be controlled: their stencil can be removed, they can be made
transparent, they can be colored white, or their
break-visibility
property can be overridden. The first
three apply to all layout objects; the last to just a few – the
breakable objects. The Learning Manual introduces these
four techniques, see Visibility and color of objects.
There are also a few other techniques which are specific to certain layout objects. These are covered under Special considerations.
Every layout object has a stencil property. By default this is set
to the specific function which draws that object. If this property
is overridden to #f
no function will be called and the object
will not be drawn. The default action can be recovered with
\revert
.
a1 a \override Score.BarLine #'stencil = ##f a a \revert Score.BarLine #'stencil a a a
Every layout object has a transparent property which by default is
set to #f
. If set to #t
the object still occupies
space but is made invisible.
a4 a \once \override NoteHead #'transparent = ##t a a
Every layout object has a color property which by default is set
to black
. If this is overridden to white
the object
will be indistinguishable from the white background. However,
if the object crosses other objects the color of the crossing
points will be determined by the order in which they are drawn,
and this may leave a ghostly image of the white object, as shown
here:
\override Staff.Clef #'color = #white a1
This may be avoided by changing the order of printing the objects.
All layout objects have a layer
property which should be set
to an integer. Objects with the lowest value of layer
are
drawn first, then objects with progressively higher values are drawn,
so objects with higher values overwrite objects with lower values.
By default most objects are assigned a layer
value of
1
, although a few objects, including StaffSymbol
and
BarLine
, are assigned a value of 0
. The order of
printing objects with the same value of layer
is indeterminate.
In the example above the white clef, with a default layer
value of 1
, is drawn after the staff lines (default
layer
value 0
), so overwriting them. To change this,
the Clef
object must be given in a lower value of
layer
, say -1
, so that it is drawn earlier:
\override Staff.Clef #'color = #white \override Staff.Clef #'layer = #-1 a1
Most layout objects are printed only once, but some like
bar lines, clefs, time signatures and key signatures, may need
to be printed twice when a line break occurs – once at the end
of the line and again at the start of the next line. Such
objects are called breakable, and have a property, the
break-visibility
property to control their visibility
at the three positions in which they may appear – at the
start of a line, within a line if they are changed, and at the
end of a line if a change takes place there.
For example, the time signature by default will be printed at the start of the first line, but nowhere else unless it changes, when it will be printed at the point at which the change occurs. If this change occurs at the end of a line the new time signature will be printed at the start of the next line and a cautionary time signature will be printed at the end of the previous line as well.
This behaviour is controlled by the break-visibility
property, which is explained in
Visibility and color of objects. This property takes
a vector of three booleans which, in order, determine whether the
object is printed at the end of, within the body of, or at the
beginning of a line. Or to be more precise, before a line break,
where there is no line break, or after a line break.
Alternatively, seven of the eight combinations may be specified by pre-defined functions, defined in scm/output-lib.scm, where the last three columns indicate whether the layout objects will be visible in the positions shown at the head of the columns:
Function | Vector | Before | At no | After
|
---|---|---|---|---|
form | form | break | break | break
|
all-invisible | '#(#f #f #f) | no | no | no
|
begin-of-line-visible | '#(#f #f #t) | no | no | yes
|
end-of-line-visible | '#(#t #f #f) | yes | no | no
|
all-visible | '#(#t #t #t) | yes | yes | yes
|
begin-of-line-invisible | '#(#t #t #f) | yes | yes | no
|
end-of-line-invisible | '#(#f #t #t) | no | yes | yes
|
center-invisible | '#(#t #f #t) | yes | no | yes
|
The center-visible
function is not pre-defined.
The default settings of break-visibility
depend on the
layout object. The following table shows all the layout objects
of interest which are affected by break-visibility
and the
default setting of this property:
Layout object | Usual context | Default setting
|
---|---|---|
BarLine | Score | calculated
|
BarNumber | Score | begin-of-line-visible
|
BreathingSign | Voice | begin-of-line-invisible
|
Clef | Staff | begin-of-line-visible
|
Custos | Staff | end-of-line-visible
|
DoublePercentRepeat | Voice | begin-of-line-invisible
|
KeySignature | Staff | begin-of-line-visible
|
OctavateEight | Staff | begin-of-line-visible
|
RehearsalMark | Score | end-of-line-invisible
|
TimeSignature | Staff | all-visible
|
The example below shows the use of the vector form to control the visibility of barlines:
f4 g a b f4 g a b % Remove bar line at the end of the current line \once \override Score.BarLine #'break-visibility = #'#(#f #t #t) \break f4 g a b f4 g a b
Although all three components of the vector used to override
break-visibility
must be present, not all of them are
effective with every layout object, and some combinations may
even give errors. The following limitations apply:
Visibility following explicit changes
The break-visibility
property controls the visibility of
key signatures and changes of clef only at the start of lines,
i.e. after a break. It has no effect on the visibility of the
key signature or clef following an explicit key change or an
explicit clef change within or at the end of a line. In the
following example the key signature following the explicit change
to B-flat major is still visible, even though all-invisible
is set.
\key g \major f4 g a b % Try to remove all key signatures \override Staff.KeySignature #'break-visibility = #all-invisible \key bes \major f4 g a b \break f4 g a b f4 g a b
The visibility of such explicit key signature and clef changes is
controlled by the explicitKeySignatureVisibility
and
explicitClefVisibility
properties. These are the equivalent
of the break-visibility
property and both take a vector of
three booleans or the predefined functions listed above, exactly like
break-visibility
. Both are properties of the Staff context,
not the layout objects themselves, and so they are set using the
\set
command. Both are set by default to all-visible
.
These properties control only the visibility of key signatures and
clefs resulting from explicit changes and do not affect key
signatures and clefs at the beginning of lines;
break-visibility
must still be overridden in the appropriate
object to remove these.
\key g \major f4 g a b \set Staff.explicitKeySignatureVisibility = #all-invisible \override Staff.KeySignature #'break-visibility = #all-invisible \key bes \major f4 g a b \break f4 g a b f4 g a b
Visibility of cautionary accidentals
To remove the cautionary accidentals printed at an explicit key
change, set the Staff context property printKeyCancellation
to #f
:
\key g \major f4 g a b \set Staff.explicitKeySignatureVisibility = #all-invisible \set Staff.printKeyCancellation = ##f \override Staff.KeySignature #'break-visibility = #all-invisible \key bes \major f4 g a b \break f4 g a b f4 g a b
With these overrides only the accidentals before the notes remain to indicate the change of key.
Automatic bars
As a special case, the printing of bar lines can also be turned off
by setting the automaticBars
property in the Score context.
If set to #f
, bar lines will not be printed automatically;
they must be explicitly created with a \bar
command. Unlike
the \cadenzaOn
predefined command, measures are still counted.
Bar generation will resume according to that count if this property
is later set to #t
. When set to #f
, line breaks can
occur only at explicit \bar
commands.
Octavated clefs
The small octavation symbol on octavated clefs is produced by the
OctavateEight
layout object. Its visibility is controlled
independently from that of the Clef
object, so it is
necessary to apply any required break-visibility
overrides
to both the Clef
and the OctavateEight
layout objects
to fully suppress such clef symbols at the start of each line.
For explicit clef changes, the explicitClefVisibility
property controls both the clef symbol and any octavation symbol
associated with it.
Learning Manual: Visibility and color of objects
Some performance indications, e.g., rallentando and accelerando and trills are written as text and are extended over many measures with lines, sometimes dotted or wavy.
These all use the same routines as the glissando for drawing the
texts and the lines, and tuning their behavior is therefore also
done in the same way. It is done with a spanner, and the routine
responsible for drawing the spanners is
ly:line-interface::print
. This routine determines the
exact location of the two span points and draws a line
between them, in the style requested.
Here is an example showing the different line styles available, and how to tune them.
d2 \glissando d'2 \once \override Glissando #'style = #'dashed-line d,2 \glissando d'2 \override Glissando #'style = #'dotted-line d,2 \glissando d'2 \override Glissando #'style = #'zigzag d,2 \glissando d'2 \override Glissando #'style = #'trill d,2 \glissando d'2
The locations of the end-points of the spanner are computed on-the-fly for every graphic object, but it is possible to override these:
e2 \glissando f \once \override Glissando #'bound-details #'right #'Y = #-2 e2 \glissando f
The value for Y
is set to -2
for the right end
point. The left side may be similarly adjusted by specifying
left
instead of right
.
If Y
is not set, the value is computed from the vertical
position of the left and right attachment points of the spanner.
Other adjustments of spanners are possible, for details, see Spanners.
Both layout objects and elements of markup text can be rotated by any angle about any point, but the method of doing so differs.
All layout objects which support the grob-interface
can be
rotated by setting their rotation
property. This takes a
list of three items: the angle of rotation counter-clockwise,
and the x and y coordinates of the point relative to the object's
reference point about which the rotation is to be performed. The
angle of rotation is specified in degrees and the coordinates in
staff-spaces.
The angle of rotation and the coordinates of the rotation point must be determined by trial and error.
There are only a few situations where the rotation of layout objects is useful; the following example shows one situation where they may be:
g4\< e' d' f\! \override Hairpin #'rotation = #'(20 -1 0) g,,4\< e' d' f\!
All markup text can be rotated to lie at any angle by prefixing it
with the \rotate
command. The command takes two arguments:
the angle of rotation in degrees counter-clockwise and the text to
be rotated. The extents of the text are not rotated: they take
their values from the extremes of the x and y coordinates of the
rotated text. In the following example the
outside-staff-priority
property for text is set to #f
to disable the automatic collision avoidance, which would push some
of the text too high.
\override TextScript #'outside-staff-priority = ##f g4^\markup { \rotate #30 "a G" } b^\markup { \rotate #30 "a B" } des^\markup { \rotate #30 "a D-Flat" } fis^\markup { \rotate #30 "an F-Sharp" }
Graphical objects which support the self-alignment-interface
and/or
the side-position-interface
can be
aligned to a previously placed object in a variety of ways. For a list of these objects, see
self-alignment-interface and side-position-interface.
All graphical objects have a reference point, a horizontal extent and a vertical extent. The horizontal extent is a pair of numbers giving the displacements from the reference point of the left and right edges, displacements to the left being negative. The vertical extent is a pair of numbers giving the displacement from the reference point to the bottom and top edges, displacements down being negative.
An object's position on a staff is given by the values of the
X-offset
and Y-offset
properties. The value of
X-offset
gives the displacement from the x coordinate of
the reference point of the parent object, and the value of
Y-offset
gives the displacement from the center line of the
staff. The values of X-offset
and
Y-offset
may be set directly or may be set to be calculated
by procedures in order to achieve alignment with the parent object
in several ways.
Note: Many objects have special positioning considerations which
cause any setting of X-offset or Y-offset to be
ignored or modified, even though the object supports the
self-alignment-interface .
|
For example, an accidental can be repositioned
vertically by setting Y-offset
but any changes to
X-offset
have no effect.
Rehearsal marks may be aligned with
breakable objects such as bar lines, clef symbols, time signature
symbols and key signatures. There are special properties to be
found in the break-aligned-interface
for positioning rehearsal
marks on such objects.
X-offset
and Y-offset
directlyNumerical values may be given to the X-offset
and Y-offset
properties of many objects. The following example shows three
notes with the default fingering position and the positions with X-offset
and Y-offset
modified.
a-3 a -\tweak #'X-offset #0 -\tweak #'Y-offset #0 -3 a -\tweak #'X-offset #-1 -\tweak #'Y-offset #1 -3
side-position-interface
An object which supports the side-position-interface
can be
placed next to its parent object so that
the specified edges of the two objects touch. The object may be
placed above, below, to the right or to the left of the parent.
The parent cannot be specified; it is determined by the order of
elements in the input stream. Most objects have the associated
note head as their parent.
The values of the side-axis
and direction
properties
determine where the object is to be placed, as follows:
side-axis | direction |
|
---|---|---|
property | property | Placement
|
0 | -1 | left
|
0 | 1 | right
|
1 | -1 | below
|
1 | 1 | above
|
When side-axis
is 0
, X-offset
should be set to
the procedure ly:side-position-interface::x-aligned-side
.
This procedure will return the correct value of X-offset
to
place the object to the left or right side of the parent according
to value of direction
.
When side-axis
is 1
, Y-offset
should be set to
the procedure ly:side-position-interface::y-aligned-side
.
This procedure will return the correct value of Y-offset
to
place the object to the top or bottom of the parent according
to value of direction
.
self-alignment-interface
Self-aligning objects horizontally
The horizontal alignment of an object which supports the
self-alignment-interface
is controlled by the value of
the self-alignment-X
property, provided the object's
X-offset
property is set to
ly:self-alignment-interface::x-aligned-on-self
.
self-alignment-X
may be given any
real value, in units of half the total X extent of the
object. Negative values move the object to the right, positive
to the left. A value of 0
centers the object on the
reference point of its parent, a value of -1
aligns the
left edge of the object on the reference point of its parent,
and a value of 1
aligns the right edge of the object on the
reference point of its parent. The symbols LEFT
,
CENTER
and RIGHT
may be used instead of the values
-1, 0, 1
respectively.
Normally the \override
command would be used to modify the
value of self-alignment-X
, but the \tweak
command
can be used to separately align several annotations on a single
note:
a' -\tweak #'self-alignment-X #-1 ^"left-aligned" -\tweak #'self-alignment-X #0 ^"center-aligned" -\tweak #'self-alignment-X #RIGHT ^"right-aligned" -\tweak #'self-alignment-X #-2.5 ^"aligned further to the right"
Self-aligning objects vertically
Objects may be aligned vertically in an analogous way to aligning
them horizontally if the Y-offset
property is set to
ly:self-alignment-interface::y-aligned-on-self
. However,
other mechanisms are often involved in vertical alignment: the
value of Y-offset
is just one variable taken into account.
This may make adjusting the value of some objects tricky.
The units are just half the vertical extent of the object, which
is usually quite small, so quite large numbers may be required.
A value of -1
aligns the lower edge of the object with
the reference point of the parent object, a value of 0
aligns the center of the object with the reference point of the
parent, and a value of 1
aligns the top edge of the object
with the reference point of the parent. The symbols DOWN
,
CENTER
, UP
may be substituted for -1, 0, 1
respectively.
Self-aligning objects in both directions
By setting both X-offset
and Y-offset
, an object may
be aligned in both directions simultaneously.
The following example shows how to adjust a fingering mark so that it nestles close to the note head.
a -\tweak #'self-alignment-X #0.5 % move horizontally left -\tweak #'Y-offset #ly:self-alignment-interface::y-aligned-on-self -\tweak #'self-alignment-Y #-1 % move vertically up -3 % third finger
break-aligned-interface
Rehearsal marks may be aligned with notation objects other
than bar lines. These objects include ambitus
,
breathing-sign
, clef
, custos
, staff-bar
,
left-edge
, key-cancellation
, key-signature
, and
time-signature
.
By default, rehearsal marks will be horizontally centered above the object:
e1 % the RehearsalMark will be centered above the Clef \override Score.RehearsalMark #'break-align-symbols = #'(clef) \key a \major \clef treble \mark "↓" e % the RehearsalMark will be centered above the TimeSignature \override Score.RehearsalMark #'break-align-symbols = #'(time-signature) \key a \major \clef treble \time 3/4 \mark "↓" e2.
The alignment of the rehearsal mark relative to the notation object can be changed, as shown in the following example. In a score with multiple staves, this setting should be done for all the staves.
% The RehearsalMark will be centered above the KeySignature \override Score.RehearsalMark #'break-align-symbols = #'(key-signature) \key a \major \clef treble \time 4/4 \mark "↓" e1 % The RehearsalMark will be aligned with the left edge of the KeySignature \once \override Score.KeySignature #'break-align-anchor-alignment = #LEFT \mark "↓" \key a \major e % The RehearsalMark will be aligned with the right edge of the KeySignature \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT \key a \major \mark "↓" e
The rehearsal mark can also be offset to the right or left of the left edge by an arbitrary amount. The units are staff-spaces:
% The RehearsalMark will be aligned with the left edge of the KeySignature % and then shifted right by 3.5 staff-spaces \override Score.RehearsalMark #'break-align-symbols = #'(key-signature) \once \override Score.KeySignature #'break-align-anchor = #3.5 \key a \major \mark "↓" e % The RehearsalMark will be aligned with the left edge of the KeySignature % and then shifted left by 2 staff-spaces \once \override Score.KeySignature #'break-align-anchor = #-2 \key a \major \mark "↓" e
The VerticalAlignment and VerticalAxisGroup grobs work together. VerticalAxisGroup groups together different grobs like Staff, Lyrics, etc. VerticalAlignment then vertically aligns the different grobs grouped together by VerticalAxisGroup. There is usually only one VerticalAlignment per score but every Staff, Lyrics, etc. has its own VerticalAxisGroup.
All layout objects have a stencil
property which is part of
the grob-interface
. By default, this property is usually
set to a function specific to the object that is tailor-made to
render the symbol which represents it in the output. For example,
the standard setting for the stencil
property of the
MultiMeasureRest
object is ly:multi-measure-rest::print
.
The standard symbol for any object can be replaced by modifying the
stencil
property to reference a different, specially-written,
procedure. This requires a high level of knowledge of the internal
workings of LilyPond, but there is an easier way which can often
produce adequate results.
This is to set the stencil
property to the procedure which
prints text – ly:text-interface::print
– and to add a
text
property to the object which is set to contain the
markup text which produces the required symbol. Due to the
flexibility of markup, much can be achieved – see in particular
Graphic notation inside markup.
The following example demonstrates this by changing the note head symbol to a cross within a circle.
XinO = { \once \override NoteHead #'stencil = #ly:text-interface::print \once \override NoteHead #'text = \markup { \combine \halign #-0.7 \draw-circle #0.85 #0.2 ##f \musicglyph #"noteheads.s2cross" } } \relative c'' { a a \XinO a a }
Any of the glyphs in the feta Font can be supplied to the
\musicglyph
markup command – see The Feta font.
Notation Reference: Graphic notation inside markup, Formatting text, Text markup commands, The Feta font.
Ties, slurs and phrasing slurs are drawn as third-order Bézier curves. If the shape of the tie or slur which is calculated automatically is not optimum, the shape may be modified manually by explicitly specifying the four control points required to define a third-order Bézier curve.
Third-order or cubic Bézier curves are defined by four control points. The first and fourth control points are precisely the starting and ending points of the curve. The intermediate two control points define the shape. Animations showing how the curve is drawn can be found on the web, but the following description may be helpful. The curve starts from the first control point heading directly towards the second, gradually bending over to head towards the third and continuing to bend over to head towards the fourth, arriving there travelling directly from the third control point. The curve is entirely contained in the quadrilateral defined by the four control points.
Here is an example of a case where the tie is not optimum, and
where \tieDown
would not help.
<< { e1 ~ e } \\ { r4 <g c,> <g c,> <g c,> } >>
One way of improving this tie is to manually modify its control points, as follows.
The coordinates of the Bézier control points are specified in units of staff-spaces. The X coordinate is relative to the reference point of the note to which the tie or slur is attached, and the Y coordinate is relative to the staff center line. The coordinates are entered as a list of four pairs of decimal numbers (reals). One approach is to estimate the coordinates of the two end points, and then guess the two intermediate points. The optimum values are then found by trial and error.
It is useful to remember that a symmetric curve requires symmetric control points, and that Bézier curves have the useful property that transformations of the curve such as translation, rotation and scaling can be achieved by applying the same transformation to the curve's control points.
For the example above the following override gives a satisfactory tie:
<< \once \override Tie #'control-points = #'((1 . -1) (3 . 0.6) (12.5 . 0.6) (14.5 . -1)) { e1 ~ e1 } \\ { r4 <g c,> <g c,> <g c,>4 } >>
It is not possible to modify shapes of ties or slurs by changing
the control-points
property if there are more than one at
the same musical moment, not even by using the \tweak
command.
Advanced tweaks may be performed by using Scheme. If you are not familiar with Scheme, you may wish to read our Scheme tutorial.
This section discusses how to create music functions within LilyPond.
Making a function which substitutes a variable into LilyPond code is easy. The general form of these functions is
function = #(define-music-function (parser location var1 var2... ) (var1-type? var2-type?...) #{ ...music... #})
where
argi | ith variable
|
argi-type? | type of variable
|
...music... | normal LilyPond input, using
variables as #$var1 .
|
There following input types may be used as variables in a music function. This list is not exhaustive; see other documentation specifically about Scheme for more variable types.
Input type | argi-type? notation
|
---|---|
Integer | integer?
|
Float (decimal number) | number?
|
Text string | string?
|
Markup | markup?
|
Music expression | ly:music?
|
A pair of variables | pair?
|
The parser
and location
argument are mandatory,
and are used in some advanced situations. The parser
argument is used to access to the value of another LilyPond
variable. The location
argument
is used to set the ‘origin’ of the music expression that is built
by the music function, so that in case of a syntax error LilyPond
can tell the user an appropriate place to look in the input file.
Here is a simple example,
padText = #(define-music-function (parser location padding) (number?) #{ \once \override TextScript #'padding = #$padding #}) \relative c''' { c4^"piu mosso" b a b \padText #1.8 c4^"piu mosso" d e f \padText #2.6 c4^"piu mosso" fis a g }
Music expressions may be substituted as well,
custosNote = #(define-music-function (parser location note) (ly:music?) #{ \once \override Voice.NoteHead #'stencil = #ly:text-interface::print \once \override Voice.NoteHead #'text = \markup \musicglyph #"custodes.mensural.u0" \once \override Voice.Stem #'stencil = ##f $note #}) { c' d' e' f' \custosNote g' }
Multiple variables may be used,
tempoMark = #(define-music-function (parser location padding marktext) (number? string?) #{ \once \override Score . RehearsalMark #'padding = $padding \once \override Score . RehearsalMark #'extra-spacing-width = #'(+inf.0 . -inf.0) \mark \markup { \bold $marktext } #}) \relative c'' { c2 e \tempoMark #3.0 #"Allegro" g c }
Some \override
commands require a pair of numbers
(called a cons cell
in Scheme). To pass these numbers
into a function, either use a pair?
variable, or
insert the cons
into the music function.
manualBeam = #(define-music-function (parser location beg-end) (pair?) #{ \once \override Beam #'positions = #$beg-end #}) \relative { \manualBeam #'(3 . 6) c8 d e f }
or
manualBeam = #(define-music-function (parser location beg end) (number? number?) #{ \once \override Beam #'positions = #(cons $beg $end) #}) \relative { \manualBeam #3 #6 c8 d e f }
Music functions can involve Scheme programming in addition to simple substitution,
AltOn = #(define-music-function (parser location mag) (number?) #{ \override Stem #'length = #$(* 7.0 mag) \override NoteHead #'font-size = #$(inexact->exact (* (/ 6.0 (log 2.0)) (log mag))) #}) AltOff = { \revert Stem #'length \revert NoteHead #'font-size } { c'2 \AltOn #0.5 c'4 c' \AltOn #1.5 c' c' \AltOff c'2 }
This example may be rewritten to pass in music expressions,
withAlt = #(define-music-function (parser location mag music) (number? ly:music?) #{ \override Stem #'length = #$(* 7.0 mag) \override NoteHead #'font-size = #$(inexact->exact (* (/ 6.0 (log 2.0)) (log mag))) $music \revert Stem #'length \revert NoteHead #'font-size #}) { c'2 \withAlt #0.5 {c'4 c'} \withAlt #1.5 {c' c'} c'2 }
A music function must return a music expression, but sometimes we
may want to have a function which does not involve music (such as
turning off Point and Click). To do this, we return a void
music expression.
That is why the form
that is returned is the (make-music ...)
. With the
'void
property set to #t
, the parser is told to
actually disregard this returned music
expression. Thus the important part of the void music function is the
processing done by the function, not the music expression that is
returned.
noPointAndClick = #(define-music-function (parser location) () (ly:set-option 'point-and-click #f) (make-music 'SequentialMusic 'void #t)) ... \noPointAndClick % disable point and click
In most cases a function without arguments should be written with an variable,
dolce = \markup{ \italic \bold dolce }
However, in rare cases it may be useful to create a music function without arguments,
displayBarNum = #(define-music-function (parser location) () (if (eq? #t (ly:get-option 'display-bar-numbers)) #{ \once \override Score.BarNumber #'break-visibility = ##f #} #{#}))
To actually display bar numbers where this function is called, invoke lilypond with
lilypond -d display-bar-numbers FILENAME.ly
The following commands are music functions
acciaccatura
- music (music)addChordShape
- key-symbol (symbol) shape-string (string)addInstrumentDefinition
- name (string) lst (list)addQuote
- name (string) music (music)afterGrace
- main (music) grace (music)allowPageTurn
applyContext
- proc (procedure)applyMusic
- func (procedure) music (music)applyOutput
- ctx (symbol) proc (procedure)appoggiatura
- music (music)assertBeamQuant
- l (pair) r (pair)assertBeamSlope
- comp (procedure)autochange
- music (music)balloonGrobText
- grob-name (symbol) offset (pair of numbers) text (markup)balloonText
- offset (pair of numbers) text (markup)bar
- type (string)barNumberCheck
- n (integer)bendAfter
- delta (unknown)breathe
clef
- type (string)cueDuring
- what (string) dir (direction) main-music (music)displayLilyMusic
- music (music)displayMusic
- music (music)endSpanners
- music (music)featherDurations
- factor (moment) argument (music)grace
- music (music)includePageLayoutFile
instrumentSwitch
- name (string)keepWithTag
- tag (symbol) music (music)killCues
- music (music)label
- label (symbol)makeClusters
- arg (music)musicMap
- proc (procedure) mus (music)noPageBreak
noPageTurn
octaveCheck
- pitch-note (music)oldaddlyrics
- music (music) lyrics (music)ottava
- octave (number)overrideProperty
- name (string) property (symbol) value (any type)pageBreak
pageTurn
parallelMusic
- voice-ids (list) music (music)parenthesize
- arg (music)partcombine
- part1 (music) part2 (music)pitchedTrill
- main-note (music) secondary-note (music)pointAndClickOff
pointAndClickOn
quoteDuring
- what (string) main-music (music)removeWithTag
- tag (symbol) music (music)resetRelativeOctave
- reference-note (music)rightHandFinger
- finger (number or string)scaleDurations
- fraction (pair of numbers) music (music)scoreTweak
- name (string)shiftDurations
- dur (integer) dots (integer) arg (music)spacingTweaks
- parameters (list)storePredefinedDiagram
- chord (music) tuning (list) terse-definition (string)tag
- tag (symbol) arg (music)tocItem
- text (markup)tocItemMarkup
paper
variable markup
transposedCueDuring
- what (string) dir (direction) pitch-note (music) main-music (music)transposition
- pitch-note (music)tweak
- sym (symbol) val (any type) arg (music)unfoldRepeats
- music (music)withMusicProperty
- sym (symbol) val (any type) music (music)This section contains information about mixing LilyPond and Scheme.
The input format supports the notion of variables: in the following
example, a music expression is assigned to a variable with the name
traLaLa
.
traLaLa = { c'4 d'4 }
There is also a form of scoping: in the following example, the
\layout
block also contains a traLaLa
variable, which is
independent of the outer \traLaLa
.
traLaLa = { c'4 d'4 } \layout { traLaLa = 1.0 }
In effect, each input file is a scope, and all \header
,
\midi
, and \layout
blocks are scopes nested inside that
toplevel scope.
Both variables and scoping are implemented in the GUILE module system. An anonymous Scheme module is attached to each scope. An assignment of the form
traLaLa = { c'4 d'4 }
is internally converted to a Scheme definition
(define traLaLa Scheme value of `...
')
This means that input variables and Scheme variables may be freely
mixed. In the following example, a music fragment is stored in the
variable traLaLa
, and duplicated using Scheme. The result is
imported in a \score
block by means of a second variable
twice
:
traLaLa = { c'4 d'4 } %% dummy action to deal with parser lookahead #(display "this needs to be here, sorry!") #(define newLa (map ly:music-deep-copy (list traLaLa traLaLa))) #(define twice (make-sequential-music newLa)) { \twice }
Due to parser lookahead
In this example, the assignment happens after parser has verified that
nothing interesting happens after traLaLa = { ... }
. Without
the dummy statement in the above example, the newLa
definition
is executed before traLaLa
is defined, leading to a syntax
error.
The above example shows how to ‘export’ music expressions from the
input to the Scheme interpreter. The opposite is also possible. By
wrapping a Scheme value in the function ly:export
, a Scheme
value is interpreted as if it were entered in LilyPond syntax.
Instead of defining \twice
, the example above could also have
been written as
... { #(ly:export (make-sequential-music (list newLa))) }
Scheme code is evaluated as soon as the parser encounters it. To define some Scheme code in a macro (to be called later), use Void functions, or
#(define (nopc) (ly:set-option 'point-and-click #f)) ... #(nopc) { c'4 }
Mixing Scheme and LilyPond variables is not possible with the
--safe
option.
When a music expression is parsed, it is converted into a set of Scheme music objects. The defining property of a music object is that it takes up time. Time is a rational number that measures the length of a piece of music in whole notes.
A music object has three kinds of types:
\simultaneous
leads to
a SimultaneousMusic. A list of all expressions
available is in the Internals Reference manual, under
Music expressions.
event
, but it is also a
note-event
, a rhythmic-event
, and a
melodic-event
. All classes of music are listed in the
Internals Reference, under
Music classes.
Music
.
The actual information of a music expression is stored in properties.
For example, a NoteEvent has pitch
and
duration
properties that store the pitch and duration of that
note. A list of all properties available is in the internals manual,
under Music properties.
A compound music expression is a music object that contains other
music objects in its properties. A list of objects can be stored in
the elements
property of a music object, or a single ‘child’
music object in the element
object. For example,
SequentialMusic has its children in elements
,
and GraceMusic has its single argument in
element
. The body of a repeat is stored in the element
property of RepeatedMusic, and the alternatives in
elements
.
This section explains how to gather the information necessary to create complicated music functions.
When writing a music function it is often instructive to inspect how
a music expression is stored internally. This can be done with the
music function \displayMusic
{ \displayMusic { c'4\f } }
will display
(make-music 'SequentialMusic 'elements (list (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 0 0)) (make-music 'AbsoluteDynamicEvent 'text "f")))))
By default, LilyPond will print these messages to the console along
with all the other messages. To split up these messages and save
the results of \display{STUFF}
, redirect the output to
a file.
lilypond file.ly >display.txt
With a bit of reformatting, the above information is easier to read,
(make-music 'SequentialMusic 'elements (list (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 0 0)) (make-music 'AbsoluteDynamicEvent 'text "f")))))
A { ... }
music sequence has the name SequentialMusic
,
and its inner expressions are stored as a list in its 'elements
property. A note is represented as an EventChord
expression,
containing a NoteEvent
object (storing the duration and
pitch properties) and any extra information (in this case, an
AbsoluteDynamicEvent
with a "f"
text property.
The NoteEvent
object is the first object of the
'elements
property of someNote
.
someNote = c' \displayMusic \someNote ===> (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 0 0))))
The display-scheme-music
function is the function used by
\displayMusic
to display the Scheme representation of a music
expression.
#(display-scheme-music (first (ly:music-property someNote 'elements))) ===> (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 0 0))
Then the note pitch is accessed through the 'pitch
property
of the NoteEvent
object,
#(display-scheme-music (ly:music-property (first (ly:music-property someNote 'elements)) 'pitch)) ===> (ly:make-pitch 0 0 0)
The note pitch can be changed by setting this 'pitch property,
#(set! (ly:music-property (first (ly:music-property someNote 'elements)) 'pitch) (ly:make-pitch 0 1 0)) ;; set the pitch to d'. \displayLilyMusic \someNote ===> d'
Suppose we want to create a function which translates
input like a
into a( a)
. We begin
by examining the internal representation of the music
we want to end up with.
\displayMusic{ a'( a') } ===> (make-music 'SequentialMusic 'elements (list (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 5 0)) (make-music 'SlurEvent 'span-direction -1))) (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 5 0)) (make-music 'SlurEvent 'span-direction 1)))))
The bad news is that the SlurEvent
expressions
must be added ‘inside’ the note (or more precisely,
inside the EventChord
expression).
Now we examine the input,
(make-music 'SequentialMusic 'elements (list (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch 0 5 0))))))
So in our function, we need to clone this expression (so that we
have two notes to build the sequence), add SlurEvents
to the
'elements
property of each one, and finally make a
SequentialMusic
with the two EventChords
.
doubleSlur = #(define-music-function (parser location note) (ly:music?) "Return: { note ( note ) }. `note' is supposed to be an EventChord." (let ((note2 (ly:music-deep-copy note))) (set! (ly:music-property note 'elements) (cons (make-music 'SlurEvent 'span-direction -1) (ly:music-property note 'elements))) (set! (ly:music-property note2 'elements) (cons (make-music 'SlurEvent 'span-direction 1) (ly:music-property note2 'elements))) (make-music 'SequentialMusic 'elements (list note note2))))
The easy way to add articulation to notes is to merge two music expressions into one context, as explained in Creating contexts. However, suppose that we want to write a music function which does this.
A $variable
inside the #{...#}
notation is like
using a regular \variable
in classical LilyPond
notation. We know that
{ \music -. -> }
will not work in LilyPond. We could avoid this problem by attaching the articulation to a fake note,
{ << \music s1*0-.-> }
but for the sake of this example, we will learn how to do this in Scheme. We begin by examining our input and desired output,
% input \displayMusic c4 ===> (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch -1 0 0)))) ===== % desired output \displayMusic c4-> ===> (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'duration (ly:make-duration 2 0 1 1) 'pitch (ly:make-pitch -1 0 0)) (make-music 'ArticulationEvent 'articulation-type "marcato")))
We see that a note (c4
) is represented as an EventChord
expression, with a NoteEvent
expression in its elements list. To
add a marcato articulation, an ArticulationEvent
expression must
be added to the elements property of the EventChord
expression.
To build this function, we begin with
(define (add-marcato event-chord) "Add a marcato ArticulationEvent to the elements of `event-chord', which is supposed to be an EventChord expression." (let ((result-event-chord (ly:music-deep-copy event-chord))) (set! (ly:music-property result-event-chord 'elements) (cons (make-music 'ArticulationEvent 'articulation-type "marcato") (ly:music-property result-event-chord 'elements))) result-event-chord))
The first line is the way to define a function in Scheme: the function
name is add-marcato
, and has one variable called
event-chord
. In Scheme, the type of variable is often clear
from its name. (this is good practice in other programming languages,
too!)
"Add a marcato..."
is a description of what the function does. This is not strictly necessary, but just like clear variable names, it is good practice.
(let ((result-event-chord (ly:music-deep-copy event-chord)))
let
is used to declare local variables. Here we use one local
variable, named result-event-chord
, to which we give the value
(ly:music-deep-copy event-chord)
. ly:music-deep-copy
is
a function specific to LilyPond, like all functions prefixed by
ly:
. It is use to make a copy of a music
expression. Here we copy event-chord
(the parameter of the
function). Recall that our purpose is to add a marcato to an
EventChord
expression. It is better to not modify the
EventChord
which was given as an argument, because it may be
used elsewhere.
Now we have a result-event-chord
, which is a
NoteEventChord
expression and is a copy of event-chord
. We
add the marcato to its elements list property.
(set! place new-value)
Here, what we want to set (the ‘place’) is the ‘elements’ property of
result-event-chord
expression.
(ly:music-property result-event-chord 'elements)
ly:music-property
is the function used to access music properties
(the 'elements
, 'duration
, 'pitch
, etc, that we
see in the \displayMusic
output above). The new value is the
former elements property, with an extra item: the
ArticulationEvent
expression, which we copy from the
\displayMusic
output,
(cons (make-music 'ArticulationEvent 'articulation-type "marcato") (ly:music-property result-event-chord 'elements))
cons
is used to add an element to a list without modifying the
original list. This is what we
want: the same list as before, plus the new ArticulationEvent
expression. The order inside the elements property is not important here.
Finally, once we have added the marcato articulation to its elements
property, we can return result-event-chord
, hence the last line of
the function.
Now we transform the add-marcato
function into a music
function,
addMarcato = #(define-music-function (parser location event-chord) (ly:music?) "Add a marcato ArticulationEvent to the elements of `event-chord', which is supposed to be an EventChord expression." (let ((result-event-chord (ly:music-deep-copy event-chord))) (set! (ly:music-property result-event-chord 'elements) (cons (make-music 'ArticulationEvent 'articulation-type "marcato") (ly:music-property result-event-chord 'elements))) result-event-chord))
We may verify that this music function works correctly,
\displayMusic \addMarcato c4
Markups are implemented as special Scheme functions which produce a Stencil object given a number of arguments.
The markup
macro builds markup expressions in Scheme while
providing a LilyPond-like syntax. For example,
(markup #:column (#:line (#:bold #:italic "hello" #:raise 0.4 "world") #:bigger #:line ("foo" "bar" "baz")))
is equivalent to:
\markup \column { \line { \bold \italic "hello" \raise #0.4 "world" } \bigger \line { foo bar baz } }
This example demonstrates the main translation rules between regular LilyPond markup syntax and Scheme markup syntax.
LilyPond Scheme \markup markup1
(markup markup1)
\markup { markup1 markup2 ... }
(markup markup1 markup2 ... )
\command
#:command
\variable
variable
\center-column { ... }
#:center-column ( ... )
string
"string"
#scheme-arg
scheme-arg
The whole Scheme language is accessible inside the
markup
macro. For example, You may use function calls inside
markup
in order to manipulate character strings. This is
useful when defining new markup commands (see
New markup command definition).
The markup-list argument of commands such as #:line
,
#:center
, and #:column
cannot be a variable or
the result of a function call.
(markup #:line (function-that-returns-markups))
is invalid. One should use the make-line-markup
,
make-center-markup
, or make-column-markup
functions
instead,
(markup (make-line-markup (function-that-returns-markups)))
In a markup like
\raise #0.5 "text example"
\raise
is actually represented by the raise-markup
function. The markup expression is stored as
(list raise-markup 0.5 (list simple-markup "text example"))
When the markup is converted to printable objects (Stencils), the
raise-markup
function is called as
(apply raise-markup \layout object list of property alists 0.5 the "text example" markup)
The raise-markup
function first creates the stencil for the
text example
string, and then it raises that Stencil by 0.5
staff space. This is a rather simple example; more complex examples
are in the rest
of this section, and in scm/define-markup-commands.scm.
New markup commands can be defined
with the define-markup-command
Scheme macro.
(define-markup-command (command-name layout props arg1 arg2 ...) (arg1-type? arg2-type? ...) ..command body..)
The arguments are
As a simple example, we show how to add a \smallcaps
command,
which selects a small caps font. Normally we could select the
small caps font,
\markup { \override #'(font-shape . caps) Text-in-caps }
This selects the caps font by setting the font-shape
property to
#'caps
for interpreting Text-in-caps
.
To make the above available as \smallcaps
command, we must
define a function using define-markup-command
. The command should
take a single argument of type markup
. Therefore the start of the
definition should read
(define-markup-command (smallcaps layout props argument) (markup?)
What follows is the content of the command: we should interpret
the argument
as a markup, i.e.,
(interpret-markup layout ... argument)
This interpretation should add '(font-shape . caps)
to the active
properties, so we substitute the following for the ... in the
above example:
(cons (list '(font-shape . caps) ) props)
The variable props
is a list of alists, and we prepend to it by
cons'ing a list with the extra setting.
Suppose that we are typesetting a recitative in an opera and
we would like to define a command that will show character names in a
custom manner. Names should be printed with small caps and moved a
bit to the left and top. We will define a \character
command
which takes into account the necessary translation and uses the newly
defined \smallcaps
command:
#(define-markup-command (character layout props name) (string?) "Print the character name in small caps, translated to the left and top. Syntax: \\character #\"name\"" (interpret-markup layout props (markup #:hspace 0 #:translate (cons -3 1) #:smallcaps name)))
There is one complication that needs explanation: texts above and below
the staff are moved vertically to be at a certain distance (the
padding
property) from the staff and the notes. To make sure
that this mechanism does not annihilate the vertical effect of our
#:translate
, we add an empty string (#:hspace 0
) before the
translated text. Now the #:hspace 0
will be put above the notes,
and the
name
is moved in relation to that empty string. The net effect is
that the text is moved to the upper left.
The final result is as follows:
{ c''^\markup \character #"Cleopatra" e'^\markup \character #"Giulio Cesare" }
We have used the caps
font shape, but suppose that our font
does not have a small-caps variant. In that case we have to fake
the small caps font by setting a string in upcase with the first
letter a little larger:
#(define-markup-command (smallcaps layout props str) (string?) "Print the string argument in small caps." (interpret-markup layout props (make-line-markup (map (lambda (s) (if (= (string-length s) 0) s (markup #:large (string-upcase (substring s 0 1)) #:translate (cons -0.6 0) #:tiny (string-upcase (substring s 1))))) (string-split str #\Space)))))
The smallcaps
command first splits its string argument into
tokens separated by spaces ((string-split str #\Space)
); for
each token, a markup is built with the first letter made large and
upcased (#:large (string-upcase (substring s 0 1))
), and a
second markup built with the following letters made tiny and upcased
(#:tiny (string-upcase (substring s 1))
). As LilyPond
introduces a space between markups on a line, the second markup is
translated to the left (#:translate (cons -0.6 0) ...
). Then,
the markups built for each token are put in a line by
(make-line-markup ...)
. Finally, the resulting markup is passed
to the interpret-markup
function, with the layout
and
props
arguments.
Note: there is now an internal command \smallCaps
which can
be used to set text in small caps. See
Text markup commands, for details.
Currently, the available combinations of arguments (after the standard
layout and props arguments) to a markup command defined with
define-markup-command
are limited as follows.
In the above table, scm represents native Scheme data types like ‘number’ or ‘string’.
As an example, it is not possible to use a markup command foo
with
four arguments defined as
#(define-markup-command (foo layout props num1 str1 num2 str2) (number? string? number? string?) ...)
If you apply it as, say,
\markup \foo #1 #"bar" #2 #"baz"
lilypond complains that it cannot parse foo
due to its
unknown Scheme signature.
Markup list commands are defined with the
define-markup-list-command
Scheme macro, which is similar to the
define-markup-command
macro described in
New markup command definition, except that where the latter returns
a single stencil, the former returns a list stencils.
In the following example, a \paragraph
markup list command is
defined, which returns a list of justified lines, the first one being
indented. The indent width is taken from the props
argument.
#(define-markup-list-command (paragraph layout props args) (markup-list?) (let ((indent (chain-assoc-get 'par-indent props 2))) (interpret-markup-list layout props (make-justified-lines-markup-list (cons (make-hspace-markup indent) args)))))
Besides the usual layout
and props
arguments, the
paragraph
markup list command takes a markup list argument, named
args
. The predicate for markup lists is markup-list?
.
First, the function gets the indent width, a property here named
par-indent
, from the property list props
If the property
is not found, the default value is 2
. Then, a list of justified
lines is made using the make-justified-lines-markup-list
function, which is related to the \justified-lines
built-in markup list command. An horizontal space is added at the
beginning using the make-hspace-markup
function. Finally, the
markup list is interpreted using the interpret-markup-list
function.
This new markup list command can be used as follows:
\markuplines { \paragraph { The art of music typography is called \italic {(plate) engraving.} The term derives from the traditional process of music printing. Just a few decades ago, sheet music was made by cutting and stamping the music into a zinc or pewter plate in mirror image. } \override-lines #'(par-indent . 4) \paragraph { The plate would be inked, the depressions caused by the cutting and stamping would hold ink. An image was formed by pressing paper to the plate. The stamping and cutting was completely done by hand. } }
Contexts can be modified during interpretation with Scheme code. The syntax for this is
\applyContext function
function should be a Scheme function taking a single argument, being the context to apply it to. The following code will print the current bar number on the standard output during the compile:
\applyContext #(lambda (x) (format #t "\nWe were called in barnumber ~a.\n" (ly:context-property x 'currentBarNumber)))
The most versatile way of tuning an object is \applyOutput
. Its
syntax is
\applyOutput context proc
where proc is a Scheme function, taking three arguments.
When interpreted, the function proc is called for every layout object found in the context context, with the following arguments:
\applyOutput
is processed.
In addition, the cause of the layout object, i.e., the music
expression or object that was responsible for creating it, is in the
object property cause
. For example, for a note head, this is a
NoteHead event, and for a Stem object,
this is a NoteHead object.
Here is a function to use for \applyOutput
; it blanks
note-heads on the center-line:
(define (blanker grob grob-origin context) (if (and (memq (ly:grob-property grob 'interfaces) note-head-interface) (eq? (ly:grob-property grob 'staff-position) 0)) (set! (ly:grob-property grob 'transparent) #t)))
Properties (like thickness, direction, etc.) can be set at fixed values with \override, e.g.
\override Stem #'thickness = #2.0
Properties can also be set to a Scheme procedure,
\override Stem #'thickness = #(lambda (grob) (if (= UP (ly:grob-property grob 'direction)) 2.0 7.0)) c b a g b a g b
In this case, the procedure is executed as soon as the value of the property is requested during the formatting process.
Most of the typesetting engine is driven by such callbacks. Properties that typically use callbacks include
stencil
X-offset
X-extent
The procedure always takes a single argument, being the grob.
If routines with multiple arguments must be called, the current grob
can be inserted with a grob closure. Here is a setting from
AccidentalSuggestion
,
(X-offset . ,(ly:make-simple-closure `(,+ ,(ly:make-simple-closure (list ly:self-alignment-interface::centered-on-x-parent)) ,(ly:make-simple-closure (list ly:self-alignment-interface::x-aligned-on-self)))))
In this example, both ly:self-alignment-interface::x-aligned-on-self
and
ly:self-alignment-interface::centered-on-x-parent
are called
with the grob as argument. The results are added with the +
function. To ensure that this addition is properly executed, the whole
thing is enclosed in ly:make-simple-closure
.
In fact, using a single procedure as property value is equivalent to
(ly:make-simple-closure (ly:make-simple-closure (list proc)))
The inner ly:make-simple-closure
supplies the grob as argument
to proc, the outer ensures that result of the function is
returned, rather than the simple-closure
object.
\tweak
The main disadvantage of \tweak
is its syntactical
inflexibility. For example, the following produces a syntax error.
F = \tweak #'font-size #-3 -\flageolet \relative c'' { c4^\F c4_\F }
With other words, \tweak
doesn't behave like an articulation
regarding the syntax; in particular, it can't be attached with
^
and _
.
Using Scheme, this problem can be circumvented. The route to the
result is given in Adding articulation to notes (example),
especially how to use \displayMusic
as a helping guide.
F = #(let ((m (make-music 'ArticulationEvent 'articulation-type "flageolet"))) (set! (ly:music-property m 'tweaks) (acons 'font-size -3 (ly:music-property m 'tweaks))) m) \relative c'' { c4^\F c4_\F }
Here, the tweaks
properties of the flageolet object
m
(created with make-music
) are extracted with
ly:music-property
, a new key-value pair to change the
font size is prepended to the property list with the
acons
Scheme function, and the result is finally
written back with set!
. The last element of the
let
block is the return value, m
itself.
There are a few classes of difficult adjustments.
\override
s.
In other words, an \override
always affects all pieces of a
broken spanner. To change only one part of a spanner at a line break,
it is necessary to hook into the formatting process. The
after-line-breaking
callback contains the Scheme procedure that
is called after the line breaks have been determined, and layout
objects have been split over different systems.
In the following example, we define a procedure
my-callback
. This procedure
extra-offset
.
This procedure is installed into Tie, so the last part of the broken tie is translated up.
#(define (my-callback grob) (let* ( ; have we been split? (orig (ly:grob-original grob)) ; if yes, get the split pieces (our siblings) (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() ))) (if (and (>= (length siblings) 2) (eq? (car (last-pair siblings)) grob)) (ly:grob-set-property! grob 'extra-offset '(-2 . 5))))) \relative c'' { \override Tie #'after-line-breaking = #my-callback c1 ~ \break c2 ~ c }
When applying this trick, the new after-line-breaking
callback
should also call the old one after-line-breaking
, if there is
one. For example, if using this with Hairpin
,
ly:hairpin::after-line-breaking
should also be called.
\override
for
technical reasons. Examples of those are NonMusicalPaperColumn
and PaperColumn
. They can be changed with the
\overrideProperty
function, which works similar to \once
\override
, but uses a different syntax.
\overrideProperty #"Score.NonMusicalPaperColumn" % Grob name #'line-break-system-details % Property name #'((next-padding . 20)) % Value
Note, however, that \override
, applied to
NoteMusicalPaperColumn
and PaperColumn
, still works as
expected within \context
blocks.
If you need to know more about music notation, here are some interesting titles to read.
A tutorial introduction to playing Jazz on the piano. One of the first
chapters contains an overview of chords in common use for Jazz music.
A concise, alphabetically ordered list of typesetting and music
(notation) issues, covering most of the normal cases.
A standard work on music notation.
This book is about music engraving, i.e., professional typesetting.
It contains directions on stamping, use of pens and notational
conventions. The sections on reproduction technicalities and history
are also interesting.
This manual specifically focuses on preparing print for publication by
Schirmer. It discusses many details that are not in other, normal
notation books. It also gives a good idea of what is necessary to bring
printouts to publication quality.
This book describes music notation for modern serious music, but starts out with a thorough overview of existing traditional notation practices.
The source archive includes a more elaborate BibTeX bibliography of over 100 entries in the bibliography.
The following charts shows two standard systems for printing chord names, along with the pitches they represent.
The following table shows chord modifiers that can be used in
\chordmode
to generate standard chord structures.
Chord type | Intervals | Modifier(s) |
Example
|
Major | Major third, perfect fifth |
5 or nothing
|
|
Minor | Minor third, perfect fifth |
m or m5
|
|
Augmented | Major third, augmented fifth |
aug
|
|
Diminished | Minor third, diminished fifth |
dim
|
|
Dominant seventh | Major triad, minor seventh |
7
|
|
Major seventh | Major triad, major seventh |
maj7 or maj
|
|
Minor seventh | Minor triad, minor seventh |
m7
|
|
Diminished seventh | Diminished triad, diminished seventh |
dim7
|
|
Augmented seventh | Augmented triad, minor seventh |
aug7
|
|
Half-diminished seventh | Diminished triad, minor seventh |
dim5m7
|
|
Minor-major seventh | Minor triad, major seventh |
7m5
|
|
Major sixth | Major triad, sixth |
6
|
|
Minor sixth | Minor triad, sixth |
m6
|
|
Dominant ninth | Dominant seventh, major ninth |
9
|
|
Major ninth | TODO |
maj9
|
|
Minor ninth | TODO |
m9
|
|
Dominant eleventh | Dominant ninth, perfect eleventh |
11
|
|
Major eleventh | TODO |
maj11
|
|
Minor eleventh | TODO |
m11
|
|
Dominant thirteenth | Dominant eleventh, major thirteenth |
13.11
|
|
Major thirteenth | TODO |
maj13.11
|
|
Minor thirteenth | TODO |
m13.11
|
|
Suspended second | TODO |
sus2
|
|
Suspended fourth | TODO |
sus4
|
|
The chart below shows the predefined fretboard diagrams.
The following is a list of names that can be used for the
midiInstrument
property.
acoustic grand contrabass lead 7 (fifths) bright acoustic tremolo strings lead 8 (bass+lead) electric grand pizzicato strings pad 1 (new age) honky-tonk orchestral strings pad 2 (warm) electric piano 1 timpani pad 3 (polysynth) electric piano 2 string ensemble 1 pad 4 (choir) harpsichord string ensemble 2 pad 5 (bowed) clav synthstrings 1 pad 6 (metallic) celesta synthstrings 2 pad 7 (halo) glockenspiel choir aahs pad 8 (sweep) music box voice oohs fx 1 (rain) vibraphone synth voice fx 2 (soundtrack) marimba orchestra hit fx 3 (crystal) xylophone trumpet fx 4 (atmosphere) tubular bells trombone fx 5 (brightness) dulcimer tuba fx 6 (goblins) drawbar organ muted trumpet fx 7 (echoes) percussive organ french horn fx 8 (sci-fi) rock organ brass section sitar church organ synthbrass 1 banjo reed organ synthbrass 2 shamisen accordion soprano sax koto harmonica alto sax kalimba concertina tenor sax bagpipe acoustic guitar (nylon) baritone sax fiddle acoustic guitar (steel) oboe shanai electric guitar (jazz) english horn tinkle bell electric guitar (clean) bassoon agogo electric guitar (muted) clarinet steel drums overdriven guitar piccolo woodblock distorted guitar flute taiko drum guitar harmonics recorder melodic tom acoustic bass pan flute synth drum electric bass (finger) blown bottle reverse cymbal electric bass (pick) shakuhachi guitar fret noise fretless bass whistle breath noise slap bass 1 ocarina seashore slap bass 2 lead 1 (square) bird tweet synth bass 1 lead 2 (sawtooth) telephone ring synth bass 2 lead 3 (calliope) helicopter violin lead 4 (chiff) applause viola lead 5 (charang) gunshot cello lead 6 (voice)
Usage syntax is detailed in Coloring objects.
black white red green blue cyan magenta yellow grey darkred darkgreen darkblue darkcyan darkmagenta darkyellow
X color names come several variants:
Any name that is spelled as a single word with capitalization (e.g. ‘LightSlateBlue’) can also be spelled as space separated words without capitalization (e.g. ‘light slate blue’).
The word ‘grey’ can always be spelled ‘gray’ (e.g. ‘DarkSlateGray’).
Some names can take a numerical suffix (e.g. ‘LightSalmon4’).
snow GhostWhite WhiteSmoke gainsboro FloralWhite OldLace linen AntiqueWhite PapayaWhip BlanchedAlmond bisque PeachPuff NavajoWhite moccasin cornsilk ivory LemonChiffon seashell honeydew MintCream azure AliceBlue lavender LavenderBlush MistyRose white black DarkSlateGrey DimGrey SlateGrey LightSlateGrey grey LightGrey MidnightBlue navy NavyBlue CornflowerBlue DarkSlateBlue SlateBlue MediumSlateBlue LightSlateBlue MediumBlue RoyalBlue blue DodgerBlue DeepSkyBlue SkyBlue LightSkyBlue SteelBlue LightSteelBlue LightBlue PowderBlue PaleTurquoise DarkTurquoise MediumTurquoise turquoise cyan LightCyan CadetBlue MediumAquamarine aquamarine DarkGreen DarkOliveGreen DarkSeaGreen SeaGreen MediumSeaGreen LightSeaGreen PaleGreen SpringGreen LawnGreen green chartreuse MediumSpringGreen GreenYellow LimeGreen YellowGreen ForestGreen OliveDrab DarkKhaki khaki PaleGoldenrod LightGoldenrodYellow LightYellow yellow gold LightGoldenrod goldenrod DarkGoldenrod RosyBrown IndianRed SaddleBrown sienna peru burlywood beige wheat SandyBrown tan chocolate firebrick brown DarkSalmon salmon LightSalmon orange DarkOrange coral LightCoral tomato OrangeRed red HotPink DeepPink pink LightPink PaleVioletRed maroon MediumVioletRed VioletRed magenta violet plum orchid MediumOrchid DarkOrchid DarkViolet BlueViolet purple MediumPurple thistle DarkGrey DarkBlue DarkCyan DarkMagenta DarkRed LightGreen
In the following names the suffix N can be a number in the range 1-4:
snowN seashellN AntiqueWhiteN bisqueN PeachPuffN NavajoWhiteN LemonChiffonN cornsilkN ivoryN honeydewN LavenderBlushN MistyRoseN azureN SlateBlueN RoyalBlueN blueN DodgerBlueN SteelBlueN DeepSkyBlueN SkyBlueN LightSkyBlueN LightSteelBlueN LightBlueN LightCyanN PaleTurquoiseN CadetBlueN turquoiseN cyanN aquamarineN DarkSeaGreenN SeaGreenN PaleGreenN SpringGreenN greenN chartreuseN OliveDrabN DarkOliveGreenN khakiN LightGoldenrodN LightYellowN yellowN goldN goldenrodN DarkGoldenrodN RosyBrownN IndianRedN siennaN burlywoodN wheatN tanN chocolateN firebrickN brownN salmonN LightSalmonN orangeN DarkOrangeN coralN tomatoN OrangeRedN redN DeepPinkN HotPinkN pinkN LightPinkN PaleVioletRedN maroonN VioletRedN magentaN orchidN plumN MediumOrchidN DarkOrchidN purpleN MediumPurpleN thistleN
A grey scale can be obtained using:
greyN
Where N is in the range 0-100.
The following symbols are available in the Emmentaler font and may be
accessed directly using text markup such as g^\markup {
\musicglyph #"scripts.segno" }
, see Formatting text.
The following styles may be used for note heads.
The following commands can all be used inside \markup { }
.
\abs-fontsize
size (number) arg (markup)Use size as the absolute font size to display arg. Adjust baseline skip and word space accordingly.
\markup { default text font size \hspace #2 \abs-fontsize #16 { text font size 16 } \hspace #2 \abs-fontsize #12 { text font size 12 } }
\bigger
arg (markup)Increase the font size relative to current setting.
\markup { \huge { huge \hspace #2 \bigger { bigger } \hspace #2 huge } }
\bold
arg (markup)\markup { default \hspace #2 \bold bold }
\box
arg (markup)
Draw a box round arg. Looks at thickness
,
box-padding
and font-size
properties to determine line
thickness and padding around the markup.
\markup { \override #'(box-padding . 0.5) \box \line { V. S. } }
Used properties:
box-padding
(0.2)
font-size
(0)
thickness
(1)
\caps
arg (markup)Copy of the \smallCaps
command.
\markup { default \hspace #2 \caps { Text in small caps } }
\dynamic
arg (markup)Use the dynamic font. This font only contains s, f, m, z, p, and r. When producing phrases, like ‘più f’, the normal words (like ‘più’) should be done in a different font. The recommended font for this is bold and italic.
\markup { \dynamic { sfzp } }
\finger
arg (markup)Set the argument as small numbers.
\markup { \finger { 1 2 3 4 5 } }
\fontCaps
arg (markup)Note: \fontCaps
requires the installation and selection of
fonts which support the caps
font shape.
\fontsize
increment (number) arg (markup)Add increment to the font-size. Adjust baseline skip accordingly.
\markup { default \hspace #2 \fontsize #-1.5 smaller }
Used properties:
baseline-skip
(2)
word-space
(1)
font-size
(0)
\huge
arg (markup)\markup { default \hspace #2 \huge huge }
\italic
arg (markup)Use italic font-shape
for arg.
\markup { default \hspace #2 \italic italic }
\large
arg (markup)\markup { default \hspace #2 \large large }
\larger
arg (markup)\markup { default \hspace #2 \larger larger }
\magnify
sz (number) arg (markup)Set the font magnification for its argument. In the following example, the middle A is 10% larger:
A \magnify #1.1 { A } A
Note: Magnification only works if a font name is explicitly selected.
Use \fontsize
otherwise.
\markup { default \hspace #2 \magnify #1.5 { 50% larger } }
\medium
arg (markup)Switch to medium font series (in contrast to bold).
\markup { \bold { some bold text \hspace #2 \medium { medium font series } \hspace #2 bold again } }
\normal-size-sub
arg (markup)Set arg in subscript, in a normal font size.
\markup { default \normal-size-sub { subscript in standard size } }
Used properties:
baseline-skip
\normal-size-super
arg (markup)Set arg in superscript with a normal font size.
\markup { default \normal-size-super { superscript in standard size } }
Used properties:
baseline-skip
\normal-text
arg (markup)Set all font related properties (except the size) to get the default normal text font, no matter what font was used earlier.
\markup { \huge \bold \sans \caps { Some text with font overrides \hspace #2 \normal-text { Default text, same font-size } \hspace #2 More text as before } }
\normalsize
arg (markup)\markup { \teeny { this is very small \hspace #2 \normalsize { normal size } \hspace #2 teeny again } }
\number
arg (markup)Set font family to number
, which yields the font used for
time signatures and fingerings. This font only contains numbers and
some punctuation. It doesn't have any letters.
\markup { \number { 0 1 2 3 4 5 6 7 8 9 . , } }
\roman
arg (markup)\markup { \sans \bold { sans serif, bold \hspace #2 \roman { text in roman font family } \hspace #2 return to sans } }
\sans
arg (markup)Switch to the sans serif family.
\markup { default \hspace #2 \sans { sans serif } }
\simple
str (string)
A simple text string; \markup { foo }
is equivalent with
\markup { \simple #"foo" }
.
Note: for creating standard text markup or defining new markup commands,
the use of \simple
is unnecessary.
\markup { \simple #"simple" \simple #"text" \simple #"strings" }
\small
arg (markup)\markup { default \hspace #2 \small small }
\smallCaps
text (markup)Note: \smallCaps
does not support accented characters.
\markup { default \hspace #2 \smallCaps { Text in small caps } }
\smaller
arg (markup)Decrease the font size relative to current setting.
\markup { \fontsize #3.5 { some large text \hspace #2 \smaller { a bit smaller } \hspace #2 more large text } }
\sub
arg (markup)\markup { \concat { H \sub { 2 } O } }
Used properties:
baseline-skip
font-size
(0)
\super
arg (markup)
Raising and lowering texts can be done with \super
and
\sub
:
\markup { E = \concat { mc \super 2 } }
Used properties:
baseline-skip
font-size
(0)
\teeny
arg (markup)\markup { default \hspace #2 \teeny teeny }
\text
arg (markup)Use a text font instead of music symbol or music alphabet font.
\markup { \number { 1, 2, \text { three, four, } 5 } }
\tiny
arg (markup)\markup { default \hspace #2 \tiny tiny }
\typewriter
arg (markup)Use font-family
typewriter for arg.
\markup { default \hspace #2 \typewriter typewriter }
\underline
arg (markup)
Underline arg. Looks at thickness
to determine line
thickness and y offset.
\markup { default \hspace #2 \override #'(thickness . 2) \underline { underline } }
Used properties:
thickness
(1)
\upright
arg (markup)Set font shape to upright
. This is the opposite of italic
.
\markup { \italic { italic text \hspace #2 \upright { upright text } \hspace #2 italic again } }
\center-align
arg (markup)\markup { \column { one \center-align two three } }
\center-column
args (list of markups)
Put args
in a centered column.
\markup { \center-column { one two three } }
Used properties:
baseline-skip
\column
args (list of markups)
Stack the markups in args vertically. The property
baseline-skip
determines the space between each
markup in args.
\markup { \column { one two three } }
Used properties:
baseline-skip
\combine
m1 (markup) m2 (markup)Print two markups on top of each other.
Note: \combine
cannot take a list of markups enclosed in
curly braces as an argument; the follow example will not compile:
\combine { a list }
\markup { \fontsize #5 \override #'(thickness . 2) \combine \draw-line #'(0 . 4) \arrow-head #Y #DOWN ##f }
\concat
args (list of markups)
Concatenate args in a horizontal line, without spaces inbetween.
Strings and simple markups are concatenated on the input level, allowing
ligatures. For example, \concat { "f" \simple #"i" }
is
equivalent to "fi"
.
\markup { \concat { one two three } }
\dir-column
args (list of markups)
Make a column of args, going up or down, depending on the setting
of the #'direction
layout property.
\markup { \override #'(direction . 1) { \dir-column { going up } } \dir-column { going down } }
Used properties:
baseline-skip
direction
\fill-line
markups (list of markups)Put markups in a horizontal line of width line-width. The markups are spaced or flushed to fill the entire line. If there are no arguments, return an empty stencil.
\markup { \column { \fill-line { Words evenly spaced across the page } \null \fill-line { \line { Text markups } \line { \italic { evenly spaced } } \line { across the page } } } }
Used properties:
line-width
(#f)
word-space
(1)
text-direction
(1)
\general-align
axis (integer) dir (number) arg (markup)Align arg in axis direction to the dir side.
\markup { \column { one \general-align #X #LEFT two three \null one \general-align #X #CENTER two three \null \line { one \general-align #Y #UP two three } \null \line { one \general-align #Y #3.2 two three } } }
\halign
dir (number) arg (markup)
Set horizontal alignment. If dir is -1
, then it is
left-aligned, while +1
is right. Values in between interpolate
alignment accordingly.
\markup { \column { one \halign #LEFT two three \null one \halign #CENTER two three \null one \halign #RIGHT two three \null one \halign #-5 two three } }
\hcenter-in
length (number) arg (markup)Center arg horizontally within a box of extending length/2 to the left and right.
\new StaffGroup << \new Staff { \set Staff.instrumentName = \markup { \hcenter-in #12 Oboe } c''1 } \new Staff { \set Staff.instrumentName = \markup { \hcenter-in #12 Bassoon } \clef tenor c'1 } >>
\hspace
amount (number)This produces an invisible object taking horizontal space. For example,
\markup { A \hspace #2.0 B }
puts extra space between A and B, on top of the space that is normally inserted before elements on a line.
\markup { one \hspace #2 two \hspace #8 three }
\justify-field
symbol (symbol)Justify the data which has been assigned to symbol.
\header { title = "My title" descr = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." } \paper { bookTitleMarkup = \markup { \column { \fill-line { \fromproperty #'header:title } \null \justify-field #'header:descr } } } \markup { \null }
\justify
args (list of markups)
Like wordwrap, but with lines stretched to justify the margins.
Use \override #'(line-width .
X)
to set the line width;
X is the number of staff spaces.
\markup { \justify { Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. } }
Used properties:
text-direction
(1)
word-space
line-width
(#f)
baseline-skip
\justify-string
arg (string)Justify a string. Paragraphs may be separated with double newlines
\markup { \override #'(line-width . 40) \justify-string #"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum" }
Used properties:
text-direction
(1)
word-space
line-width
baseline-skip
\left-align
arg (markup)\markup { \column { one \left-align two three } }
\left-column
args (list of markups)
Put args
in a left-aligned column.
\markup { \left-column { one two three } }
Used properties:
baseline-skip
\line
args (list of markups)Put args in a horizontal line. The property word-space
determines the space between each markup in args.
\markup { \line { one two three } }
Used properties:
text-direction
(1)
word-space
\lower
amount (number) arg (markup)
Lower arg by the distance amount.
A negative amount indicates raising; see also \raise
.
\markup { one \lower #3 two three }
\pad-around
amount (number) arg (markup)Add padding amount all around arg.
\markup { \box { default } \hspace #2 \box { \pad-around #0.5 { padded } } }
\pad-markup
padding (number) arg (markup)Add space around a markup object.
\markup { \box { default } \hspace #2 \box { \pad-around #1 { padded } } }
\pad-to-box
x-ext (pair of numbers) y-ext (pair of numbers) arg (markup)Make arg take at least x-ext, y-ext space.
\markup { \box { default } \hspace #4 \box { \pad-to-box #'(0 . 10) #'(0 . 3) { padded } } }
\pad-x
amount (number) arg (markup)Add padding amount around arg in the X direction.
\markup { \box { default } \hspace #4 \box { \pad-x #2 { padded } } }
\put-adjacent
axis (integer) dir (direction) arg1 (markup) arg2 (markup)\raise
amount (number) arg (markup)
Raise arg by the distance amount.
A negative amount indicates lowering, see also \lower
.
The argument to \raise
is the vertical displacement amount,
measured in (global) staff spaces. \raise
and \super
raise objects in relation to their surrounding markups.
If the text object itself is positioned above or below the staff, then
\raise
cannot be used to move it, since the mechanism that
positions it next to the staff cancels any shift made with
\raise
. For vertical positioning, use the padding
and/or extra-offset
properties.
\markup { C \small \bold \raise #1.0 9/7+ }
\right-align
arg (markup)\markup { \column { one \right-align two three } }
\right-column
args (list of markups)
Put args
in a right-aligned column.
\markup { \right-column { one two three } }
Used properties:
baseline-skip
\rotate
ang (number) arg (markup)Rotate object with ang degrees around its center.
\markup { default \hspace #2 \rotate #45 \line { rotated 45° } }
\translate
offset (pair of numbers) arg (markup)This translates an object. Its first argument is a cons of numbers.
A \translate #(cons 2 -3) { B C } D
This moves ‘B C’ 2 spaces to the right, and 3 down, relative to its
surroundings. This command cannot be used to move isolated scripts
vertically, for the same reason that \raise
cannot be used for
that.
\markup { * \translate #'(2 . 3) \line { translated two spaces right, three up } }
\translate-scaled
offset (pair of numbers) arg (markup)
Translate arg by offset, scaling the offset by the
font-size
.
\markup { \fontsize #5 { * \translate #'(2 . 3) translate \hspace #2 * \translate-scaled #'(2 . 3) translate-scaled } }
Used properties:
font-size
(0)
\vcenter
arg (markup)\markup { one \vcenter two three }
\wordwrap-field
symbol (symbol)Wordwrap the data which has been assigned to symbol.
\header { title = "My title" descr = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat." } \paper { bookTitleMarkup = \markup { \column { \fill-line { \fromproperty #'header:title } \null \wordwrap-field #'header:descr } } } \markup { \null }
\wordwrap
args (list of markups)Simple wordwrap. Use \override #'(line-width .
X)
to set
the line width, where X is the number of staff spaces.
\markup { \wordwrap { Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. } }
Used properties:
text-direction
(1)
word-space
line-width
(#f)
baseline-skip
\wordwrap-string
arg (string)Wordwrap a string. Paragraphs may be separated with double newlines.
\markup { \override #'(line-width . 40) \wordwrap-string #"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum" }
Used properties:
text-direction
(1)
word-space
line-width
baseline-skip
\arrow-head
axis (integer) direction (direction) filled (boolean)Produce an arrow head in specified direction and axis. Use the filled head if filled is specified.
\markup { \fontsize #5 { \general-align #Y #DOWN { \arrow-head #Y #UP ##t \arrow-head #Y #DOWN ##f \hspace #2 \arrow-head #X #RIGHT ##f \arrow-head #X #LEFT ##f } } }
\beam
width (number) slope (number) thickness (number)Create a beam with the specified parameters.
\markup { \beam #5 #1 #2 }
\bracket
arg (markup)Draw vertical brackets around arg.
\markup { \bracket { \note #"2." #UP } }
\circle
arg (markup)
Draw a circle around arg. Use thickness
,
circle-padding
and font-size
properties to determine line
thickness and padding around the markup.
\markup { \circle { Hi } }
Used properties:
circle-padding
(0.2)
font-size
(0)
thickness
(1)
\draw-circle
radius (number) thickness (number) fill (boolean)A circle of radius radius, thickness thickness and optionally filled.
\markup { \draw-circle #2 #0.5 ##f \hspace #2 \draw-circle #2 #0 ##t }
\draw-line
dest (pair of numbers)\markup { \draw-line #'(4 . 4) \override #'(thickness . 5) \draw-line #'(-3 . 0) }
Used properties:
thickness
(1)
\epsfile
axis (number) size (number) file-name (string)Inline an EPS image. The image is scaled along axis to size.
\markup { \general-align #Y #DOWN { \epsfile #X #20 #"context-example.eps" \epsfile #Y #20 #"context-example.eps" } }
\filled-box
xext (pair of numbers) yext (pair of numbers) blot (number)Draw a box with rounded corners of dimensions xext and yext. For example,
\filled-box #'(-.3 . 1.8) #'(-.3 . 1.8) #0creates a box extending horizontally from -0.3 to 1.8 and vertically from -0.3 up to 1.8, with corners formed from a circle of diameter 0 (i.e. sharp corners).
\markup { \filled-box #'(0 . 4) #'(0 . 4) #0 \filled-box #'(0 . 2) #'(-4 . 2) #0.4 \filled-box #'(1 . 8) #'(0 . 7) #0.2 \with-color #white \filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7 }
\hbracket
arg (markup)Draw horizontal brackets around arg.
\markup { \hbracket { \line { one two three } } }
\postscript
str (string)
This inserts str directly into the output as a PostScript
command string. Due to technicalities of the output backends,
different scales should be used for the TeX and PostScript backend,
selected with -f
.
For the TeX backend, the following string prints a rotated text
0 0 moveto /ecrm10 findfont 1.75 scalefont setfont 90 rotate (hello) show
The magical constant 1.75 scales from LilyPond units (staff spaces) to TeX dimensions.
For the postscript backend, use the following
gsave /ecrm10 findfont 10.0 output-scale div scalefont setfont 90 rotate (hello) show grestore
eyeglassesps = #" 0.15 setlinewidth -0.9 0 translate 1.1 1.1 scale 1.2 0.7 moveto 0.7 0.7 0.5 0 361 arc stroke 2.20 0.70 0.50 0 361 arc stroke 1.45 0.85 0.30 0 180 arc stroke 0.20 0.70 moveto 0.80 2.00 lineto 0.92 2.26 1.30 2.40 1.15 1.70 curveto stroke 2.70 0.70 moveto 3.30 2.00 lineto 3.42 2.26 3.80 2.40 3.65 1.70 curveto stroke" eyeglasses = \markup { \with-dimensions #'(0 . 4.4) #'(0 . 2.5) \postscript #eyeglassesps } \relative c'' { c2^\eyeglasses a2_\eyeglasses }
\rounded-box
arg (markup) Draw a box with rounded corners around arg. Looks at thickness
,
box-padding
and font-size
properties to determine line
thickness and padding around the markup; the corner-radius
property
makes it possible to define another shape for the corners (default is 1).
c4^\markup { \rounded-box { Overtura } } c,8. c16 c4 r
Used properties:
box-padding
(0.5)
font-size
(0)
corner-radius
(1)
thickness
(1)
\triangle
filled (boolean)A triangle, either filled or empty.
\markup { \triangle ##t \hspace #2 \triangle ##f }
Used properties:
baseline-skip
(2)
font-size
(0)
thickness
(0.1)
\with-url
url (string) arg (markup)Add a link to URL url around arg. This only works in the PDF backend.
\markup { \with-url #"http://lilypond.org/web/" { LilyPond ... \italic { music notation for everyone } } }
\doubleflat
\markup { \doubleflat }
\doublesharp
\markup { \doublesharp }
\flat
\markup { \flat }
\musicglyph
glyph-name (string)glyph-name is converted to a musical symbol; for example,
\musicglyph #"accidentals.natural"
selects the natural sign from
the music font. See The Feta font for a complete listing of
the possible glyphs.
\markup { \musicglyph #"f" \musicglyph #"rests.2" \musicglyph #"clefs.G_change" }
\natural
\markup { \natural }
\note-by-number
log (number) dot-count (number) dir (number)Construct a note symbol, with stem. By using fractional values for dir, you can obtain longer or shorter stems.
\markup { \note-by-number #3 #0 #DOWN \hspace #2 \note-by-number #1 #2 #0.8 }
Used properties:
style
('())
font-size
(0)
\note
duration (string) dir (number)
This produces a note with a stem pointing in dir direction, with
the duration for the note head type and augmentation dots. For
example, \note #"4." #-0.75
creates a dotted quarter note, with
a shortened down stem.
\markup { \override #'(style . cross) { \note #"4.." #UP } \hspace #2 \note #"breve" #0 }
Used properties:
style
('())
font-size
(0)
\score
score (unknown)\markup { \score { \new PianoStaff << \new Staff \relative c' { \key f \major \time 3/4 \mark \markup { Allegro } f2\p( a4) c2( a4) bes2( g'4) f8( e) e4 r } \new Staff \relative c { \clef bass \key f \major \time 3/4 f8( a c a c a f c' es c es c) f,( bes d bes d bes) f( g bes g bes g) } >> \layout { indent = 0.0\cm \context { \Score \override RehearsalMark #'break-align-symbols = #'(time-signature key-signature) \override RehearsalMark #'self-alignment-X = #LEFT } \context { \Staff \override TimeSignature #'break-align-anchor-alignment = #LEFT } } } }
\semiflat
\markup { \semiflat }
\semisharp
\markup { \semisharp }
\sesquiflat
\markup { \sesquiflat }
\sesquisharp
\markup { \sesquisharp }
\sharp
\markup { \sharp }
\tied-lyric
str (string)Like simple-markup, but use tie characters for ‘~’ tilde symbols.
\markup { \tied-lyric #"Lasciate~i monti" }
\fret-diagram
definition-string (string)Make a (guitar) fret diagram. For example, say
\markup \fret-diagram #"s:0.75;6-x;5-x;4-o;3-2;2-3;1-2;"
for fret spacing 3/4 of staff space, D chord diagram
Syntax rules for definition-string:
s:
number – Set the fret spacing of the diagram (in staff
spaces).
Default: 1.
t:
number – Set the line thickness (in staff spaces).
Default: 0.05.
h:
number – Set the height of the diagram in frets.
Default: 4.
w:
number – Set the width of the diagram in strings.
Default: 6.
f:
number – Set fingering label type
(0 = none, 1 = in circle on string, 2 = below string).
Default: 0.
d:
number – Set radius of dot, in terms of fret spacing.
Default: 0.25.
p:
number – Set the position of the dot in the fret space.
0.5 is centered; 1 is on lower fret bar, 0 is on upper fret bar.
Default: 0.6.
c:
string1-
string2-
fret – Include a
barre mark from string1 to string2 on fret.
-
fret – Place a dot on string at fret.
If fret is ‘o’, string is identified as open.
If fret is ‘x’, string is identified as muted.
-
fret-
fingering – Place a dot on
string at fret, and label with fingering as defined
by the f:
code.
Used properties:
thickness
(0.5)
fret-diagram-details
size
(1.0)
align-dir
(-0.4)
\fret-diagram-terse
definition-string (string)Make a fret diagram markup using terse string-based syntax.
Here is an example
\markup \fret-diagram-terse #"x;x;o;2;3;2;"
for a D chord diagram.
Syntax rules for definition-string:
-
,
followed by the finger indicator, e.g. ‘3-2’ for playing the third
fret with the second finger.
-(
to start a barre and -)
to end the barre.
Used properties:
thickness
(0.5)
fret-diagram-details
size
(1.0)
align-dir
(-0.4)
\fret-diagram-verbose
marking-list (list)Make a fret diagram containing the symbols indicated in marking-list.
For example,
\markup \fret-diagram-verbose #'((mute 6) (mute 5) (open 4) (place-fret 3 2) (place-fret 2 3) (place-fret 1 2))
produces a standard D chord diagram without fingering indications.
Possible elements in marking-list:
(mute
string-number)
(open
string-number)
(barre
start-string end-string fret-number)
(place-fret
string-number fret-number finger-value)
place-fret
element is present,
finger-value will be displayed according to the setting of the
variable finger-code. There is no limit to the number of fret
indications per string.
Used properties:
thickness
(0.5)
fret-diagram-details
size
(1.0)
align-dir
(-0.4)
\harp-pedal
definition-string (string)Possible elements in definition-string:
^
-
v
|
o
The function also checks if the string has the typical form of three pedals, then the divider and then the remaining four pedals. If not it prints out a warning. However, in any case, it will also print each symbol in the order as given. This means you can place the divider (even multiple dividers) anywhere you want, but you'll have to live with the warnings.
The appearance of the diagram can be tweaked inter alia using the size property
of the TextScript grob (\override Voice.TextScript #'size = #0.3
) for
the overall, the thickness property
(\override Voice.TextScript #'thickness = #3
) for the line thickness of
the horizontal line and the divider. The remaining configuration (box sizes,
offsets and spaces) is done by the harp-pedal-details list of properties
(\override Voice.TextScript #'harp-pedal-details #'box-width = #1
).
It contains the following settings: box-offset
(vertical shift of the
box center for up/down pedals), box-width
, box-height
,
space-before-divider
(the spacing between two boxes before the
divider) and space-after-divider
(box spacing after the divider).
\markup \harp-pedal #"^-v|--ov^"
Used properties:
thickness
(0.5)
harp-pedal-details
size
(1.0)
\backslashed-digit
num (integer)A feta number, with backslash. This is for use in the context of figured bass notation.
\markup { \backslashed-digit #5 \hspace #2 \override #'(thickness . 3) \backslashed-digit #7 }
Used properties:
thickness
(1.6)
font-size
(0)
\char
num (integer)Produce a single character. For example, \char #65
produces the
letter ‘A’.
\markup { \char #65 }
\fraction
arg1 (markup) arg2 (markup)Make a fraction of two markups.
\markup { π ≈ \fraction 355 113 }
Used properties:
font-size
(0)
\fromproperty
symbol (symbol)Read the symbol from property settings, and produce a stencil from the markup contained within. If symbol is not defined, it returns an empty markup.
\header { myTitle = "myTitle" title = \markup { from \italic \fromproperty #'header:myTitle } } \markup { \null }
\lookup
glyph-name (string)\markup { \override #'(font-encoding . fetaBraces) { \lookup #"brace200" \hspace #2 \rotate #180 \lookup #"brace180" } }
\markalphabet
num (integer)Make a markup letter for num. The letters start with A to Z and continue with double letters.
\markup { \markalphabet #8 \hspace #2 \markalphabet #26 }
\markletter
num (integer)Make a markup letter for num. The letters start with A to Z (skipping letter I), and continue with double letters.
\markup { \markletter #8 \hspace #2 \markletter #26 }
\null
An empty markup with extents of a single point.
\markup { \null }
\on-the-fly
procedure (symbol) arg (markup)Apply the procedure markup command to arg.
procedure should take a single argument.
\override
new-prop (pair) arg (markup)Add the first argument in to the property list. Properties may be any sort of property supported by font-interface and text-interface, for example
\override #'(font-family . married) "bla"
\markup { \line { \column { default baseline-skip } \hspace #2 \override #'(baseline-skip . 4) { \column { increased baseline-skip } } } }
\page-ref
label (symbol) gauge (markup) default (markup)
Reference to a page number. label is the label set on the referenced
page (using the \label
command), gauge a markup used to estimate
the maximum width of the page number, and default the value to display
when label is not found.
\slashed-digit
num (integer)A feta number, with slash. This is for use in the context of figured bass notation.
\markup { \slashed-digit #5 \hspace #2 \override #'(thickness . 3) \slashed-digit #7 }
Used properties:
thickness
(1.6)
font-size
(0)
\stencil
stil (unknown)\markup { \stencil #(make-circle-stencil 2 0 #t) }
\strut
Create a box of the same height as the space in the current font.
\transparent
arg (markup)Make the argument transparent.
\markup { \transparent { invisible text } }
\verbatim-file
name (string)Read the contents of a file, and include it verbatim.
\markup { \verbatim-file #"simple.ly" }
\whiteout
arg (markup)Provide a white background for arg.
\markup { \combine \filled-box #'(-1 . 10) #'(-3 . 4) #1 \whiteout whiteout }
\with-color
color (list) arg (markup)Draw arg in color specified by color.
\markup { \with-color #red red \hspace #2 \with-color #green green \hspace #2 \with-color #blue blue }
\with-dimensions
x (pair of numbers) y (pair of numbers) arg (markup)The following commands can all be used with \markuplines
.
\column-lines
args (list of markups)Like \column
, but return a list of lines instead of a single markup.
baseline-skip
determines the space between each markup in args.
Used properties:
baseline-skip
\justified-lines
args (list of markups)
Like \justify
, but return a list of lines instead of a single markup.
Use \override-lines #'(line-width .
X)
to set the line width;
X is the number of staff spaces.
Used properties:
text-direction
(1)
word-space
line-width
(#f)
baseline-skip
\override-lines
new-prop (pair) args (list of markups)\wordwrap-internal
justify (boolean) args (list of markups)Internal markup list command used to define \justify
and \wordwrap
.
Used properties:
text-direction
(1)
word-space
line-width
(#f)
\wordwrap-lines
args (list of markups)Like \wordwrap
, but return a list of lines instead of a single markup.
Use \override-lines #'(line-width .
X)
to set the line width,
where X is the number of staff spaces.
Used properties:
text-direction
(1)
word-space
line-width
(#f)
baseline-skip
\wordwrap-string-internal
justify (boolean) arg (string)Internal markup list command used to define \justify-string
and
\wordwrap-string
.
Used properties:
text-direction
(1)
word-space
line-width
Here is a chart showing all scripts available,
aDueText
(markup)alignAboveContext
(string)alignBassFigureAccidentals
(boolean)alignBelowContext
(string)associatedVoice
(string)Voice
that has the
melody for this Lyrics
line.
autoAccidentals
(list)For determining when to print an accidental, several different rules are tried. The rule that gives the highest number of accidentals is used.
Each entry in the list is either a symbol or a procedure.
The procedure takes the following arguments:
context
pitch
barnum
measurepos
The procedure returns a pair of booleans. The first states whether an extra
natural should be added. The second states whether an accidental should be
printed. (#t . #f)
does not make sense.
autoBeamCheck
(procedure)#f
return value
starts or stops the auto beam.
autoBeamSettings
(list)autoBeaming
(boolean)autoCautionaries
(list)autoAccidentals
,
but it controls cautionary accidentals rather than normal ones. Both
lists are tried, and the one giving the most accidentals wins. In
case of draw, a normal accidental is typeset.
automaticBars
(boolean)\bar
command. Unlike the \cadenza
keyword, measures
are still counted. Bar generation will resume according to that count
if this property is unset.
barAlways
(boolean)barCheckSynchronize
(boolean)measurePosition
when finding a bar check.
barNumberVisibility
(procedure)bassFigureFormatFunction
(procedure)BassFigure
grob. It
takes a list of BassFigureEvent
s, a context, and the grob to
format.
bassStaffProperties
(list)PianoStaff
. Used by
\autochange
.
beatGrouping
(list)'(2 3)
.
beatLength
(moment)chordChanges
(boolean)chordNameExceptions
(list)(
chord .
markup)
entries.
chordNameExceptionsFull
(list)(
chord .
markup)
entries.
chordNameExceptionsPartial
(list)(
chord . (
prefix-markup
suffix-markup))
entries.
chordNameFunction
(procedure)chordNameSeparator
(markup)chordNoteNamer
(procedure)chordPrefixSpacer
(number)chordRootNamer
(procedure)clefGlyph
(string)clefOctavation
(integer)clefPosition
(number)completionBusy
(boolean)connectArpeggios
(boolean)countPercentRepeats
(boolean)createKeyOnClefChange
(boolean)createSpacing
(boolean)StaffSpacing
objects?
Should be set for staves.
crescendoSpanner
(symbol)crescendoText
(markup)currentBarNumber
(integer)decrescendoSpanner
(symbol)crescendoSpanner
.
decrescendoText
(markup)defaultBarType
(string)whichBar
for information on available bar types.
This variable is read by Timing_translator at
Score level.
doubleSlurs
(boolean)drumPitchTable
(hash table)drumStyleTable
(hash table)The layout style is a hash table, containing the drum-pitches (e.g.,
the symbol ‘hihat’) as keys, and a list
(
notehead-style script vertical-position)
as
values.
explicitClefVisibility
(vector)explicitKeySignatureVisibility
(vector)break-visibility
property will set the visibility for normal
(i.e., at the start of the line) key signatures.
extendersOverRests
(boolean)extraNatural
(boolean)figuredBassAlterationDirection
(direction)figuredBassCenterContinuations
(boolean)figuredBassFormatter
(procedure)figuredBassPlusDirection
(direction)fingeringOrientations
(list)firstClef
(boolean)followVoice
(boolean)fontSize
(number)forbidBreak
(boolean)##t
, prevent a line break
at this point.
forceClef
(boolean)gridInterval
(moment)GridPoint
s.
harmonicAccidentals
(boolean)harmonicDots
(boolean)highStringOne
(boolean)ignoreBarChecks
(boolean)ignoreFiguredBassRest
(boolean)ignoreMelismata
(boolean)implicitBassFigures
(list)implicitTimeSignatureVisibility
(vector)instrumentCueName
(markup)instrumentEqualizer
(procedure)(
min .
max)
pair
of numbers for the loudness range of the instrument.
instrumentName
(markup)instrument
property labels the staff in the first system, and
the instr
property labels following lines.
instrumentTransposition
(pitch)\quote
s.
internalBarNumber
(integer)Accidental_engraver
.
keepAliveInterfaces
(list)remove-empty
set
around for.
keyAlterationOrder
(list)(
step
.
alter)
, where step is a number from 0 to 6 and
alter from -2 (sharp) to 2 (flat).
keySignature
(list)(
step .
alter)
or ((
octave .
step) .
alter)
, where step is a number in the range
0 to 6 and alter a fraction, denoting alteration. For
alterations, use symbols, e.g. keySignature = #`((6 . ,FLAT))
.
lyricMelismaAlignment
(direction)majorSevenSymbol
(markup)markFormatter
(procedure)maximumFretStretch
(number)measureLength
(moment)measurePosition
(moment)melismaBusyProperties
(list)#'(melismaBusy beamMelismaBusy)
, only manual melismata and
manual beams are considered. Possible values include
melismaBusy
, slurMelismaBusy
, tieMelismaBusy
, and
beamMelismaBusy
.
metronomeMarkFormatter
(procedure)middleCClefPosition
(number)clefPosition
and clefGlyph
.
middleCOffset
(number)middleCClefPosition
This
is used for ottava brackets.
middleCPosition
(number)middleCClefPosition
and middleCOffset
.
midiInstrument
(string)midiMaximumVolume
(number)midiMinimumVolume
.
midiMinimumVolume
(number)minimumFret
(number)minimumFret
.
minimumPageTurnLength
(moment)minimumRepeatLengthForPageTurn
(moment)noteToFretFunction
(procedure)ottavation
(markup)output
(unknown)pedalSostenutoStrings
(list)pedalSustainStrings
.
pedalSostenutoStyle
(symbol)pedalSustainStyle
.
pedalSustainStrings
(list)(
up updown down)
,
where each of the three is the string to print when this is done with
the pedal.
pedalSustainStyle
(symbol)text
, bracket
or mixed
(both).
pedalUnaCordaStrings
(list)pedalSustainStrings
.
pedalUnaCordaStyle
(symbol)pedalSustainStyle
.
predefinedDiagramTable
(hash table)printKeyCancellation
(boolean)printOctaveNames
(boolean)NoteNames
context.
printPartCombineTexts
(boolean)proportionalNotationDuration
(moment)recordEventSequence
(procedure)Recording_group_engraver
is in this context, then upon
termination of the context, this function is called with current
context and a list of music objects. The list of contains entries with
start times, music objects and whether they are processed in this
context.
rehearsalMark
(integer)repeatCommands
(list)(list 'volta
x)
, where x is a string or
#f
. 'end-repeat
is also accepted as a command.
restNumberThreshold
(number)shapeNoteStyles
(vector)shortInstrumentName
(markup)instrument
.
shortVocalName
(markup)skipBars
(boolean){ r1 r1*3 R1*3 \set Score.skipBars= ##t r1*3 R1*3 }
skipTypesetting
(boolean)soloIIText
(markup)soloText
(markup)squashedPosition
(integer)staffLineLayoutFunction
(procedure)traditional
, or semitone
.
stanza
(markup)Lyrics
context.
stemLeftBeamCount
(integer)stemRightBeamCount
(integer)stemLeftBeamCount
.
stringNumberOrientations
(list)fingeringOrientations
.
stringOneTopmost
(boolean)stringTunings
(list)strokeFingerOrientations
(list)fingeringOrientations
.
subdivideBeams
(boolean)suggestAccidentals
(boolean)systemStartDelimiter
(symbol)SystemStartBrace
,
SystemStartBracket
or SystemStartBar
.
systemStartDelimiterHierarchy
(pair)tablatureFormat
(procedure)tempoHideNote
(boolean)tempoText
(markup)tempoUnitCount
(number)tempoUnitDuration
(duration)tempoWholesPerMinute
(moment)tieWaitForNote
(boolean)timeSignatureFraction
(pair of numbers)#'(4 . 4)
is a
4/4 time signature.
timing
(boolean)tonic
(pitch)trebleStaffProperties
(list)PianoStaff
. Used by
\autochange
.
tremoloFlags
(integer)tupletFullLength
(boolean)tupletFullLengthNote
(boolean)tupletSpannerDuration
(moment)\times
expression that gave rise to it. By
setting this property, you can make brackets last shorter.
{ \set tupletSpannerDuration = #(ly:make-moment 1 4) \times 2/3 { c8 c c c c c } }
useBassFigureExtenders
(boolean)verticallySpacedContexts
(list)vocalName
(markup)voltaSpannerDuration
(moment)\alternative
.
This can be used to shrink the length of brackets in the situation
where one alternative is very large.
whichBar
(string)Example:
\set Staff.whichBar = "|:"
This will create a start-repeat bar in this staff only. Valid values are described in bar-line-interface.
X-extent
(pair of numbers)X-offset
(number)Y-extent
(pair of numbers)Y-offset
(number)add-stem-support
(boolean)Stem
object is
included in this script's support.
after-line-breaking
(boolean)after-line-breaking
.
align-dir
(direction)-1
: left side,
0
: around center of width, 1
: right side.
allow-loose-spacing
(boolean)allow-span-bar
(boolean)alteration
(number)alteration-alist
(list)(
pitch
.
accidental)
pairs for key signature.
annotation
(string)arpeggio-direction
(direction)arrow-length
(number)arrow-width
(number)auto-knee-gap
(dimension, in staff space)average-spacing-wishes
(boolean)avoid-note-head
(boolean)avoid-slur
(symbol)around
, inside
, outside
. If unset,
scripts and slurs ignore each other. around
only moves the
script if there is a collision; outside
always moves the
script.
axes
(list)bar-size
(dimension, in staff space)base-shortest-duration
(moment)baseline-skip
(dimension, in staff space)beam-thickness
(dimension, in staff space)staff-space
units.
beam-width
(dimension, in staff space)beamed-stem-shorten
(list)beaming
(pair)0
is the central beam,
1
is the next beam toward the note, etc. This
information is used to determine how to connect the beaming patterns
from stem to stem inside a beam.
before-line-breaking
(boolean)between-cols
(pair)bound-details
(list)bound-padding
(number)bracket-flare
(pair of numbers)0.0
means
straight edges.
bracket-visibility
(boolean or symbol)if-no-beam
makes it print only if there is no beam associated with this tuplet
bracket.
break-align-anchor
(number)break-align-anchor-alignment
(number)ly:break-aligned-interface::calc-extent-aligned-anchor
for aligning
an anchor to a grob's extent
break-align-orders
(vector)For example, clefs are put after key signatures by setting
\override Score.BreakAlignment #'break-align-orders = #(make-vector 3 '(span-bar breathing-sign staff-bar key clef time-signature))
break-align-symbol
(symbol)break-align-symbols
(list)break-overshoot
(pair of numbers)break-visibility
(vector)#(
end-of-line unbroken begin-of-line)
.
#t
means visible, #f
means killed.
breakable
(boolean)c0-position
(integer)clip-edges
(boolean)collapse-height
(dimension, in staff space)color
(list)common-shortest-duration
(moment)concaveness
(number)connect-to-neighbor
(pair)control-points
(list)damping
(number)dash-fraction
(number)dash-period
. Should be between 0.0
(no line) and
1.0
(continuous line).
dash-period
(number)default-direction
(direction)digit-names
(unknown)direction
(direction)side-axis
is 0
(or
#X
), then this property determines whether the object is placed
#LEFT
, #CENTER
or #RIGHT
with respect to the
other object. Otherwise, it determines whether the object is placed
#UP
, #CENTER
or #DOWN
. Numerical values may also
be used: #UP
=1
, #DOWN
=-1
,
#LEFT
=-1
, #RIGHT
=1
, #CENTER
=0
.
dot-count
(integer)dot-placement-list
(list)(
description string-number
fret-number finger-number)
entries used to define fret diagrams.
duration-log
(integer)0
= whole note, 1
= half note, etc.
eccentricity
(number)edge-height
(pair)(
left-height .
right-height)
.
edge-text
(pair)(
left-text .
right-text)
.
expand-limit
(integer)extra-X-extent
(pair of numbers)extra-Y-extent
(pair of numbers)extra-dy
(number)extra-offset
(pair of numbers)staff-space
units of the staff's StaffSymbol
.
extra-spacing-height
(pair of numbers)(-inf.0 . +inf.0)
.
extra-spacing-width
(pair of numbers)(+inf.0 . -inf.0)
.
flag
(unknown)Stem
, which is passed to the function as the only argument.
The default ly:stem::calc-stencil function uses the flag-style
property to determine the correct glyph for the
flag. By providing your own function, you can create arbitrary flags.
flag-count
(number)flag-style
(symbol)Stem
. Valid options include '()
for
standard flags, 'mensural
and 'no-flag
, which switches off
the flag.
font-encoding
(symbol)fetaMusic
,
fetaNumber
, TeX-text
, TeX-math
,
fetaBraces
, fetaDynamic
.
font-family
(symbol)sans
,
roman
.
font-name
(string)font-family
, font-series
and font-shape
.
font-series
(symbol)medium
, bold
, bold-narrow
, etc.
font-shape
(symbol)upright
, italic
, caps
.
font-size
(number)0
is style-sheet's normal size,
-1
is smaller, +1
is bigger. Each step of 1 is
approximately 12% larger; 6 steps are exactly a factor 2 larger.
Fractional values are allowed.
force-hshift
(number)forced
(boolean)fraction
(pair of numbers)french-beaming
(boolean)fret-diagram-details
(list)property
. value
) pair.
The properties which can be included in fret-diagram-details
include the following:
barre-type
– Type of barre indication used.
Choices include curved
, straight
, and
none
. Default curved
.
dot-color
– Color of dots. Options include
black
and white
. Default black
.
dot-label-font-mag
– Magnification for font used to
label fret dots. Default value 1.
dot-radius
– Radius of dots, in terms of fret spaces.
Default value 0.425 for labeled dots, 0.25 for unlabeled dots.
finger-code
– Code for the type of fingering indication used.
Options include none
, in-dot
, and
below-string
. Default none
for markup fret diagrams,
below-string
for FretBoards
fret diagrams.
fret-count
– The number of frets. Default 4.
fret-label-font-mag
– The magnification of the font used to label
the lowest fret number. Default 0.5
fret-label-vertical-offset
– The vertical offset of the fret label
from the fret. Default -0.2
label-dir
– Side to which the fret label is attached.
-1
, #LEFT
, or #DOWN
for left or down;
1
, #RIGHT
, or #UP
for right or up.
Default #RIGHT
.
mute-string
– Character string to be used to indicate muted
string. Default "x".
number-type
– Type of numbers to use in fret label. Choices
include roman-lower
, roman-upper
, and arabic
. Default
roman-lower
.
open-string
– Character string to be used to indicate open
string. Default "o".
orientation
– Orientation of fret-diagram. Options include
normal
and landscape
. Default normal
.
string-count
– The number of strings. Default 6.
string-label-font-mag
– The magnification of the font used to label
fingerings at the string, rather than in the dot. Default value 0.6.
top-fret-thickness
– The thickness of the top fret line, as a multiple
of the standard thickness. Default value 3.
xo-font-magnification
– Magnification used for mute and
open string indicators. Default value 0.5.
xo-padding
– Padding for open and mute indicators from top fret.
Default value 0.25.
full-length-padding
(number)full-length-to-extent
(boolean)full-size-change
(boolean)gap
(dimension, in staff space)gap-count
(integer)glyph
(string)glyph-name-alist
(list)grow-direction
(direction)hair-thickness
(number)harp-pedal-details
(list)property
. value
) pair.
The properties which can be included in harp-pedal-details
include the following:
box-offset
– Vertical shift of the center of flat / sharp pedal
boxes above / below the horizontal line. Default value 0.8.
box-width
– Width of each pedal box. Default value 0.4.
box-height
– Height of each pedal box. Default value 1.0.
space-before-divider
– Space between boxes before the first divider
(so that the diagram can be made symmetric). Default value 0.8.
space-after-divider
– Space between boxes after the first divider.
Default value 0.8.
circle-thickness
– Thickness (in unit of the line-thickness) of the
ellipse around circled pedals. Default value 0.5.
circle-x-padding
– Padding in X direction of the ellipse around
circled pedals. Default value 0.15.
circle-y-padding
– Padding in Y direction of the ellipse around
circled pedals. Default value 0.2.
head-direction
(direction)height
(dimension, in staff space)staff-space
units.
height-limit
(dimension, in staff space)horizontal-shift
(integer)NoteColumn
s for horizontal shifting. This is used by
note-collision-interface.
horizontal-skylines
(unknown)ignore-collision
(boolean)NoteColumn
.
implicit
(boolean)inspect-index
(integer)inspect-quants
(pair of numbers)keep-fixed-while-stretching
(boolean)keep-inside-line
(boolean)kern
(dimension, in staff space)knee
(boolean)knee-spacing-correction
(number)0
for no
correction and 1
for full correction.
labels
(list)layer
(integer)ledger-line-thickness
(pair of numbers)left-bound-info
(list)left-padding
(dimension, in staff space)length
(dimension, in staff space)length-fraction
(number)line-break-penalty
(number)line-break-permission
(symbol)force
or
allow
.
line-break-system-details
(list)line-count
(integer)line-positions
(list)line-thickness
(number)long-text
(markup)max-beam-connect
(integer)max-stretch
(number)VerticalAxisGroup
can be vertically stretched (for example, in
order to better fill a page).
measure-count
(integer)measure-length
(moment)merge-differently-dotted
(boolean)merge-differently-dotted
only applies to opposing stem
directions (i.e., voice 1 & 2).
merge-differently-headed
(boolean)merge-differently-headed
only applies to opposing stem
directions (i.e., voice 1 & 2).
minimum-X-extent
(pair of numbers)staff-space
units.
minimum-Y-extent
(pair of numbers)staff-space
units.
minimum-distance
(dimension, in staff space)minimum-length
(dimension, in staff space)springs-and-rods
property. If
added to a Tie
, this sets the minimum distance between
noteheads.
minimum-length-fraction
(number)minimum-space
(dimension, in staff space)neutral-direction
(direction)neutral-position
(number)next
(layout object)no-alignment
(boolean)VerticalAlignment
; rather, place it using its own Y-offset
callback.
no-ledgers
(boolean)no-stem-extend
(boolean)non-default
(boolean)non-musical
(boolean)NonMusicalPaperColumn
.
note-names
(vector)outside-staff-horizontal-padding
(number)outside-staff-padding
(number)outside-staff-priority
.
outside-staff-priority
(number)outside-staff-priority
is closer to the staff.
packed-spacing
(boolean)padding
(dimension, in staff space)page-break-penalty
(number)page-break-permission
(symbol)force
or
allow
.
page-turn-penalty
(number)page-turn-permission
(symbol)force
or
allow
.
parenthesized
(boolean)positions
(pair of numbers)(
left .
right)
, where both left and
right are in staff-space
units of the current staff.
For slurs, this value selects which slur candidate to use; if
extreme positions are requested, the closest one is taken.
prefer-dotted-right
(boolean)ratio
(number)height-limit
.
remove-empty
(boolean)remove-first
(boolean)restore-first
(boolean)rhythmic-location
(rhythmic location)right-bound-info
(list)right-padding
(dimension, in staff space)rotation
(list)#'(45 0 0)
rotates
by 45 degrees around the center of this object.
same-direction-correction
(number)script-priority
(number)self-alignment-X
(number)-1
means left aligned, 0
centered, and
1
right-aligned in X direction. Other numerical
values may also be specified.
self-alignment-Y
(number)self-alignment-X
but for
the Y axis.
shorten-pair
(pair of numbers)shortest-duration-space
(dimension, in staff space)spacing-increment
as unit. See also
spacing-spanner-interface.
shortest-playing-duration
(moment)shortest-starter-duration
(moment)side-axis
(number)#X
(or
equivalently 0
), the object is placed horizontally next
to the other object. If the value is #Y
or 1
, it
is placed vertically.
side-relative-direction
(direction)direction-source
with this to get the direction of this
object.
size
(number)slope
(number)slur-padding
(number)space-alist
(list)(
break-align-symbol type
.
distance)
, where type can be the symbols
minimum-space
or extra-space
.
space-to-barline
(boolean)spacing-increment
(number)springs-and-rods
(boolean)stacking-dir
(direction)staff-padding
(dimension, in staff space)staff-position
(number)staff-space
(dimension, in staff space)staff-space
.
stem-attachment
(pair of numbers)(
x .
y)
pair
where the stem attaches to the notehead.
stem-end-position
(number)stem-spacing-correction
(number)stemlet-length
(number)stencil
(unknown)stencils
(list)strict-grace-spacing
(boolean)strict-note-spacing
(boolean)stroke-style
(string)"grace"
to turn stroke
through flag on.
style
(symbol)stencil
callback reading
this property.
text
(markup)text-direction
(direction)RIGHT
is for roman text. Arabic or Hebrew
should use LEFT
.
thick-thickness
(number)line-thickness
.
thickness
(number)line-thickness
.
thin-kern
(number)threshold
(pair of numbers)(
min .
max)
, where
min and max are dimensions in staff space.
tie-configuration
(list)(
position .
dir)
pairs, indicating the desired tie configuration, where
position is the offset from the center of the staff in staff
space and dir indicates the direction of the tie
(1
=>up, -1
=>down, 0
=>center). A non-pair entry
in the list causes the corresponding tie to be formatted
automatically.
to-barline
(boolean)transparent
(boolean)uniform-stretching
(boolean)used
(boolean)vertical-skylines
(unknown)when
(moment)width
(dimension, in staff space)word-space
(dimension, in staff space)zigzag-length
(dimension, in staff space)zigzag-width
. A value of 1
gives 60-degree zigzags.
zigzag-width
(dimension, in staff space)acciaccatura
- music (music)addChordShape
- key-symbol (symbol) shape-string (string)addInstrumentDefinition
- name (string) lst (list)addQuote
- name (string) music (music)afterGrace
- main (music) grace (music)allowPageTurn
applyContext
- proc (procedure)applyMusic
- func (procedure) music (music)applyOutput
- ctx (symbol) proc (procedure)appoggiatura
- music (music)assertBeamQuant
- l (pair) r (pair)assertBeamSlope
- comp (procedure)autochange
- music (music)balloonGrobText
- grob-name (symbol) offset (pair of numbers) text (markup)balloonText
- offset (pair of numbers) text (markup)bar
- type (string)barNumberCheck
- n (integer)bendAfter
- delta (unknown)breathe
clef
- type (string)cueDuring
- what (string) dir (direction) main-music (music)displayLilyMusic
- music (music)displayMusic
- music (music)endSpanners
- music (music)featherDurations
- factor (moment) argument (music)grace
- music (music)includePageLayoutFile
instrumentSwitch
- name (string)keepWithTag
- tag (symbol) music (music)killCues
- music (music)label
- label (symbol)makeClusters
- arg (music)musicMap
- proc (procedure) mus (music)noPageBreak
noPageTurn
octaveCheck
- pitch-note (music)oldaddlyrics
- music (music) lyrics (music)ottava
- octave (number)overrideProperty
- name (string) property (symbol) value (any type)pageBreak
pageTurn
parallelMusic
- voice-ids (list) music (music)parenthesize
- arg (music)partcombine
- part1 (music) part2 (music)pitchedTrill
- main-note (music) secondary-note (music)pointAndClickOff
pointAndClickOn
quoteDuring
- what (string) main-music (music)removeWithTag
- tag (symbol) music (music)resetRelativeOctave
- reference-note (music)rightHandFinger
- finger (number or string)scaleDurations
- fraction (pair of numbers) music (music)scoreTweak
- name (string)shiftDurations
- dur (integer) dots (integer) arg (music)spacingTweaks
- parameters (list)storePredefinedDiagram
- chord (music) tuning (list) terse-definition (string)tag
- tag (symbol) arg (music)tocItem
- text (markup)tocItemMarkup
paper
variable markup
transposedCueDuring
- what (string) dir (direction) pitch-note (music) main-music (music)transposition
- pitch-note (music)tweak
- sym (symbol) val (any type) arg (music)unfoldRepeats
- music (music)withMusicProperty
- sym (symbol) val (any type) music (music)Add the listener list to the dispatcher disp. Whenever disp hears an event of class cl, it is forwarded to list.
Return value if key in alist, else
default-value
(or#f
if not specified).
Print book. output is passed to the backend unchanged. For example, it may be a string (for file based outputs) or a socket (for network based output).
Print book. output is passed to the backend unchanged. For example, it may be a string (for file based outputs) or a socket (for network based output).
Make a bracket in direction a. The extent of the bracket is given by iv. The wings protrude by an amount of p, which may be negative. The thickness is given by t.
Return value for key from a list of alists achain. If no entry is found, return dfault or
#f
if no dfault is specified.
Plug a GUILE 1.6 and 1.7 memory leak by breaking a weak reference pointer cycle explicitly.
Return a
stream-distributor
that distributes all events from context and all its subcontexts.
Find a parent of context that has name or alias name. Return
#f
if not found.
Return the definition of name (a symbol) within context as an alist.
Return the ID string of context, i.e., for
\context Voice = one ...
return the stringone
.
Return the name of context, i.e., for
\context Voice = one ...
return the symbolVoice
.
Return the context above context where name is defined.
Do a single
\override
or\revert
operation in context. The grob definition grob is extended with eltprop (if val is specified) or reverted (if unspecified).
Set value of property name in context context to val.
Return d as a number. Used to distinguish length variables from normal numbers.
A type predicate. The direction
s
is-1
,0
or1
, where-1
represents left or down and1
represents right or up.
A Scheme callable function to issue the error str. The error is formatted with
format
and rest.
Evaluate a simple closure with the given delayed argument. If scm-start and scm-end are defined, evaluate it purely with those start and end points.
Get the property sym of stream event mus. If sym is undefined, return
'()
.
Checks the need for an accidental and a ‘restore’ accidental against a key signature. The laziness is the number of bars for which reminder accidentals are used (ie. if laziness is zero, we only cancel accidentals in the same bar; if laziness is three, we cancel accidentals up to three bars after they first appear. octaveness is either
'same-octave
or'any-octave
and it specifies whether accidentals should be canceled in different octaves.
Given the font metric font, return the design size, relative to the current output-scale.
Return a stencil from font for the glyph named name. If the glyph is not available, return an empty stencil.
Return the character code for glyph name in font.
Given the font metric font, return the magnification, relative to the current output-scale.
Given the font metric font of an OpenType font, return the names of the subfonts within font.
Given a global context in its final state, process it and return the
Music_output
object in its final state.
Get a hash table with all LilyPond Scheme extension functions.
Return a list of all translator objects that may be instantiated.
Return a list of all event classes that some translator listens to.
Get an alist chain for grob grob, with global as the global default. If unspecified,
font-defaults
from the layout block is taken.
Find the common refpoint of grob and other for axis.
Find the common refpoint of grob and others (a grob-array) for axis.
Get the extent in axis direction of grob relative to the grob refp.
Return the value of a pointer in grob g of property sym. It returns
'()
(end-of-list) if sym is undefined in g.
Get the parent of grob. axis is 0 for the X-axis, 1 for the Y-axis.
Return the value of a value in grob g of property sym. It returns
'()
(end-of-list) or deflt (if specified) if sym is undefined in g.
Get the coordinate in axis direction of grob relative to the grob refp.
Get the extent in axis direction of grob relative to the grob refp, or
(0,0)
if empty.
Compare two grobs by script priority. For internal use.
Read the file name, and return its contents in a string. The file is looked up using the search path.
Return input location in sip as
(file-name first-line first-column last-line last-column)
.
Return input location in sip as
(file-name line char column)
.
Print msg as a GNU compliant error message, pointing to the location in sip. msg is interpreted similar to
format
's argument, using rest.
Interpret the music expression mus in the global context ctx. The context is returned in its final state.
Parse expr, feed bits to func with first arg arg1 having offset offset.
The break status direction of item it.
-1
means end of line,0
unbroken, and1
beginning of line.
Return a list of
(KEY . CODE)
pairs, signifying the LilyPond reserved words list.
Load dimensions from TeX in a
(KEY . (W H D))
format alist.
Make a
\book
of paper and header (which may be#f
as well) containing\scores
.
length is the negative logarithm (base 2) of the duration: 1 is a half note, 2 is a quarter note, 3 is an eighth note, etc. The number of dots after the note is given by the optional argument dotcount.
The duration factor is optionally given by num and den.
A duration is a musical duration, i.e., a length of time described by a power of two (whole, half, quarter, etc.) and a number of augmentation dots.
Set up a global interpretation context, using the output block output_def. The context is returned.
Create a translator group and connect it to the global context global. The translator group is returned.
Create a listener. Any time the listener hears an object, it will call callback with that object.
callback should take exactly one argument.
Create the rational number with main timing n/d, and optional grace timing gn/gd.
A moment is a point in musical time. It consists of a pair of rationals (m, g), where m is the timing for the main notes, and g the timing for grace notes. In absence of grace notes, g is zero.
Make a C++
Music
object and initialize it with props.This function is for internal use and is only called by
make-music
, which is the preferred interface for creating music objects.
Make a function to process music, to be used for the parser.
func
is the function, andsignature
describes its arguments.signature
is a list containing eitherly:music?
predicates or other type predicates.
Return page marker with page breaking and turning permissions.
Make a
PangoFontDescription
string for the property alist chain at size size.
Create an outputter that evaluates within
output-
format, writing to port.
octave is specified by an integer, zero for the octave containing middle C. note is a number from 0 to 6, with 0 corresponding to pitch C and 6 corresponding to pitch B. alter is a rational number of whole tones for alteration.
Create a scale. The argument is a vector of rational numbers, each of which represents the number of tones of a pitch above the tonic.
Make a simple closure. expr should be form of
(
func a1 A2...)
, and will be invoked as(
func delayed-arg a1 a2...)
.
Stencils are device independent output expressions. They carry two pieces of information:
- A specification of how to print this object. This specification is processed by the output backends, for example scm/output-ps.scm.
- The vertical and horizontal extents of the object, given as pairs. If an extent is unspecified (or if you use
(1000 . -1000)
as its value), it is taken to be empty.
Create a stream event of class cl with the given mutable property list.
A Scheme callable function to issue the message str. The message is formatted with
format
and rest.
Break (pages and lines) the
Paper_book
object pb without looking for optimal spacing: stack as many lines on a page before moving to the next one.
Look up sym in the list modules, returning the first occurence. If not found, return def or
#f
if def isn't specified.
Get the length of music expression mus and return it as a
Moment
object.
Return an alist containing the mutable properties of mus. The immutable properties are not available, since they are constant and initialized by the
make-music
function.
Get the property sym of music expression mus. If sym is undefined, return
'()
.
Get attachment in font-metric for attaching a stem to notehead glyph-name.
Optimally break (pages and lines) the
Paper_book
object pb to minimize badness in bother vertical and horizontal spacing.
Convert the contents of an OTF file to a CFF file, returning it as a string.
Given the font metric font of an OpenType font, return the information about named glyph glyph (a string).
Extract a table tag from font. Return empty string for non-existent tag.
Look up sym in the pap output definition (e.g.,
\paper
). Return the value or def (which defaults to'()
) if undefined.
Set an output definition def variable sym to val.
Optimally break (pages and lines) the
Paper_book
object pb such that page turns only happen in specified places, returning its pages.
Return a font metric satisfying the font-qualifiers in the alist chain chain. (An alist chain is a list of alists, containing grob properties.)
Return vector of
paper_system
objects from paper-score.
Measure the minimum distance between these two paper-systems, using their stored skylines if possible and falling back to their extents otherwise.
Look up symbol in parser-smob's module. Return
'()
if not defined.
Parse the string ly-code with parser-smob. Upon failure, throw
ly-file-failed
key.
Replace current note names in parser. names is an alist of symbols. This only has effect if the current mode is notes.
Return pitch delta such that pitch transposed by delta equals root.
Transpose p by the amount delta, where delta is relative to middle C.
Return whether pos is on a line of the staff associated with the the grob sg (even on an extender line).
A Scheme callable function to issue the internal warning str. The message is formatted with
format
and rest.
A Scheme callable function to print progress str. The message is formatted with
format
and rest.
Return hash table with a property access corresponding to sym. Choices are
prob
,grob
, andcontext
.
Determine the extent of elements relative to common in the axis direction.
Make a
Stencil
object that prints a black box of dimensions xext, yext and roundness blot.
Make a
Stencil
object that prints a black polygon with corners at the points defined by points (list of coordinate pairs) and roundness blot.
Process mus according to output-def. An interpretation context is set up, and mus is interpreted with it. The context is returned in its final state.
Optionally, this routine takes an object-key to to uniquely identify the score block containing it.
Run score through layout (an output definition) scaled to correct output-scale already, returning a list of layout-lines. This function takes an optional
Object_key
argument.
Specify a procedure that will be called every time LilyPond modifies a grob property. The callback will receive as arguments the grob that is being modified, the name of the C++ file in which the modification was requested, the line number in the C++ file in which the modification was requested, the name of the function in which the modification was requested, the property to be changed, and the new value for the property.
Set the
middleCPosition
variable in context based on the variablesmiddleCClefPosition
and middleCOffset.
Specify a procedure that will be called whenever lilypond calculates a callback function and caches the result. The callback will receive as arguments the grob whose property it is, the name of the property, the name of the callback that calculated the property, and the new (cached) value of the property.
Solve a spring and rod problem for count objects, that are connected by count-1 springs, and an arbitrary number of rods. count is implicitly given by springs and rods. The springs argument has the format
(ideal, inverse_hook)
and rods is of the form(idx1, idx2, distance)
.length is a number, ragged a boolean.
The function returns a list containing the force (positive for stretching, negative for compressing and
#f
for non-satisfied constraints) followed by spring-count+1 positions of the objects.
Get one of the bounds of slur. dir is
-1
for left, and1
for right.
Return the environment (a list of strings) that was in effect at program start.
Align stil using its own extents. dir is a number.
-1
and1
are left and right, respectively. Other values are interpolated (so0
means the center).
Construct a stencil by putting second next to first. axis can be 0 (x-axis) or 1 (y-axis). direction can be -1 (left or down) or 1 (right or up). The stencils are juxtaposed with padding as extra space. If this puts the reference points closer than minimum, they are moved by the latter amount. first and second may also be
'()
or#f
.
Return a pair of numbers signifying the extent of stil in axis direction (
0
or1
for x and y axis, respectively).
Return a stencil stil rotated angle degrees around point (x, y).
Return a stil, but translated by offset (a pair of numbers).
Return a copy of stil but translated by amount in axis direction.
Stretch the system vertically by the given amount. This must be called before the system is drawn (for example with
ly:system-print
).
Given the font metric in font and the string text, compute the extents of that text in that font. The return value is a pair of number-pairs.
Convert a text markup into a stencil. Takes three arguments, layout, props, and markup.
layout is a
\layout
block; it may be obtained from a grob withly:grob-layout
. props is a alist chain, ie. a list of alists. This is typically obtained with(ly:grob-alist-chain (ly:layout-lookup layout 'text-font-defaults))
. markup is the markup text to be processed.
Return the type name of the translator object trans. The name is a symbol.
Convert the contents of a TTF file to Type42 PFA, returning it as a string.
A Scheme callable function to issue the warning
str
. The message is formatted withformat
andrest
.
Syntax | Description | Example
|
1 2 8 16
| durations |
|
c4. c4..
| augmentation dots |
|
c d e f g a b
| scale |
|
fis bes
| alteration |
|
\clef treble \clef bass
| clefs |
|
\time 3/4 \time 4/4
| time signature |
|
r4 r8
| rest |
|
d ~ d
| tie |
|
\key es \major
| key signature |
|
note'
| raise octave |
|
note,
| lower octave |
|
c( d e)
| slur |
|
c\( c( d) e\)
| phrasing slur |
|
a8[ b]
| beam |
|
<< \new Staff ... >>
| more staves |
|
c-> c-.
| articulations |
|
c2\mf c\sfz
| dynamics |
|
a\< a a\!
| crescendo |
|
a\> a a\!
| decrescendo |
|
< >
| chord |
|
\partial 8
| upstep |
|
\times 2/3 {f g a}
| triplets |
|
\grace
| grace notes |
|
\lyricmode { twinkle }
| entering lyrics |
twinkle
|
\new Lyrics
| printing lyrics |
|
twin -- kle
| lyric hyphen |
|
\chordmode { c:dim f:maj7 }
| chords |
|
\context ChordNames
| printing chord names |
|
<<{e f} \\ {c d}>>
| polyphony |
|
s4 s8 s16
| spacer rests |
|
Copyright © 2000 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
The purpose of this License is to make a manual, textbook, or other written document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.
This License is a kind of ‘copyleft’, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The ‘Document’, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ‘you’.
A ‘Modified Version’ of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
A ‘Secondary Section’ is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them.
The ‘Invariant Sections’ are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License.
The ‘Cover Texts’ are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License.
A ‘Transparent’ copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not ‘Transparent’ is called ‘Opaque’.
Examples of suitable formats for Transparent copies include plain ascii without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification. Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only.
The ‘Title Page’ means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ‘Title Page’ means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display copies.
If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document.
You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version:
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles.
You may add a section entitled ‘Endorsements’, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version.
You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice.
The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections entitled ‘History’ in the various original documents, forming one section entitled ‘History’; likewise combine any sections entitled ‘Acknowledgments’, and any sections entitled ‘Dedications’. You must delete all sections entitled ‘Endorsements.’
You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document.
A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an ‘aggregate’, and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate.
Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail.
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ‘or any later version’ applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.
To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page:
Copyright (C) year your name. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being list their titles, with the Front-Cover Texts being list, and with the Back-Cover Texts being list. A copy of the license is included in the section entitled ‘GNU Free Documentation License’.
If you have no Invariant Sections, write ‘with no Invariant Sections’ instead of saying which ones are invariant. If you have no Front-Cover Texts, write ‘no Front-Cover Texts’ instead of ‘Front-Cover Texts being list’; likewise for Back-Cover Texts.
If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software.
This index lists all the LilyPond commands and keywords with links to those sections of the manual which describe or discuss their use. Each link is in two parts. The first part points to the exact location in the manual where the command or keyword appears; the second part points to the start of the section of the manual in which the command or keyword appears.
!
: Accidentals'
: Absolute octave entry(begin * * * *)
: Setting automatic beam behavior(end * * * *)
: Setting automatic beam behavior,
: Absolute octave entry.
: Durations/
: Extended and altered chords/+
: Extended and altered chords:
: Tremolo repeats<
: Chorded notes<...>
: Chorded notes=
: Octave checks>
: Chorded notes?
: Accidentals[
: Manual beams\!
: Dynamics\(
: Phrasing slurs\)
: Phrasing slurs\<
: Dynamics\>
: Dynamics\abs-fontsize
: Font\accepts
: Defining new contexts\addlyrics
: Aligning lyrics to a melody\aeolian
: Key signature\afterGrace
: Grace notes\aikenHeads
: Shape note heads\allowPageTurn
: Optimal page turning\alternative
: Long repeats\AncientRemoveEmptyStaffContext
: Hiding staves\applyContext
: Context evaluation\applyOutput
: Running a function on all layout objects\arpeggio
: Arpeggio\arpeggioArrowDown
: Arpeggio\arpeggioArrowUp
: Arpeggio\arpeggioBracket
: Arpeggio\arpeggioNormal
: Arpeggio\arpeggioParenthesis
: Arpeggio\arrow-head
: Graphic\arrow-head
: Graphic notation inside markup\ascendens
: Gregorian square neumes ligatures\auctum
: Gregorian square neumes ligatures\augmentum
: Gregorian square neumes ligatures\autoBeamOff
: Setting automatic beam behavior\autoBeamOn
: Setting automatic beam behavior\autochange
: Changing staff automatically\backslashed-digit
: Other\balloonGrobText
: Balloon help\balloonLengthOff
: Balloon help\balloonLengthOn
: Balloon help\balloonText
: Balloon help\bar
: Bar lines\beam
: Graphic\bendAfter
: Falls and doits\bigger
: Font\bigger
: Selecting font and font size\bold
: Font\bold
: Selecting font and font size\book
: File structure\book
: Multiple scores in a book\box
: Font\box
: Graphic notation inside markup\bracket
: Graphic\bracket
: Graphic notation inside markup\bracket
: New dynamic marks\break
: Line breaking\breathe
: Breath marks\breve
: Rests\breve
: Durations\cadenzaOff
: Unmetered music\cadenzaOn
: Unmetered music\caesura
: Divisiones\caps
: Font\cavum
: Gregorian square neumes ligatures\center-align
: Align\center-align
: Text alignment\center-column
: Align\center-column
: Text alignment\change
: Changing staff manually\char
: Other\chordmode
: Transpose\chordmode
: Relative octave entry\circle
: Graphic\circle
: Graphic notation inside markup\clef
: Clef\column
: Align\column
: Text alignment\column-lines
: Text markup list commands\combine
: Align\combine
: Graphic notation inside markup\compressFullBarRests
: Full measure rests\concat
: Align\context
: Creating contexts\cr
: Dynamics\crescHairpin
: Dynamics\crescTextCresc
: Dynamics\decr
: Dynamics\defaultTimeSignature
: Time signature\deminutum
: Gregorian square neumes ligatures\denies
: Defining new contexts\descendens
: Gregorian square neumes ligatures\dimHairpin
: Dynamics\dimTextDecr
: Dynamics\dimTextDecresc
: Dynamics\dimTextDim
: Dynamics\dir-column
: Align\displayLilyMusic
: Music properties\displayLilyMusic
: Displaying LilyPond notation\displayMusic
: Displaying music expressions\divisioMaior
: Divisiones\divisioMaxima
: Divisiones\divisioMinima
: Divisiones\dorian
: Key signature\dotsDown
: Durations\dotsNeutral
: Durations\dotsUp
: Durations\doubleflat
: Music\doublesharp
: Music\draw-circle
: Graphic\draw-circle
: Graphic notation inside markup\draw-line
: Graphic\draw-line
: Graphic notation inside markup\dynamic
: Font\dynamic
: New dynamic marks\dynamicDown
: Dynamics\dynamicNeutral
: Dynamics\dynamicUp
: Dynamics\easyHeadsOff
: Easy notation note heads\easyHeadsOn
: Easy notation note heads\epsfile
: Graphic\epsfile
: Graphic notation inside markup\espressivo
: Dynamics\expandFullBarRests
: Full measure rests\f
: Dynamics\featherDurations
: Feathered beams\ff
: Dynamics\fff
: Dynamics\ffff
: Dynamics\fill-line
: Align\fill-line
: Text alignment\filled-box
: Graphic\filled-box
: Graphic notation inside markup\finalis
: Divisiones\finger
: Font\finger
: Fingering instructions\flat
: Music\flexa
: Gregorian square neumes ligatures\fontCaps
: Font\fontsize
: Font\fontsize
: Selecting font and font size\fp
: Dynamics\fraction
: Other\frenchChords
: Customizing chord names\fret-diagram
: Instrument Specific Markup\fret-diagram-terse
: Instrument Specific Markup\fret-diagram-verbose
: Instrument Specific Markup\fromproperty
: Other\general-align
: Align\general-align
: Text alignment\germanChords
: Customizing chord names\glissando
: Glissando\grace
: Grace notes\halign
: Align\halign
: Text alignment\harp-pedal
: Instrument Specific Markup\hbracket
: Graphic\hbracket
: Graphic notation inside markup\hcenter-in
: Align\header
: File structure\hideKeySignature
: Bagpipe definitions\hideNotes
: Hidden notes\hideStaffSwitch
: Staff-change lines\hspace
: Align\huge
: Font\huge
: Selecting font and font size\huge
: Selecting notation font size\improvisationOff
: Improvisation\improvisationOn
: Improvisation\inclinatum
: Gregorian square neumes ligatures\include
: Including LilyPond files\ionian
: Key signature\italianChords
: Customizing chord names\italic
: Font\italic
: Selecting font and font size\justified-lines
: Text markup list commands\justify
: Align\justify
: Text alignment\justify-field
: Align\justify-string
: Align\keepWithTag
: Using tags\key
: Shape note heads\key
: Key signature\label
: Reference to page numbers\laissezVibrer
: Ties\large
: Font\large
: Selecting font and font size\large
: Selecting notation font size\larger
: Font\larger
: Selecting font and font size\layout
: Score layout\layout
: File structure\left-align
: Align\left-align
: Text alignment\left-column
: Align\line
: Align\linea
: Gregorian square neumes ligatures\locrian
: Key signature\longa
: Rests\longa
: Durations\lookup
: Other\lower
: Align\lower
: Text alignment\lydian
: Key signature\lyricmode
: Aligning lyrics to a melody\lyricmode
: Entering lyrics\lyricsto
: Aligning lyrics to a melody\magnify
: Font\magnify
: Selecting font and font size\major
: Key signature\makeClusters
: Clusters\mark
: Text marks\mark
: Rehearsal marks\markalphabet
: Other\markletter
: Other\markup
: Text markup introduction\markup
: Separate text\markuplines
: Multi-page markup\markuplines
: Separate text\maxima
: Rests\maxima
: Durations\medium
: Font\melisma
: Multiple notes to one syllable\melismaEnd
: Multiple notes to one syllable\mergeDifferentlyDottedOff
: Collision resolution\mergeDifferentlyDottedOn
: Collision resolution\mergeDifferentlyHeadedOff
: Collision resolution\mergeDifferentlyHeadedOn
: Collision resolution\mf
: Dynamics\midi
: File structure\minor
: Key signature\mixolydian
: Key signature\mp
: Dynamics\musicglyph
: Music\natural
: Music\new
: Creating contexts\noBeam
: Manual beams\noBreak
: Line breaking\noPageBreak
: Page breaking\noPageTurn
: Optimal page turning\normal-size-sub
: Font\normal-size-super
: Font\normal-text
: Font\normalsize
: Font\normalsize
: Selecting font and font size\normalsize
: Selecting notation font size\note
: Music\note-by-number
: Music\null
: Other\number
: Font\numericTimeSignature
: Time signature\octaveCheck
: Octave checks\on-the-fly
: Other\oneVoice
: Single-staff polyphony\oriscus
: Gregorian square neumes ligatures\override
: Other\override
: The override command\override-lines
: Text markup list commands\p
: Dynamics\pad-around
: Align\pad-around
: Graphic notation inside markup\pad-markup
: Align\pad-markup
: Graphic notation inside markup\pad-to-box
: Align\pad-to-box
: Graphic notation inside markup\pad-x
: Align\pad-x
: Graphic notation inside markup\page-ref
: Other\page-ref
: Reference to page numbers\pageBreak
: Page breaking\pageTurn
: Optimal page turning\paper
: Page formatting\paper
: File structure\parallelMusic
: Writing music in parallel\parenthesize
: Parentheses\partcombine
: Automatic part combining\partial
: Normal repeats\partial
: Long repeats\partial
: Upbeats\pes
: Gregorian square neumes ligatures\phrasingSlurDown
: Phrasing slurs\phrasingSlurNeutral
: Phrasing slurs\phrasingSlurUp
: Phrasing slurs\phrygian
: Key signature\pitchedTrill
: Trills\postscript
: Graphic\postscript
: Graphic notation inside markup\pp
: Dynamics\ppp
: Dynamics\pppp
: Dynamics\ppppp
: Dynamics\property in \lyricmode
: Entering lyrics\put-adjacent
: Align\quilisma
: Gregorian square neumes ligatures\raise
: Align\raise
: Text alignment\relative
: Changing staff automatically\relative
: Transpose\relative
: Relative octave entry\RemoveEmptyRhythmicStaffContext
: Hiding staves\RemoveEmptyStaffContext
: Hiding staves\removeWithTag
: Using tags\repeat
: Long repeats\repeat percent
: Percent repeats\repeat tremolo
: Tremolo repeats\repeatTie
: Normal repeats\repeatTie
: Ties\rest
: Rests\rfz
: Dynamics\right-align
: Align\right-align
: Text alignment\right-column
: Align\roman
: Font\rotate
: Align\rounded-box
: Graphic\rounded-box
: Graphic notation inside markup\sacredHarpHeads
: Shape note heads\sans
: Font\scaleDurations
: Scaling durations\score
: Music\score
: File structure\score
: Structure of a score\semiflat
: Music\semiGermanChords
: Customizing chord names\semisharp
: Music\sesquiflat
: Music\sesquisharp
: Music\set
: The set command\sf
: Dynamics\sff
: Dynamics\sfz
: Dynamics\sharp
: Music\shiftOff
: Collision resolution\shiftOn
: Collision resolution\shiftOnn
: Collision resolution\shiftOnnn
: Collision resolution\showKeySignature
: Bagpipe definitions\showStaffSwitch
: Staff-change lines\simple
: Font\skip
: Invisible rests\slashed-digit
: Other\slurDashed
: Slurs\slurDotted
: Slurs\slurDown
: Slurs\slurNeutral
: Slurs\slurSolid
: Slurs\slurUp
: Slurs\small
: Font\small
: Selecting font and font size\small
: Selecting notation font size\smallCaps
: Font\smaller
: Font\smaller
: Selecting font and font size\sostenutoOff
: Piano pedals\sostenutoOn
: Piano pedals\sp
: Dynamics\spp
: Dynamics\startGroup
: Analysis brackets\startStaff
: Staff symbol\startTrillSpan
: Trills\stemDown
: Stems\stemNeutral
: Stems\stemUp
: Stems\stencil
: Other\stopGroup
: Analysis brackets\stopStaff
: Staff symbol\stopTrillSpan
: Trills\stropha
: Gregorian square neumes ligatures\strut
: Other\sub
: Font\sub
: Selecting font and font size\super
: Font\super
: Selecting font and font size\sustainOff
: Piano pedals\sustainOn
: Piano pedals\table-of-contents
: Table of contents\tag
: Using tags\taor
: Bagpipe definitions\teeny
: Font\teeny
: Selecting font and font size\teeny
: Selecting notation font size\tempo
: Metronome marks\text
: Font\textLengthOff
: Text scripts\textLengthOn
: Text scripts\thumb
: Fingering instructions\tied-lyric
: Music\tieDashed
: Ties\tieDotted
: Ties\tieDown
: Ties\tieNeutral
: Ties\tieSolid
: Ties\tieUp
: Ties\time
: Time signature\times
: Tuplets\tiny
: Font\tiny
: Selecting font and font size\tiny
: Selecting notation font size\tocItem
: Table of contents\translate
: Align\translate
: Text alignment\translate-scaled
: Align\translate-scaled
: Text alignment\transparent
: Other\transpose
: Transpose\transpose
: Relative octave entry\transposition
: Instrument transpositions\treCorde
: Piano pedals\triangle
: Graphic\triangle
: Graphic notation inside markup\trill
: Trills\tupletDown
: Tuplets\tupletNeutral
: Tuplets\tupletUp
: Tuplets\tweak
: The tweak command\typewriter
: Font\unaCorda
: Piano pedals\underline
: Font\underline
: Selecting font and font size\unfoldRepeats
: Repeats in MIDI\unHideNotes
: Hidden notes\unset
: The set command\upright
: Font\vcenter
: Align\verbatim-file
: Other\virga
: Gregorian square neumes ligatures\virgula
: Divisiones\voiceFourStyle
: Voice styles\voiceNeutralStyle
: Voice styles\voiceOne
: Single-staff polyphony\voiceOne ... \voiceFour
: Single-staff polyphony\voiceOneStyle
: Voice styles\voiceThreeStyle
: Voice styles\voiceTwoStyle
: Voice styles\whiteout
: Other\with
: Modifying context plug-ins\with-color
: Other\with-color
: Coloring objects\with-dimensions
: Other\with-url
: Graphic\wordwrap
: Align\wordwrap
: Text alignment\wordwrap-field
: Align\wordwrap-internal
: Text markup list commands\wordwrap-lines
: Text markup list commands\wordwrap-string
: Align\wordwrap-string-internal
: Text markup list commands]
: Manual beams^
: Extended and altered chords_
: Multiple syllables to one note_
: Entering lyricsafter-title-space
: Page formattingannotate-spacing
: Displaying spacingarpeggio
: ArpeggioarpeggioArrowDown
: ArpeggioarpeggioArrowUp
: ArpeggioarpeggioBracket
: ArpeggioarpeggioNormal
: ArpeggioarpeggioParenthesis
: Arpeggioarranger
: Creating titlesaug
: Common chordsauto-first-page-number
: Page formattingautoBeaming
: Setting automatic beam behaviorautoBeamSettings
: Setting automatic beam behaviorautochange
: Changing staff automaticallyBalloon_engraver
: Balloon helpballoonGrobText
: Balloon helpballoonLengthOff
: Balloon helpballoonLengthOn
: Balloon helpballoonText
: Balloon helpbarCheckSynchronize
: Bar and bar number checksbarNumberVisibility
: Bar numbersbase-shortest-duration
: Horizontal spacing overviewbefore-title-space
: Page formattingbendAfter
: Falls and doitsbetween-system-padding
: Page formattingbetween-system-space
: Page formattingbetween-title-space
: Page formattingblank-last-page-force
: Page formattingblank-page-force
: Page formattingbookTitleMarkup
: Custom titlesbottom-margin
: Page formattingbracket
: Piano pedalsbracket
: New dynamic marksbreakable
: Automatic beamsbreakbefore
: Creating titlesbreathe
: Breath markschange
: Changing staff manuallychordNameExceptions
: Customizing chord nameschordNameSeparator
: Customizing chord nameschordNoteNamer
: Customizing chord nameschordPrefixSpacer
: Customizing chord nameschordRootNamer
: Customizing chord nameschords
: Printing chord namescolor
: Coloring objectscommon-shortest-duration
: Horizontal spacing overviewcomposer
: Creating titlescontrolpitch
: Octave checkscopyright
: Creating titlescrescHairpin
: DynamicscrescTextCresc
: Dynamicscross
: Special note headscross-staff
: Cross-staff stemscurrentBarNumber
: Time administrationcurrentBarNumber
: Bar numbersdedication
: Creating titlesdefault
: Automatic accidentalsdefaultBarType
: Bar linesdim
: Common chordsdimHairpin
: DynamicsdimTextDecr
: DynamicsdimTextDecresc
: DynamicsdimTextDim
: Dynamicsdodecaphonic
: Automatic accidentalsdynamic
: New dynamic marksdynamicDown
: DynamicsDynamicLineSpanner
: DynamicsdynamicNeutral
: DynamicsdynamicUp
: Dynamicsespressivo
: DynamicsevenFooterMarkup
: Custom titlesevenHeaderMarkup
: Custom titlesf
: Dynamicsff
: Dynamicsfff
: Dynamicsffff
: Dynamicsfinger
: Fingering instructionsfirst-page-number
: Page formattingflag-style
: Cross-staff stemsfollowVoice
: Staff-change linesfont-interface
: Single entry fontsfont-interface
: Selecting notation font sizefont-size
: Selecting notation font sizefontSize
: Selecting notation font sizefoot-separation
: Page formattingforget
: Automatic accidentalsfp
: Dynamicsglissando
: GlissandoGrid_line_span_engraver
: Grid linesGrid_point_engraver
: Grid linesgridInterval
: Grid lineshead-separation
: Page formattinghideKeySignature
: Bagpipe definitionshideNotes
: Hidden noteshideStaffSwitch
: Staff-change lineshorizontal-shift
: Page formattingHorizontal_bracket_engraver
: Analysis bracketshuge
: Selecting notation font sizeindent
: Line lengthinstrument
: Creating titleslarge
: Selecting notation font sizelayout file
: Setting the staff sizeleft-margin
: Page formattinglength
: Cross-staff stemsline-width
: Line lengthline-width
: Page formattingly:minimal-breaking
: Minimal page breakingly:optimal-breaking
: Optimal page breakingly:page-turn-breaking
: Optimal page turningm
: Common chordsmagstep
: Selecting notation font sizemaj
: Common chordsmajor seven symbols
: Customizing chord namesmajorSevenSymbol
: Customizing chord namesmake-dynamic-script
: New dynamic marksmakeClusters
: ClustersmeasureLength
: Time administrationmeasurePosition
: Time administrationmergeDifferentlyDottedOff
: Collision resolutionmergeDifferentlyDottedOn
: Collision resolutionmergeDifferentlyHeadedOff
: Collision resolutionmergeDifferentlyHeadedOn
: Collision resolutionmeter
: Creating titlesmf
: DynamicsminimumFret
: Default tablaturesminimumPageTurnLength
: Optimal page turningminimumRepeatLengthForPageTurn
: Optimal page turningmixed
: Piano pedalsmodern
: Automatic accidentalsmodern-cautionary
: Automatic accidentalsmodern-voice
: Automatic accidentalsmodern-voice-cautionary
: Automatic accidentalsmp
: Dynamicsneo-modern
: Automatic accidentalsneo-modern-cautionary
: Automatic accidentalsno-reset
: Automatic accidentalsnormalsize
: Selecting notation font sizeoddFooterMarkup
: Custom titlesoddHeaderMarkup
: Custom titlesoneVoice
: Single-staff polyphonyopus
: Creating titlesoutside-staff-horizontal-padding
: Vertical collision avoidanceoutside-staff-padding
: Vertical collision avoidanceoutside-staff-priority
: Vertical collision avoidancep
: Dynamicspage-breaking-between-system-padding
: Page formattingpage-spacing-weight
: Page formattingpage-top-space
: Page formattingpaper-height
: Page formattingpaper-width
: Page formattingpapersize
: Paper sizeparallelMusic
: Writing music in parallelparenthesize
: Parenthesespartcombine
: Automatic part combiningpedalSustainStyle
: Piano pedalspercent
: Percent repeatsphrasingSlurDown
: Phrasing slursphrasingSlurNeutral
: Phrasing slursphrasingSlurUp
: Phrasing slurspiano
: Automatic accidentalspiano-cautionary
: Automatic accidentalsPianoStaff
: Changing staff automaticallyPianoStaff
: References for keyboardspiece
: Creating titlespipeSymbol
: Bar and bar number checkspitchedTrill
: Trillspoet
: Creating titlespp
: Dynamicsppp
: Dynamicspppp
: Dynamicsppppp
: Dynamicsprint-first-page-number
: Page formattingprint-page-number
: Page formattingprintallheaders
: Page formattingprintallheaders
: Creating titlesR
: Full measure restsr
: Restsragged-bottom
: Page formattingragged-last
: Line lengthragged-last-bottom
: Page formattingragged-right
: Line lengthrelative
: Changing staff automaticallyrepeatCommands
: Manual repeat marksrfz
: Dynamicsrgb-color
: Coloring objectss
: Invisible restsscoreTitleMarkup
: Custom titlesset-accidental-style
: Automatic accidentalsset-octavation
: Ottava bracketssf
: Dynamicssff
: Dynamicssfz
: DynamicsshiftOff
: Collision resolutionshiftOn
: Collision resolutionshiftOnn
: Collision resolutionshiftOnnn
: Collision resolutionshowKeySignature
: Bagpipe definitionsshowLastLength
: Skipping corrected musicshowStaffSwitch
: Staff-change linesskipTypesetting
: Skipping corrected musicslurDashed
: SlursslurDotted
: SlursslurDown
: SlursslurNeutral
: SlursslurSolid
: Slurssmall
: Selecting notation font sizesostenutoOff
: Piano pedalssostenutoOn
: Piano pedalssp
: Dynamicsspacing
: Horizontal spacing overviewspp
: Dynamicsstaff-padding
: References for keyboardsStaff.midiInstrument
: Creating MIDI filesstart-repeat
: Manual repeat marksstartGroup
: Analysis bracketsstartTrillSpan
: TrillsStem
: Cross-staff stemsstem-spacing-correction
: Horizontal spacing overviewstemLeftBeamCount
: Manual beamsstemRightBeamCount
: Manual beamsstopGroup
: Analysis bracketsstopTrillSpan
: TrillssubdivideBeams
: Automatic beamssubsubtitle
: Creating titlessubtitle
: Creating titlessuggestAccidentals
: Annotational accidentalssus
: Extended and altered chordssustainOff
: Piano pedalssustainOn
: Piano pedalssystem-count
: Page formattingsystemSeparatorMarkup
: Page formattingtagline
: Creating titlestaor
: Bagpipe definitionsteeny
: Selecting notation font sizetext
: Piano pedalstextSpannerDown
: Text spannerstextSpannerNeutral
: Text spannerstextSpannerUp
: Text spannersthumb
: Fingering instructionstiny
: Selecting notation font sizetitle
: Creating titlestop-margin
: Page formattingtreCorde
: Piano pedalstremolo
: Tremolo repeatstremoloFlags
: Tremolo repeatstrill
: TrillsTupletNumber
: TupletstupletNumberFormatFunction
: TupletstupletSpannerDuration
: TupletsunaCorda
: Piano pedalsunfold
: Written-out repeatsunHideNotes
: Hidden notesVoice
: Single-staff polyphonyvoice
: Automatic accidentalsvoiceOne
: Single-staff polyphonywhichBar
: Bar lineswith-color
: Coloring objectsx11-color
: Coloring objects|
: Bar and bar number checks~
: TiesIn addition to all the LilyPond commands and keywords, this index lists musical terms and words which relate to each of them, with links to those sections of the manual which describe or discuss that topic. Each link is in two parts. The first part points to the exact location in the manual where the topic appears; the second part points to the start of the section of the manual where that topic is discussed.
!
: Accidentals'
: Absolute octave entry(begin * * * *)
: Setting automatic beam behavior(end * * * *)
: Setting automatic beam behavior,
: Absolute octave entry.
: Durations/
: Extended and altered chords/+
: Extended and altered chords:
: Tremolo repeats<
: Chorded notes<...>
: Chorded notes=
: Octave checks>
: Chorded notes?
: Accidentals[
: Manual beams\!
: Dynamics\(
: Phrasing slurs\)
: Phrasing slurs\<
: Dynamics\>
: Dynamics\abs-fontsize
: Font\accepts
: Defining new contexts\addlyrics
: Aligning lyrics to a melody\aeolian
: Key signature\afterGrace
: Grace notes\aikenHeads
: Shape note heads\allowPageTurn
: Optimal page turning\alternative
: Long repeats\AncientRemoveEmptyStaffContext
: Hiding staves\applyContext
: Context evaluation\applyOutput
: Running a function on all layout objects\arpeggio
: Arpeggio\arpeggioArrowDown
: Arpeggio\arpeggioArrowUp
: Arpeggio\arpeggioBracket
: Arpeggio\arpeggioNormal
: Arpeggio\arpeggioParenthesis
: Arpeggio\arrow-head
: Graphic\arrow-head
: Graphic notation inside markup\ascendens
: Gregorian square neumes ligatures\auctum
: Gregorian square neumes ligatures\augmentum
: Gregorian square neumes ligatures\autoBeamOff
: Setting automatic beam behavior\autoBeamOn
: Setting automatic beam behavior\autochange
: Changing staff automatically\backslashed-digit
: Other\balloonGrobText
: Balloon help\balloonLengthOff
: Balloon help\balloonLengthOn
: Balloon help\balloonText
: Balloon help\bar
: Bar lines\beam
: Graphic\bendAfter
: Falls and doits\bigger
: Font\bigger
: Selecting font and font size\bold
: Font\bold
: Selecting font and font size\book
: File structure\book
: Multiple scores in a book\box
: Font\box
: Graphic notation inside markup\bracket
: Graphic\bracket
: Graphic notation inside markup\bracket
: New dynamic marks\break
: Line breaking\breathe
: Breath marks\breve
: Rests\breve
: Durations\cadenzaOff
: Unmetered music\cadenzaOn
: Unmetered music\caesura
: Divisiones\caps
: Font\cavum
: Gregorian square neumes ligatures\center-align
: Align\center-align
: Text alignment\center-column
: Align\center-column
: Text alignment\change
: Changing staff manually\char
: Other\chordmode
: Transpose\chordmode
: Relative octave entry\circle
: Graphic\circle
: Graphic notation inside markup\clef
: Clef\column
: Align\column
: Text alignment\column-lines
: Text markup list commands\combine
: Align\combine
: Graphic notation inside markup\compressFullBarRests
: Full measure rests\concat
: Align\context
: Creating contexts\cr
: Dynamics\crescHairpin
: Dynamics\crescTextCresc
: Dynamics\decr
: Dynamics\defaultTimeSignature
: Time signature\deminutum
: Gregorian square neumes ligatures\denies
: Defining new contexts\descendens
: Gregorian square neumes ligatures\dimHairpin
: Dynamics\dimTextDecr
: Dynamics\dimTextDecresc
: Dynamics\dimTextDim
: Dynamics\dir-column
: Align\displayLilyMusic
: Music properties\displayLilyMusic
: Displaying LilyPond notation\displayMusic
: Displaying music expressions\divisioMaior
: Divisiones\divisioMaxima
: Divisiones\divisioMinima
: Divisiones\dorian
: Key signature\dotsDown
: Durations\dotsNeutral
: Durations\dotsUp
: Durations\doubleflat
: Music\doublesharp
: Music\draw-circle
: Graphic\draw-circle
: Graphic notation inside markup\draw-line
: Graphic\draw-line
: Graphic notation inside markup\dynamic
: Font\dynamic
: New dynamic marks\dynamicDown
: Dynamics\dynamicNeutral
: Dynamics\dynamicUp
: Dynamics\easyHeadsOff
: Easy notation note heads\easyHeadsOn
: Easy notation note heads\epsfile
: Graphic\epsfile
: Graphic notation inside markup\espressivo
: Dynamics\expandFullBarRests
: Full measure rests\f
: Dynamics\featherDurations
: Feathered beams\ff
: Dynamics\fff
: Dynamics\ffff
: Dynamics\fill-line
: Align\fill-line
: Text alignment\filled-box
: Graphic\filled-box
: Graphic notation inside markup\finalis
: Divisiones\finger
: Font\finger
: Fingering instructions\flat
: Music\flexa
: Gregorian square neumes ligatures\fontCaps
: Font\fontsize
: Font\fontsize
: Selecting font and font size\fp
: Dynamics\fraction
: Other\frenchChords
: Customizing chord names\fret-diagram
: Instrument Specific Markup\fret-diagram-terse
: Instrument Specific Markup\fret-diagram-verbose
: Instrument Specific Markup\fromproperty
: Other\general-align
: Align\general-align
: Text alignment\germanChords
: Customizing chord names\glissando
: Glissando\grace
: Grace notes\halign
: Align\halign
: Text alignment\harp-pedal
: Instrument Specific Markup\hbracket
: Graphic\hbracket
: Graphic notation inside markup\hcenter-in
: Align\header
: File structure\hideKeySignature
: Bagpipe definitions\hideNotes
: Hidden notes\hideStaffSwitch
: Staff-change lines\hspace
: Align\huge
: Font\huge
: Selecting font and font size\huge
: Selecting notation font size\improvisationOff
: Improvisation\improvisationOn
: Improvisation\inclinatum
: Gregorian square neumes ligatures\include
: Including LilyPond files\ionian
: Key signature\italianChords
: Customizing chord names\italic
: Font\italic
: Selecting font and font size\justified-lines
: Text markup list commands\justify
: Align\justify
: Text alignment\justify-field
: Align\justify-string
: Align\keepWithTag
: Using tags\key
: Shape note heads\key
: Key signature\label
: Reference to page numbers\laissezVibrer
: Ties\large
: Font\large
: Selecting font and font size\large
: Selecting notation font size\larger
: Font\larger
: Selecting font and font size\layout
: Score layout\layout
: File structure\left-align
: Align\left-align
: Text alignment\left-column
: Align\line
: Align\linea
: Gregorian square neumes ligatures\locrian
: Key signature\longa
: Rests\longa
: Durations\lookup
: Other\lower
: Align\lower
: Text alignment\lydian
: Key signature\lyricmode
: Aligning lyrics to a melody\lyricmode
: Entering lyrics\lyricsto
: Aligning lyrics to a melody\magnify
: Font\magnify
: Selecting font and font size\major
: Key signature\makeClusters
: Clusters\mark
: Text marks\mark
: Rehearsal marks\markalphabet
: Other\markletter
: Other\markup
: Text markup introduction\markup
: Separate text\markuplines
: Multi-page markup\markuplines
: Separate text\maxima
: Rests\maxima
: Durations\medium
: Font\melisma
: Multiple notes to one syllable\melismaEnd
: Multiple notes to one syllable\mergeDifferentlyDottedOff
: Collision resolution\mergeDifferentlyDottedOn
: Collision resolution\mergeDifferentlyHeadedOff
: Collision resolution\mergeDifferentlyHeadedOn
: Collision resolution\mf
: Dynamics\midi
: File structure\minor
: Key signature\mixolydian
: Key signature\mp
: Dynamics\musicglyph
: Music\natural
: Music\new
: Creating contexts\noBeam
: Manual beams\noBreak
: Line breaking\noPageBreak
: Page breaking\noPageTurn
: Optimal page turning\normal-size-sub
: Font\normal-size-super
: Font\normal-text
: Font\normalsize
: Font\normalsize
: Selecting font and font size\normalsize
: Selecting notation font size\note
: Music\note-by-number
: Music\null
: Other\number
: Font\numericTimeSignature
: Time signature\octaveCheck
: Octave checks\on-the-fly
: Other\oneVoice
: Single-staff polyphony\oriscus
: Gregorian square neumes ligatures\override
: Other\override
: The override command\override-lines
: Text markup list commands\p
: Dynamics\pad-around
: Align\pad-around
: Graphic notation inside markup\pad-markup
: Align\pad-markup
: Graphic notation inside markup\pad-to-box
: Align\pad-to-box
: Graphic notation inside markup\pad-x
: Align\pad-x
: Graphic notation inside markup\page-ref
: Other\page-ref
: Reference to page numbers\pageBreak
: Page breaking\pageTurn
: Optimal page turning\paper
: Page formatting\paper
: File structure\parallelMusic
: Writing music in parallel\parenthesize
: Parentheses\partcombine
: Automatic part combining\partial
: Normal repeats\partial
: Long repeats\partial
: Upbeats\pes
: Gregorian square neumes ligatures\phrasingSlurDown
: Phrasing slurs\phrasingSlurNeutral
: Phrasing slurs\phrasingSlurUp
: Phrasing slurs\phrygian
: Key signature\pitchedTrill
: Trills\postscript
: Graphic\postscript
: Graphic notation inside markup\pp
: Dynamics\ppp
: Dynamics\pppp
: Dynamics\ppppp
: Dynamics\property in \lyricmode
: Entering lyrics\put-adjacent
: Align\quilisma
: Gregorian square neumes ligatures\raise
: Align\raise
: Text alignment\relative
: Changing staff automatically\relative
: Transpose\relative
: Relative octave entry\RemoveEmptyRhythmicStaffContext
: Hiding staves\RemoveEmptyStaffContext
: Hiding staves\removeWithTag
: Using tags\repeat
: Long repeats\repeat percent
: Percent repeats\repeat tremolo
: Tremolo repeats\repeatTie
: Normal repeats\repeatTie
: Ties\rest
: Rests\rfz
: Dynamics\right-align
: Align\right-align
: Text alignment\right-column
: Align\roman
: Font\rotate
: Align\rounded-box
: Graphic\rounded-box
: Graphic notation inside markup\sacredHarpHeads
: Shape note heads\sans
: Font\scaleDurations
: Scaling durations\score
: Music\score
: File structure\score
: Structure of a score\semiflat
: Music\semiGermanChords
: Customizing chord names\semisharp
: Music\sesquiflat
: Music\sesquisharp
: Music\set
: The set command\sf
: Dynamics\sff
: Dynamics\sfz
: Dynamics\sharp
: Music\shiftOff
: Collision resolution\shiftOn
: Collision resolution\shiftOnn
: Collision resolution\shiftOnnn
: Collision resolution\showKeySignature
: Bagpipe definitions\showStaffSwitch
: Staff-change lines\simple
: Font\skip
: Invisible rests\slashed-digit
: Other\slurDashed
: Slurs\slurDotted
: Slurs\slurDown
: Slurs\slurNeutral
: Slurs\slurSolid
: Slurs\slurUp
: Slurs\small
: Font\small
: Selecting font and font size\small
: Selecting notation font size\smallCaps
: Font\smaller
: Font\smaller
: Selecting font and font size\sostenutoOff
: Piano pedals\sostenutoOn
: Piano pedals\sp
: Dynamics\spp
: Dynamics\startGroup
: Analysis brackets\startStaff
: Staff symbol\startTrillSpan
: Trills\stemDown
: Stems\stemNeutral
: Stems\stemUp
: Stems\stencil
: Other\stopGroup
: Analysis brackets\stopStaff
: Staff symbol\stopTrillSpan
: Trills\stropha
: Gregorian square neumes ligatures\strut
: Other\sub
: Font\sub
: Selecting font and font size\super
: Font\super
: Selecting font and font size\sustainOff
: Piano pedals\sustainOn
: Piano pedals\table-of-contents
: Table of contents\tag
: Using tags\taor
: Bagpipe definitions\teeny
: Font\teeny
: Selecting font and font size\teeny
: Selecting notation font size\tempo
: Metronome marks\text
: Font\textLengthOff
: Text scripts\textLengthOn
: Text scripts\thumb
: Fingering instructions\tied-lyric
: Music\tieDashed
: Ties\tieDotted
: Ties\tieDown
: Ties\tieNeutral
: Ties\tieSolid
: Ties\tieUp
: Ties\time
: Time signature\times
: Tuplets\tiny
: Font\tiny
: Selecting font and font size\tiny
: Selecting notation font size\tocItem
: Table of contents\translate
: Align\translate
: Text alignment\translate-scaled
: Align\translate-scaled
: Text alignment\transparent
: Other\transpose
: Transpose\transpose
: Relative octave entry\transposition
: Instrument transpositions\treCorde
: Piano pedals\triangle
: Graphic\triangle
: Graphic notation inside markup\trill
: Trills\tupletDown
: Tuplets\tupletNeutral
: Tuplets\tupletUp
: Tuplets\tweak
: The tweak command\typewriter
: Font\unaCorda
: Piano pedals\underline
: Font\underline
: Selecting font and font size\unfoldRepeats
: Repeats in MIDI\unHideNotes
: Hidden notes\unset
: The set command\upright
: Font\vcenter
: Align\verbatim-file
: Other\virga
: Gregorian square neumes ligatures\virgula
: Divisiones\voiceFourStyle
: Voice styles\voiceNeutralStyle
: Voice styles\voiceOne
: Single-staff polyphony\voiceOne ... \voiceFour
: Single-staff polyphony\voiceOneStyle
: Voice styles\voiceThreeStyle
: Voice styles\voiceTwoStyle
: Voice styles\whiteout
: Other\with
: Modifying context plug-ins\with-color
: Other\with-color
: Coloring objects\with-dimensions
: Other\with-url
: Graphic\wordwrap
: Align\wordwrap
: Text alignment\wordwrap-field
: Align\wordwrap-internal
: Text markup list commands\wordwrap-lines
: Text markup list commands\wordwrap-string
: Align\wordwrap-string-internal
: Text markup list commands]
: Manual beams^
: Extended and altered chords_
: Multiple syllables to one note_
: Entering lyricsa due
: Automatic part combiningAbout the documentation
: Topacciaccatura
: Identifiersacciaccatura
: Overview of available music functionsAccidental
: Ancient accidentalsAccidental
: Automatic accidentalsAccidental
: Accidentalsaccidental-interface
: Accidentalsaccidental-suggestion-interface
: Automatic accidentalsAccidental_engraver
: Annotational accidentalsAccidental_engraver
: Automatic accidentalsAccidental_engraver
: AccidentalsAccidentalCautionary
: AccidentalsAccidentalPlacement
: Automatic accidentalsAccidentals and key signatures
: Arabic key signaturesAccidentals and key signatures
: Key signatureAccidentals and key signatures
: AccidentalsAccidentalSuggestion
: Annotational accidentalsAccidentalSuggestion
: Automatic accidentalsaddChordShape
: IdentifiersaddChordShape
: Overview of available music functionsAdding and removing engravers
: Automatic note splittingaddInstrumentDefinition
: IdentifiersaddInstrumentDefinition
: Overview of available music functionsaddQuote
: IdentifiersaddQuote
: Overview of available music functionsafter-title-space
: Page formattingafterGrace
: IdentifiersafterGrace
: Overview of available music functionsalignAboveContext
: Aligning contextsalignBelowContext
: Aligning contextsAll layout objects
: Overview of modifying propertiesallowPageTurn
: IdentifiersallowPageTurn
: Overview of available music functionsAmbitus
: Ambitusambitus-interface
: AmbitusAmbitus_engraver
: AmbitusAmbitusAccidental
: AmbitusAmbitusLine
: AmbitusAmbitusNoteHead
: Ambitusannotate-spacing
: Displaying spacingapplyContext
: IdentifiersapplyContext
: Overview of available music functionsapplyMusic
: IdentifiersapplyMusic
: Overview of available music functionsapplyOutput
: IdentifiersapplyOutput
: Overview of available music functionsappoggiatura
: Identifiersappoggiatura
: Overview of available music functionsArpeggio
: ArpeggioarpeggioArrowDown
: ArpeggioarpeggioArrowUp
: ArpeggioarpeggioBracket
: ArpeggioarpeggioNormal
: ArpeggioarpeggioParenthesis
: Arpeggioarranger
: Creating titlesArticulation and dynamics
: DynamicsassertBeamQuant
: IdentifiersassertBeamQuant
: Overview of available music functionsassertBeamSlope
: IdentifiersassertBeamSlope
: Overview of available music functionsaug
: Common chordsauto-first-page-number
: Page formattingautoBeaming
: Setting automatic beam behaviorautoBeamSettings
: Setting automatic beam behaviorautochange
: Identifiersautochange
: Overview of available music functionsautochange
: Changing staff automaticallyAutoChangeMusic
: Changing staff automaticallyAxis_group_engraver
: Vertical spacing inside a systemBackend
: Overview of modifying propertiesBackend
: Navigating the program referenceballoon-interface
: Balloon helpBalloon_engraver
: Balloon helpballoonGrobText
: IdentifiersballoonGrobText
: Overview of available music functionsballoonGrobText
: Balloon helpballoonLengthOff
: Balloon helpballoonLengthOn
: Balloon helpballoonText
: IdentifiersballoonText
: Overview of available music functionsballoonText
: Balloon helpBalloonTextItem
: Balloon helpbar
: Identifiersbar
: Overview of available music functionsbar-line-interface
: All context propertiesBar_engraver
: Printing chord namesbarCheckSynchronize
: Bar and bar number checksBarLine
: Bar linesBarNumber
: Bar numbersbarNumberCheck
: IdentifiersbarNumberCheck
: Overview of available music functionsbarNumberVisibility
: Bar numbersbase-shortest-duration
: Horizontal spacing overviewBassFigure
: Displaying figured bassBassFigure
: Entering figured bassBassFigureAlignment
: Displaying figured bassBassFigureAlignment
: Entering figured bassBassFigureBracket
: Displaying figured bassBassFigureBracket
: Entering figured bassBassFigureContinuation
: Displaying figured bassBassFigureContinuation
: Entering figured bassBassFigureLine
: Displaying figured bassBassFigureLine
: Entering figured bassBeam
: Default tablaturesBeam
: Changing staff manuallyBeam
: Automatic beamsbefore-title-space
: Page formattingbendAfter
: IdentifiersbendAfter
: Overview of available music functionsbendAfter
: Falls and doitsbetween-system-padding
: Page formattingbetween-system-space
: Page formattingbetween-title-space
: Page formattingblank-last-page-force
: Page formattingblank-page-force
: Page formattingbookTitleMarkup
: Custom titlesbottom-margin
: Page formattingbrace
: Grouping stavesbracket
: Piano pedalsbracket
: Grouping stavesbracket
: New dynamic marksbreakable
: Automatic beamsbreakbefore
: Creating titlesbreathe
: Identifiersbreathe
: Overview of available music functionsbreathe
: Breath marksBreathingSign
: DivisionesBreathingSign
: Breath marksbreve
: Durationschange
: Changing staff manuallyChoirStaff
: Deeper nested staff groupsChoirStaff
: Grouping staveschord
: Printing chord nameschord
: Chord mode overviewchord
: Chorded notesChord_name_engraver
: Printing chord namesChordName
: Printing chord nameschordNameExceptions
: Customizing chord namesChordNames
: Printing chord namesChordNames
: Hiding staveschordNameSeparator
: Customizing chord nameschordNoteNamer
: Customizing chord nameschordPrefixSpacer
: Customizing chord nameschordRootNamer
: Customizing chord nameschurch mode
: Key signatureclef
: Identifiersclef
: Overview of available music functionsClef
: Clefclef-interface
: ClefClef_engraver
: ClefCluster_spanner_engraver
: ClustersClusterSpanner
: ClustersClusterSpannerBeacon
: ClustersCollisions of objects
: Collision resolutioncolor
: Coloring objectsCombining notes into chords
: Chorded notescommon-shortest-duration
: Horizontal spacing overviewCompletion_heads_engraver
: Automatic note splittingcomposer
: Creating titlesconcert pitch
: Instrument transpositionsContextChange
: Changing staff manuallyContexts
: Modifying context plug-insContexts and engravers
: Single-staff polyphonycontrolpitch
: Octave checkscopyright
: Creating titlescrescHairpin
: DynamicscrescTextCresc
: Dynamicscross
: Special note headscross-staff
: Cross-staff stemscueDuring
: IdentifierscueDuring
: Overview of available music functionsCueVoice
: Formatting cue notescurrentBarNumber
: Time administrationcurrentBarNumber
: Bar numbersCustos
: CustodesCustos_engraver
: Custodesdedication
: Creating titlesdefault
: Automatic accidentalsdefaultBarType
: Bar linesdim
: Common chordsdimHairpin
: DynamicsdimTextDecr
: DynamicsdimTextDecresc
: DynamicsdimTextDim
: Dynamicsdispatcher
: Scheme functionsdisplayLilyMusic
: IdentifiersdisplayLilyMusic
: Overview of available music functionsdisplayMusic
: IdentifiersdisplayMusic
: Overview of available music functionsdodecaphonic
: Automatic accidentalsDotColumn
: DurationsDots
: DurationsDoublePercentRepeat
: Percent repeatsDoublePercentRepeatCounter
: Percent repeatsDrumStaff
: Custom percussion stavesDrumStaff
: Instantiating new stavesDrumVoice
: Custom percussion stavesDuration names notes and rests
: Durationsdynamic
: New dynamic marksdynamicDown
: DynamicsDynamicLineSpanner
: DynamicsdynamicNeutral
: DynamicsDynamicText
: DynamicsdynamicUp
: DynamicsendSpanners
: IdentifiersendSpanners
: Overview of available music functionsEngravers and Performers
: Modifying context plug-insEngravers explained
: Automatic note splittingEngraving
: Horizontal spacing overviewespressivo
: DynamicsevenFooterMarkup
: Custom titlesevenHeaderMarkup
: Custom titlesExplicitly instantiating voices
: Single-staff polyphonyf
: DynamicsfeatherDurations
: IdentifiersfeatherDurations
: Overview of available music functionsff
: Dynamicsfff
: Dynamicsffff
: Dynamicsfifth
: Relative octave entryfigured bass
: Introduction to figured bassFiguredBass
: Displaying figured bassFiguredBass
: Entering figured bassFiguredBass
: Hiding stavesfinger
: Fingering instructionsfinger-interface
: Layout interfacesFingering
: Layout interfacesFingering
: Navigating the program referenceFingering
: String number indicationsFingering
: Fingering instructionsfingering-event
: Navigating the program referencefingering-event
: Fingering instructionsFingering_engraver
: Determining the grob propertyFingering_engraver
: Navigating the program referenceFingering_engraver
: Fingering instructionsFingeringEvent
: Navigating the program referenceFingeringEvent
: Fingering instructionsfirst-page-number
: Page formattingFixing overlapping
: Changing staff manuallyFixing overlapping notation
: Changing staff manuallyflag-style
: Cross-staff stemsfollowVoice
: Staff-change linesfont-interface
: Otherfont-interface
: Layout interfacesfont-interface
: Single entry fontsfont-interface
: Selecting notation font sizefont-size
: Selecting notation font sizefontSize
: Selecting notation font sizefoot-separation
: Page formattingForbid_line_break_engraver
: Automatic note splittingforget
: Automatic accidentalsFormatting
: Layout propertiesFormatting text
: Layout propertiesfp
: DynamicsFrenched staff
: Ossia stavesfret-diagram-interface
: Automatic fret diagramsfret-diagram-interface
: Predefined fret diagramsfret-diagram-interface
: Fret diagram markupsGlissando
: SpannersGlissando
: Glissandograce
: Identifiersgrace
: Overview of available music functionsGraceMusic
: Internal music representationGraceMusic
: Grace notesGrandStaff
: Grouping stavesGrandStaff
: Automatic accidentalsGregorianTranscriptionStaff
: Instantiating new stavesgrid-line-interface
: Grid linesgrid-point-interface
: Grid linesGrid_line_span_engraver
: Grid linesGrid_point_engraver
: Grid linesgridInterval
: Grid linesGridLine
: Grid linesGridPoint
: Grid linesgrob-interface
: Layout interfacesHairpin
: Dynamicshead-separation
: Page formattinghideKeySignature
: Bagpipe definitionshideNotes
: Hidden noteshideStaffSwitch
: Staff-change lineshorizontal-bracket-interface
: Analysis bracketshorizontal-shift
: Page formattingHorizontal_bracket_engraver
: Analysis bracketsHorizontalBracket
: Analysis bracketsHow LilyPond input files work
: File structurehuge
: Selecting notation font sizeI'm hearing Voices
: Percussion stavesI'm hearing Voices
: Voice stylesincludePageLayoutFile
: IdentifiersincludePageLayoutFile
: Overview of available music functionsindent
: Line lengthInnerChoirStaff
: Deeper nested staff groupsInnerStaffGroup
: Deeper nested staff groupsinstrument
: Creating titlesInstrumentName
: Instrument namesinstrumentSwitch
: IdentifiersinstrumentSwitch
: Overview of available music functionsinterval
: Relative octave entryInvoking lilypond
: Extracting fragments of musicitem-interface
: Layout interfaceskeepWithTag
: IdentifierskeepWithTag
: Overview of available music functionskey-cancellation-interface
: Key signaturekey-signature-interface
: Key signatureKey_engraver
: Key signatureKey_performer
: Key signatureKeyCancellation
: Key signatureKeyChangeEvent
: Key signatureKeySignature
: Arabic key signaturesKeySignature
: Ancient accidentalsKeySignature
: Key signaturekillCues
: IdentifierskillCues
: Overview of available music functionslabel
: Identifierslabel
: Overview of available music functionsLaissezVibrerTie
: TiesLaissezVibrerTieColumn
: Tieslarge
: Selecting notation font sizelayout file
: Setting the staff sizeledger line
: Staff symbolledger-line-spanner-interface
: Special note headsLedger_line_engraver
: Special note headsLedgerLineSpanner
: Special note headsleft-margin
: Page formattinglength
: Cross-staff stemsLength and thickness of objects
: Ossia stavesLigature_bracket_engraver
: White mensural ligaturesLigatureBracket
: Ligaturesline
: Staff symbolline-spanner-interface
: Spannersline-width
: Line lengthline-width
: Page formattingLineBreakEvent
: Line breakinglistener
: Scheme functionslonga
: Durationsly:add-file-name-alist
: Scheme functionsly:add-interface
: Scheme functionsly:add-listener
: Scheme functionsly:add-option
: Scheme functionsly:all-grob-interfaces
: Scheme functionsly:all-options
: Scheme functionsly:all-stencil-expressions
: Scheme functionsly:assoc-get
: Scheme functionsly:book-add-score!
: Scheme functionsly:book-process
: Scheme functionsly:book-process-to-systems
: Scheme functionsly:box?
: Scheme functionsly:bp
: Scheme functionsly:bracket
: Scheme functionsly:broadcast
: Scheme functionsly:camel-case->lisp-identifier
: Scheme functionsly:chain-assoc-get
: Scheme functionsly:clear-anonymous-modules
: Scheme functionsly:cm
: Scheme functionsly:command-line-code
: Scheme functionsly:command-line-options
: Scheme functionsly:command-line-verbose?
: Scheme functionsly:connect-dispatchers
: Scheme functionsly:context-event-source
: Scheme functionsly:context-events-below
: Scheme functionsly:context-find
: Scheme functionsly:context-grob-definition
: Scheme functionsly:context-id
: Scheme functionsly:context-name
: Scheme functionsly:context-now
: Scheme functionsly:context-parent
: Scheme functionsly:context-property
: Scheme functionsly:context-property-where-defined
: Scheme functionsly:context-pushpop-property
: Scheme functionsly:context-set-property!
: Scheme functionsly:context-unset-property
: Scheme functionsly:context?
: Scheme functionsly:default-scale
: Scheme functionsly:dimension?
: Scheme functionsly:dir?
: Scheme functionsly:duration->string
: Scheme functionsly:duration-dot-count
: Scheme functionsly:duration-factor
: Scheme functionsly:duration-length
: Scheme functionsly:duration-log
: Scheme functionsly:duration<?
: Scheme functionsly:duration?
: Scheme functionsly:effective-prefix
: Scheme functionsly:error
: Scheme functionsly:eval-simple-closure
: Scheme functionsly:event-deep-copy
: Scheme functionsly:event-property
: Scheme functionsly:event-set-property!
: Scheme functionsly:expand-environment
: Scheme functionsly:export
: Scheme functionsly:find-accidentals-simple
: Scheme functionsly:find-file
: Scheme functionsly:font-config-display-fonts
: Scheme functionsly:font-config-get-font-file
: Scheme functionsly:font-design-size
: Scheme functionsly:font-file-name
: Scheme functionsly:font-get-glyph
: Scheme functionsly:font-glyph-name-to-charcode
: Scheme functionsly:font-glyph-name-to-index
: Scheme functionsly:font-index-to-charcode
: Scheme functionsly:font-load
: Scheme functionsly:font-magnification
: Scheme functionsly:font-metric?
: Scheme functionsly:font-name
: Scheme functionsly:font-sub-fonts
: Scheme functionsly:format
: Scheme functionsly:format-output
: Scheme functionsly:get-all-function-documentation
: Scheme functionsly:get-all-translators
: Scheme functionsly:get-glyph
: Scheme functionsly:get-listened-event-classes
: Scheme functionsly:get-option
: Scheme functionsly:gettext
: Scheme functionsly:grob-alist-chain
: Scheme functionsly:grob-array-length
: Scheme functionsly:grob-array-ref
: Scheme functionsly:grob-array?
: Scheme functionsly:grob-basic-properties
: Scheme functionsly:grob-common-refpoint
: Scheme functionsly:grob-common-refpoint-of-array
: Scheme functionsly:grob-default-font
: Scheme functionsly:grob-extent
: Scheme functionsly:grob-interfaces
: Scheme functionsly:grob-layout
: Scheme functionsly:grob-object
: Scheme functionsly:grob-original
: Scheme functionsly:grob-parent
: Scheme functionsly:grob-pq<?
: Scheme functionsly:grob-properties
: Scheme functionsly:grob-property
: Scheme functionsly:grob-property-data
: Scheme functionsly:grob-relative-coordinate
: Scheme functionsly:grob-robust-relative-extent
: Scheme functionsly:grob-script-priority-less
: Scheme functionsly:grob-set-property!
: Scheme functionsly:grob-staff-position
: Scheme functionsly:grob-suicide!
: Scheme functionsly:grob-system
: Scheme functionsly:grob-translate-axis!
: Scheme functionsly:grob?
: Scheme functionsly:gulp-file
: Scheme functionsly:hash-table-keys
: Scheme functionsly:inch
: Scheme functionsly:input-both-locations
: Scheme functionsly:input-file-line-char-column
: Scheme functionsly:input-location?
: Scheme functionsly:input-message
: Scheme functionsly:interpret-music-expression
: Scheme functionsly:interpret-stencil-expression
: Scheme functionsly:intlog2
: Scheme functionsly:is-listened-event-class
: Scheme functionsly:item-break-dir
: Scheme functionsly:item?
: Scheme functionsly:iterator?
: Scheme functionsly:lexer-keywords
: Scheme functionsly:lily-lexer?
: Scheme functionsly:lily-parser?
: Scheme functionsly:load-text-dimensions
: Scheme functionsly:make-book
: Scheme functionsly:make-dispatcher
: Scheme functionsly:make-duration
: Scheme functionsly:make-global-context
: Scheme functionsly:make-global-translator
: Scheme functionsly:make-listener
: Scheme functionsly:make-moment
: Scheme functionsly:make-music
: Scheme functionsly:make-music-function
: Scheme functionsly:make-output-def
: Scheme functionsly:make-page-label-marker
: Scheme functionsly:make-page-permission-marker
: Scheme functionsly:make-pango-description-string
: Scheme functionsly:make-paper-outputter
: Scheme functionsly:make-pitch
: Scheme functionsly:make-prob
: Scheme functionsly:make-scale
: Scheme functionsly:make-score
: Scheme functionsly:make-simple-closure
: Scheme functionsly:make-stencil
: Scheme functionsly:make-stream-event
: Scheme functionsly:message
: Scheme functionsly:minimal-breaking
: Scheme functionsly:minimal-breaking
: Minimal page breakingly:mm
: Scheme functionsly:module->alist
: Scheme functionsly:module-copy
: Scheme functionsly:modules-lookup
: Scheme functionsly:moment-add
: Scheme functionsly:moment-div
: Scheme functionsly:moment-grace-denominator
: Scheme functionsly:moment-grace-numerator
: Scheme functionsly:moment-main-denominator
: Scheme functionsly:moment-main-numerator
: Scheme functionsly:moment-mod
: Scheme functionsly:moment-mul
: Scheme functionsly:moment-sub
: Scheme functionsly:moment<?
: Scheme functionsly:moment?
: Scheme functionsly:music-compress
: Scheme functionsly:music-deep-copy
: Scheme functionsly:music-duration-compress
: Scheme functionsly:music-duration-length
: Scheme functionsly:music-function-extract
: Scheme functionsly:music-function?
: Scheme functionsly:music-length
: Scheme functionsly:music-list?
: Scheme functionsly:music-mutable-properties
: Scheme functionsly:music-output?
: Scheme functionsly:music-property
: Scheme functionsly:music-set-property!
: Scheme functionsly:music-transpose
: Scheme functionsly:music?
: Scheme functionsly:note-head::stem-attachment
: Scheme functionsly:number->string
: Scheme functionsly:optimal-breaking
: Scheme functionsly:optimal-breaking
: Optimal page breakingly:option-usage
: Scheme functionsly:otf->cff
: Scheme functionsly:otf-font-glyph-info
: Scheme functionsly:otf-font-table-data
: Scheme functionsly:otf-font?
: Scheme functionsly:otf-glyph-list
: Scheme functionsly:output-def-clone
: Scheme functionsly:output-def-lookup
: Scheme functionsly:output-def-parent
: Scheme functionsly:output-def-scope
: Scheme functionsly:output-def-set-variable!
: Scheme functionsly:output-def?
: Scheme functionsly:output-description
: Scheme functionsly:output-formats
: Scheme functionsly:outputter-close
: Scheme functionsly:outputter-dump-stencil
: Scheme functionsly:outputter-dump-string
: Scheme functionsly:outputter-output-scheme
: Scheme functionsly:outputter-port
: Scheme functionsly:page-marker?
: Scheme functionsly:page-turn-breaking
: Scheme functionsly:page-turn-breaking
: Optimal page turningly:pango-font-physical-fonts
: Scheme functionsly:pango-font?
: Scheme functionsly:paper-book-pages
: Scheme functionsly:paper-book-paper
: Scheme functionsly:paper-book-performances
: Scheme functionsly:paper-book-scopes
: Scheme functionsly:paper-book-systems
: Scheme functionsly:paper-book?
: Scheme functionsly:paper-fonts
: Scheme functionsly:paper-get-font
: Scheme functionsly:paper-get-number
: Scheme functionsly:paper-outputscale
: Scheme functionsly:paper-score-paper-systems
: Scheme functionsly:paper-system-minimum-distance
: Scheme functionsly:paper-system?
: Scheme functionsly:parse-file
: Scheme functionsly:parser-clear-error
: Scheme functionsly:parser-clone
: Scheme functionsly:parser-define!
: Scheme functionsly:parser-error
: Scheme functionsly:parser-has-error?
: Scheme functionsly:parser-lexer
: Scheme functionsly:parser-lookup
: Scheme functionsly:parser-output-name
: Scheme functionsly:parser-parse-string
: Scheme functionsly:parser-set-note-names
: Scheme functionsly:performance-write
: Scheme functionsly:pfb->pfa
: Scheme functionsly:pitch-alteration
: Scheme functionsly:pitch-diff
: Scheme functionsly:pitch-negate
: Scheme functionsly:pitch-notename
: Scheme functionsly:pitch-octave
: Scheme functionsly:pitch-quartertones
: Scheme functionsly:pitch-semitones
: Scheme functionsly:pitch-steps
: Scheme functionsly:pitch-transpose
: Scheme functionsly:pitch<?
: Scheme functionsly:pitch?
: Scheme functionsly:position-on-line?
: Scheme functionsly:prob-immutable-properties
: Scheme functionsly:prob-mutable-properties
: Scheme functionsly:prob-property
: Scheme functionsly:prob-property?
: Scheme functionsly:prob-set-property!
: Scheme functionsly:prob-type?
: Scheme functionsly:prob?
: Scheme functionsly:programming-error
: Scheme functionsly:progress
: Scheme functionsly:property-lookup-stats
: Scheme functionsly:protects
: Scheme functionsly:pt
: Scheme functionsly:register-stencil-expression
: Scheme functionsly:relative-group-extent
: Scheme functionsly:reset-all-fonts
: Scheme functionsly:round-filled-box
: Scheme functionsly:round-filled-polygon
: Scheme functionsly:run-translator
: Scheme functionsly:score-add-output-def!
: Scheme functionsly:score-embedded-format
: Scheme functionsly:score-error?
: Scheme functionsly:score-header
: Scheme functionsly:score-music
: Scheme functionsly:score-output-defs
: Scheme functionsly:score-set-header!
: Scheme functionsly:score?
: Scheme functionsly:set-default-scale
: Scheme functionsly:set-grob-modification-callback
: Scheme functionsly:set-middle-C!
: Scheme functionsly:set-option
: Scheme functionsly:set-point-and-click
: Scheme functionsly:set-property-cache-callback
: Scheme functionsly:simple-closure?
: Scheme functionsly:skyline-pair?
: Scheme functionsly:skyline?
: Scheme functionsly:smob-protects
: Scheme functionsly:solve-spring-rod-problem
: Scheme functionsly:source-file?
: Scheme functionsly:spanner-bound
: Scheme functionsly:spanner-broken-into
: Scheme functionsly:spanner?
: Scheme functionsly:start-environment
: Scheme functionsly:stderr-redirect
: Scheme functionsly:stencil-add
: Scheme functionsly:stencil-aligned-to
: Scheme functionsly:stencil-combine-at-edge
: Scheme functionsly:stencil-empty?
: Scheme functionsly:stencil-expr
: Scheme functionsly:stencil-extent
: Scheme functionsly:stencil-fonts
: Scheme functionsly:stencil-in-color
: Scheme functionsly:stencil-rotate
: Scheme functionsly:stencil-translate
: Scheme functionsly:stencil-translate-axis
: Scheme functionsly:stencil?
: Scheme functionsly:stream-event?
: Scheme functionsly:string-substitute
: Scheme functionsly:system-print
: Scheme functionsly:system-stretch
: Scheme functionsly:text-dimension
: Scheme functionsly:text-interface::interpret-markup
: Scheme functionsly:translator-description
: Scheme functionsly:translator-group?
: Scheme functionsly:translator-name
: Scheme functionsly:translator?
: Scheme functionsly:transpose-key-alist
: Scheme functionsly:truncate-list!
: Scheme functionsly:ttf->pfa
: Scheme functionsly:ttf-ps-name
: Scheme functionsly:unit
: Scheme functionsly:usage
: Scheme functionsly:version
: Scheme functionsly:warning
: Scheme functionsly:wide-char->utf-8
: Scheme functionsLyricCombineMusic
: Multiple syllables to one noteLyricCombineMusic
: Working with lyrics and variablesLyricExtender
: Extenders and hyphensLyricHyphen
: Extenders and hyphensLyrics
: All context propertiesLyrics
: Manual syllable durationsLyrics
: Aligning lyrics to a melodyLyrics
: Working with lyrics and variablesLyrics
: Hiding stavesLyricSpace
: Entering lyricsLyricText
: Printing stanzas at the end in multiple columnsLyricText
: Entering lyricsm
: Common chordsmagstep
: Selecting notation font sizemaj
: Common chordsmajor seven symbols
: Customizing chord namesmajorSevenSymbol
: Customizing chord namesmakeClusters
: IdentifiersmakeClusters
: Overview of available music functionsmakeClusters
: ClustersMeasure_grouping_engraver
: Time signatureMeasureGrouping
: Time signaturemeasureLength
: Time administrationmeasurePosition
: Time administrationMensural_ligature_engraver
: White mensural ligaturesMensural_ligature_engraver
: Ancient note headsMensuralStaff
: Instantiating new stavesmergeDifferentlyDottedOff
: Collision resolutionmergeDifferentlyDottedOn
: Collision resolutionmergeDifferentlyHeadedOff
: Collision resolutionmergeDifferentlyHeadedOn
: Collision resolutionmeter
: Creating titlesmeter
: Polymetric notationmetronome
: Metronome marksmetronome mark
: Metronome marksMetronomeMark
: Metronome marksmetronomic indication
: Metronome marksmf
: DynamicsminimumFret
: Default tablaturesminimumPageTurnLength
: Optimal page turningminimumRepeatLengthForPageTurn
: Optimal page turningmixed
: Piano pedalsmodern
: Automatic accidentalsmodern-cautionary
: Automatic accidentalsmodern-voice
: Automatic accidentalsmodern-voice-cautionary
: Automatic accidentalsMoving
: References for keyboardsMoving objects
: Text alignmentmp
: Dynamicsmulti-measure rest
: Full measure restsMultiMeasureRest
: Full measure restsMultiMeasureRestNumber
: Full measure restsMultiMeasureRestText
: Full measure restsMultiple notes at once
: Collision resolutionMusic classes
: Internal music representationMusic definitions
: Navigating the program referenceMusic expressions
: Internal music representationMusic expressions explained
: Structure of a scoreMusic properties
: Internal music representationmusicMap
: IdentifiersmusicMap
: Overview of available music functionsneo-modern
: Automatic accidentalsneo-modern-cautionary
: Automatic accidentalsNesting music expressions
: Ossia stavesNew_fingering_engraver
: Navigating the program referenceNew_fingering_engraver
: Fingering instructionsno-reset
: Automatic accidentalsnoPageBreak
: IdentifiersnoPageBreak
: Overview of available music functionsnoPageTurn
: IdentifiersnoPageTurn
: Overview of available music functionsnormalsize
: Selecting notation font sizenote value
: Durationsnote-collision-interface
: Layout propertiesnote-event
: Shape note headsnote-event
: Easy notation note headsnote-event
: Special note headsnote-head-interface
: Shape note headsnote-head-interface
: Easy notation note headsnote-head-interface
: Special note headsNote_head_line_engraver
: Staff-change linesNote_heads_engraver
: Defining new contextsNote_heads_engraver
: Automatic note splittingNote_heads_engraver
: Shape note headsNote_heads_engraver
: Easy notation note headsNote_heads_engraver
: Special note headsNote_spacing_engraver
: Hidden notesNoteCollision
: Collision resolutionNoteColumn
: Collision resolutionNoteEvent
: Internal music representationNoteHead
: Running a function on all layout objectsNoteHead
: Ancient note headsNoteHead
: Shape note headsNoteHead
: Easy notation note headsNoteHead
: Special note headsNoteSpacing
: Horizontal spacing overviewNoteSpacing
: Hidden notesOctavateEight
: ClefoctaveCheck
: IdentifiersoctaveCheck
: Overview of available music functionsoddFooterMarkup
: Custom titlesoddHeaderMarkup
: Custom titlesoldaddlyrics
: Identifiersoldaddlyrics
: Overview of available music functionsOn the un-nestedness of brackets and ties
: Phrasing slursOn the un-nestedness of brackets and ties
: SlursoneVoice
: Single-staff polyphonyopus
: Creating titlesOrganizing
: Using variablesOrganizing pieces with variables
: Using tagsOrganizing pieces with variables
: Writing music in parallelOther
: Including LilyPond filesOther sources
: Including LilyPond filesOther sources of information
: Layout interfacesOther sources of information
: Controlling MIDI dynamicsOther sources of information
: MIDI blockOther sources of information
: Including LilyPond filesOther sources of information
: Voice stylesOther uses for tweaks
: References for keyboardsottava
: Identifiersottava
: Overview of available music functionsottava-bracket-interface
: Ottava bracketsOttava_spanner_engraver
: Ottava bracketsOttavaBracket
: Ottava bracketsoutside-staff-horizontal-padding
: Vertical collision avoidanceoutside-staff-padding
: Vertical collision avoidanceoutside-staff-priority
: Vertical collision avoidanceoverrideProperty
: IdentifiersoverrideProperty
: Overview of available music functionsOverrideProperty
: Overview of modifying propertiesp
: Dynamicspage-breaking-between-system-padding
: Page formattingpage-spacing-weight
: Page formattingpage-top-space
: Page formattingpageBreak
: IdentifierspageBreak
: Overview of available music functionspageTurn
: IdentifierspageTurn
: Overview of available music functionspaper-height
: Page formattingpaper-width
: Page formattingpapersize
: Paper sizeparallelMusic
: IdentifiersparallelMusic
: Overview of available music functionsparallelMusic
: Writing music in parallelparentheses-interface
: ParenthesesParenthesesItem
: ParenthesesParenthesis_engraver
: Parenthesesparenthesize
: Identifiersparenthesize
: Overview of available music functionsparenthesize
: Parenthesespart
: Automatic part combiningpartcombine
: Identifierspartcombine
: Overview of available music functionspartcombine
: Automatic part combiningPartCombineMusic
: Automatic part combiningpedalSustainStyle
: Piano pedalspercent
: Percent repeatspercent repeat
: Percent repeatsPercentRepeat
: Percent repeatsPercentRepeatCounter
: Percent repeatsPercentRepeatedMusic
: Percent repeatsPhrasingSlur
: Phrasing slursphrasingSlurDown
: Phrasing slursphrasingSlurNeutral
: Phrasing slursphrasingSlurUp
: Phrasing slurspiano
: Automatic accidentalsPiano templates
: References for keyboardspiano-cautionary
: Automatic accidentalsPiano_pedal_engraver
: Piano pedalsPianoPedalBracket
: Piano pedalsPianoStaff
: Changing staff automaticallyPianoStaff
: References for keyboardsPianoStaff
: Instrument namesPianoStaff
: Grouping stavesPianoStaff
: ArpeggioPianoStaff
: Automatic accidentalspiece
: Creating titlespipeSymbol
: Bar and bar number checksPitch names
: Note names in other languagesPitch names
: AccidentalsPitch names
: Relative octave entryPitch names
: Absolute octave entryPitch_squash_engraver
: All context propertiesPitch_squash_engraver
: Defining new contextsPitch_squash_engraver
: Showing melody rhythmsPitch_squash_engraver
: ImprovisationpitchedTrill
: IdentifierspitchedTrill
: Overview of available music functionspitchedTrill
: Trillspoet
: Creating titlespointAndClickOff
: IdentifierspointAndClickOff
: Overview of available music functionspointAndClickOn
: IdentifierspointAndClickOn
: Overview of available music functionspolymetric
: Polymetric notationpolymetric
: Tupletspolymetric time signature
: Polymetric notationpolyphony
: Collision resolutionpp
: Dynamicsppp
: Dynamicspppp
: Dynamicsppppp
: Dynamicsprint-first-page-number
: Page formattingprint-page-number
: Page formattingprintallheaders
: Page formattingprintallheaders
: Creating titlesPropertySet
: Overview of modifying propertiesquarter tone
: AccidentalsquoteDuring
: IdentifiersquoteDuring
: Overview of available music functionsQuoteMusic
: Quoting other voicesR
: Full measure restsr
: Restsragged-bottom
: Page formattingragged-last
: Line lengthragged-last-bottom
: Page formattingragged-right
: Line lengthReal music example
: References for keyboardsRehearsalMark
: Text marksRehearsalMark
: Rehearsal marksrelative
: Changing staff automaticallyRelativeOctaveCheck
: Octave checksRelativeOctaveMusic
: Relative octave entryremoveWithTag
: IdentifiersremoveWithTag
: Overview of available music functionsrepeat
: Normal repeatsrepeatCommands
: Manual repeat marksRepeatedMusic
: Internal music representationRepeatedMusic
: Written-out repeatsRepeatedMusic
: Manual repeat marksRepeatedMusic
: Normal repeatsRepeatSlash
: Percent repeatsresetRelativeOctave
: IdentifiersresetRelativeOctave
: Overview of available music functionsRest
: Ancient restsRest
: RestsRestCollision
: Collision resolutionRevertProperty
: Overview of modifying propertiesrfz
: DynamicsRhythmicStaff
: Instantiating new stavesRhythmicStaff
: Showing melody rhythmsRhythmicStaff
: ImprovisationrightHandFinger
: IdentifiersrightHandFinger
: Overview of available music functionss
: Invisible restsscaleDurations
: IdentifiersscaleDurations
: Overview of available music functionsScheme tutorial
: Interfaces for programmersscordatura
: Key signatureScore
: All context propertiesScore
: Time administrationScore is a (single) compound musical expression
: Structure of a scoreScores and parts
: Including LilyPond filesscoreTitleMarkup
: Custom titlesscoreTweak
: IdentifiersscoreTweak
: Overview of available music functionsScript
: Articulations and ornamentationsself-alignment-interface
: Aligning objectsself-alignment-interface
: Layout interfacesSeparationItem
: Horizontal spacing overviewSequentialMusic
: Internal music representationset-accidental-style
: Automatic accidentalsset-octavation
: Ottava bracketsSetting automatic beam
: All context propertiessf
: Dynamicssff
: Dynamicssfz
: DynamicsshiftDurations
: IdentifiersshiftDurations
: Overview of available music functionsshiftOff
: Collision resolutionshiftOn
: Collision resolutionshiftOnn
: Collision resolutionshiftOnnn
: Collision resolutionshowKeySignature
: Bagpipe definitionsshowLastLength
: Skipping corrected musicshowStaffSwitch
: Staff-change linesside-position-interface
: Aligning objectsside-position-interface
: Layout interfacessimile
: Percent repeatsSimultaneousMusic
: Internal music representationSize of objects
: Ossia stavesSkipMusic
: Invisible restsskipTypesetting
: Skipping corrected musicSlur
: Slursslur
: SlursslurDashed
: SlursslurDotted
: SlursslurDown
: SlursslurNeutral
: SlursslurSolid
: Slurssmall
: Selecting notation font sizeSostenutoEvent
: Piano pedalssostenutoOff
: Piano pedalssostenutoOn
: Piano pedalsSostenutoPedal
: Piano pedalsSostenutoPedalLineSpanner
: Piano pedalssp
: Dynamicsspacing
: Horizontal spacing overviewspacing-spanner-interface
: Layout propertiesSpacingSpanner
: New spacing areaSpacingSpanner
: Horizontal spacing overviewspacingTweaks
: IdentifiersspacingTweaks
: Overview of available music functionsSpanBar
: Bar linesspp
: DynamicsStaff
: All context propertiesStaff
: Horizontal spacing overviewStaff
: CustodesStaff
: Analysis bracketsStaff
: Instrument namesStaff
: Hiding stavesstaff
: Ossia stavesstaff
: Staff symbolStaff
: Grouping stavesStaff
: Instantiating new stavesstaff
: Instantiating new stavesStaff
: Bar linesStaff
: Polymetric notationStaff
: AmbitusStaff
: Automatic accidentalsstaff-padding
: References for keyboardsstaff-symbol-interface
: Staff symbolStaff.midiInstrument
: Creating MIDI filesStaffGroup
: Deeper nested staff groupsStaffGroup
: Grouping stavesStaffGroup
: Bar numbersStaffSpacing
: Horizontal spacing overviewStaffSymbol
: Setting the staff sizeStaffSymbol
: Ossia stavesStaffSymbol
: Staff symbolStaffSymbol
: Instantiating new stavesStanzaNumber
: Printing stanzas at the end in multiple columnsstart-repeat
: Manual repeat marksstartGroup
: Analysis bracketsstartTrillSpan
: Trillsstaves
: Instantiating new stavesStem
: Running a function on all layout objectsStem
: Ancient flagsStem
: Cross-staff stemsStem
: Stemsstem-interface
: Stemsstem-spacing-correction
: Horizontal spacing overviewStem_engraver
: StemsstemLeftBeamCount
: Manual beamsstemRightBeamCount
: Manual beamsstopGroup
: Analysis bracketsstopTrillSpan
: TrillsstorePredefinedDiagram
: IdentifiersstorePredefinedDiagram
: Overview of available music functionsStringNumber
: String number indicationsStrokeFinger
: Right-hand fingeringssubdivideBeams
: Automatic beamssubsubtitle
: Creating titlessubtitle
: Creating titlessuggestAccidentals
: Annotational accidentalssus
: Extended and altered chordsSustainEvent
: Piano pedalssustainOff
: Piano pedalssustainOn
: Piano pedalsSustainPedal
: Piano pedalsSustainPedalLineSpanner
: Piano pedalssystem-count
: Page formattingsystemSeparatorMarkup
: Page formattingSystemStartBar
: Deeper nested staff groupsSystemStartBar
: Grouping stavesSystemStartBrace
: Deeper nested staff groupsSystemStartBrace
: Grouping stavesSystemStartBracket
: Deeper nested staff groupsSystemStartBracket
: Grouping stavesSystemStartSquare
: Deeper nested staff groupsSystemStartSquare
: Grouping stavesTab_note_heads_engraver
: Custom tablaturesTabNoteHead
: Default tablaturesTabStaff
: Default tablaturesTabStaff
: Instantiating new stavesTabVoice
: Default tablaturestag
: Identifierstag
: Overview of available music functionstagline
: Creating titlestaor
: Bagpipe definitionsteeny
: Selecting notation font sizetempo indication
: Metronome markstext
: Piano pedalstext-interface
: Othertext-interface
: Layout interfacestext-script-interface
: Layout interfacesTextScript
: Text markup introductionTextScript
: Separate textTextScript
: Text scriptsTextScript
: Articulations and ornamentationsTextSpanner
: SpannersTextSpanner
: Text spannerstextSpannerDown
: Text spannerstextSpannerNeutral
: Text spannerstextSpannerUp
: Text spannersThe Feta font
: Musicthumb
: Fingering instructionsTie
: Difficult tweakstie
: Automatic note splittingTie
: TiesTieColumn
: TiesTimeScaledMusic
: TupletsTimeSignature
: Ancient time signaturesTimeSignature
: Polymetric notationTimeSignature
: Time signatureTiming_translator
: All context propertiesTiming_translator
: Time administrationTiming_translator
: Bar linesTiming_translator
: Polymetric notationTiming_translator
: UpbeatsTiming_translator
: Time signaturetiny
: Selecting notation font sizetitle
: Creating titlestocItem
: IdentifierstocItem
: Overview of available music functionsTop
: Changing defaultstop-margin
: Page formattingTranslation
: Navigating the program referencetransposedCueDuring
: IdentifierstransposedCueDuring
: Overview of available music functionsTransposedMusic
: Transposetransposition
: Identifierstransposition
: Overview of available music functionstreCorde
: Piano pedalstremoloFlags
: Tremolo repeatstrill
: TrillsTrillSpanner
: SpannersTrillSpanner
: Trillstriplet
: TupletsTunable context properties
: The set commandtuplet
: TupletsTupletBracket
: TupletsTupletNumber
: TupletstupletNumberFormatFunction
: TupletstupletSpannerDuration
: Tupletstweak
: Identifierstweak
: Overview of available music functionsTweaking methods
: The tweak commandTweaking methods
: TupletsTweaking output
: Changing defaultsunaCorda
: Piano pedalsUnaCordaEvent
: Piano pedalsUnaCordaPedal
: Piano pedalsUnaCordaPedalLineSpanner
: Piano pedalsunfold
: Written-out repeatsUnfoldedRepeatedMusic
: Written-out repeatsUnfoldedRepeatedMusic
: Normal repeatsunfoldRepeats
: IdentifiersunfoldRepeats
: Overview of available music functionsunHideNotes
: Hidden notesVaticana_ligature_engraver
: Ancient note headsVaticanaStaff
: Instantiating new stavesVerticalAlignment
: Vertical spacing inside a systemVerticalAxisGroup
: Vertical spacing inside a systemVerticalAxisGroup
: Hiding stavesVisibility and color of objects
: Special considerationsVisibility and color of objects
: Using break-visibilityVisibility and color of objects
: Visibility of objectsVisibility and color of objects
: Modifying context plug-insVocal ensembles
: Aligning contextsVocal ensembles
: Multiple notes to one syllableVoice
: The set commandVoice
: Determining the grob propertyVoice
: Horizontal spacing overviewVoice
: White mensural ligaturesVoice
: LigaturesVoice
: Manual syllable durationsVoice
: Automatic syllable durationsVoice
: Formatting cue notesVoice
: Quoting other voicesVoice
: Automatic part combiningVoice
: Single-staff polyphonyVoice
: ImprovisationVoice
: Ambitusvoice
: Automatic accidentalsVoiceFollower
: SpannersVoiceFollower
: Staff-change linesvoiceOne
: Single-staff polyphonyVoices contain music
: Collision resolutionVoices contain music
: Single-staff polyphonyvolta
: Normal repeatsVolta_engraver
: Printing chord namesVoltaBracket
: Manual repeat marksVoltaBracket
: Normal repeatsVoltaRepeatedMusic
: Manual repeat marksVoltaRepeatedMusic
: Normal repeatswhichBar
: Bar linesWithin-staff objects
: Direction and placementwithMusicProperty
: IdentifierswithMusicProperty
: Overview of available music functionsWorking on input files
: Structure of a score|
: Bar and bar number checks~
: Ties[1] The lyric ties is implemented with the Unicode character U+203F, so be sure to have a font (Like DejaVuLGC) installed that includes this glyph.
[2] Nicely printed parts are good PR for us, so please leave the tagline if you can.
This page is for LilyPond-2.11.58 (development-branch).
Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.
Your suggestions for the documentation are welcome.