with:
@example
-@@lilypond[verbatim,quote,relative=1]
-@end example
-
-or
-
-@example
-@@lilypond[verbatim,quote,relative=2]
+@@lilypond[verbatim,quote]
@end example
If using @code{\book@{@}} in your example then you must also
@code{@@lilypond} parameters.
@example
-not: @@lilypond [verbatim, quote, relative=1]
-but instead: @@lilypond[verbatim,quote,relative=1]
+not: @@lilypond [verbatim, quote, fragment]
+but instead: @@lilypond[verbatim,quote,fragment]
@end example
@item
fragments of music into larger ones, more complex music can be
expressed. For example
-@lilypond[quote,verbatim,fragment,relative=1]
-f4
+@lilypond[quote,verbatim,fragment]
+f'4
@end lilypond
@noindent
Properties can also be set to a Scheme procedure,
-@lilypond[fragment,verbatim,quote,relative=2]
+@lilypond[fragment,verbatim,quote]
\override Stem.thickness = #(lambda (grob)
(if (= UP (ly:grob-property grob 'direction))
2.0
7.0))
-c b a g b a g b
+\relative { c'' b a g b a g b }
@end lilypond
@noindent
@ignore
Tutorial guidelines: (different from policy.txt!)
-- unless you have a really good reason, use either
+- unless you have a really good reason, use
@lilypond[verbatim,quote]
- or
- @lilypond[verbatim,quote,relative=2]
-
- Don't use any other relative=X commands.
- use "aes" and "ees" instead of "as" and "es". I know it's not
correct Dutch naming, but let's not confuse people with this
for an ending bar line. For a full list of bar lines see
the @ruser{Bar lines}.
-@lilypond[verbatim,quote,relative=2]
-g1 e1 \bar "||" c2. c'4 \bar "|."
+@lilypond[verbatim,quote]
+\relative { g'1 e1 \bar "||" c2. c'4 \bar "|." }
@end lilypond
@node Bar checks
@example
warning: barcheck failed at: 1/2
- g1 | e1 | c2. c'
- | g4 c g e | c4 r r2 |
+ g'1 | e1 | c2. c'
+ | g4 c g e | c4 r r2 |
@end example
Although the missing duration is clear in the musical output in this
like German and Dutch. To use other names for
@notation{alterations}, see @ruser{Note names in other languages}.
-@lilypond[verbatim,quote,relative=2]
-cis4 ees fisis, aeses
+@lilypond[verbatim,quote]
+\relative { cis''4 ees fisis, aeses }
@end lilypond
@cindex key signature, setting
The @notation{key signature} is set with the command @code{\key}
followed by a pitch and @code{\major} or @code{\minor}.
-@lilypond[verbatim,quote,relative=1]
-\key d \major
-d4 fis a c |
-\bar "||" \key c \minor
-c,4 ees g b |
+@lilypond[verbatim,quote]
+\relative {
+ \key d \major
+ d'4 fis a c |
+ \bar "||" \key c \minor
+ c,4 ees g b |
+}
@end lilypond
@smallspace
In this example:
-@lilypond[verbatim,quote,relative=2]
-\key d \major
-cis4 d e fis
+@lilypond[verbatim,quote]
+\relative {
+ \key d \major
+ cis''4 d e fis
+}
@end lilypond
@noindent
note with pitch B-natural.} In the key of A-flat major, it
@emph{does} get an accidental:
-@lilypond[verbatim,quote,relative=2]
-\key aes \major
-aes4 c b c
+@lilypond[verbatim,quote]
+\relative {
+ \key aes \major
+ aes'4 c b c
+}
@end lilypond
Whenever you enter a pitch that is a black key on the piano, you
A @notation{tie} is created by appending a tilde @code{~} to the
first of the two notes being tied.
-@lilypond[verbatim,quote,relative=2]
-g4~ g c2~ | c4~ c8 a~ a2 |
+@lilypond[verbatim,quote]
+\relative { g'4~ g c2~ | c4~ c8 a~ a2 | }
@end lilypond
@cindex bare duration
When the pitch does not change, as is always the case with tied notes,
subsequent pitches may be omitted, specifying just the bare duration:
-@lilypond[verbatim,quote,relative=2]
-g4~ 4 c2~ | 4~ 8 a~ 2 |
+@lilypond[verbatim,quote]
+\relative { g'4~ 4 c2~ | 4~ 8 a~ 2 | }
@end lilypond
This shorthand may be useful in other places where the rhythm changes
starting note and ending note are marked with @code{(} and
@code{)} respectively.
-@lilypond[verbatim,quote,relative=2]
-d4( c16) cis( d e c cis d) e( d4)
+@lilypond[verbatim,quote]
+\relative { d''4( c16) cis( d e c cis d) e( d4) }
@end lilypond
@node Phrasing slurs
and phrasing slurs at the same time, but you cannot have
simultaneous slurs or simultaneous phrasing slurs.
-@lilypond[verbatim,quote,relative=2]
-g4\( g8( a) b( c) b4\)
+@lilypond[verbatim,quote]
+\relative { g'4\( g8( a) b( c) b4\) }
@end lilypond
@smallspace
indicate the @notation{articulation} of notes, and can be used on
larger groups of notes. Slurs and ties can be nested.
-@lilypond[verbatim,quote,relative=2]
-c4~( c8 d~ 4 e)
+@lilypond[verbatim,quote]
+\relative { c''4(~ c8 d~ 4 e) }
@end lilypond
Common @notation{articulations} can be added to a note using a
dash @code{-} and a single character:
-@lilypond[verbatim,quote,relative=2]
-c4-^ c-+ c-- c-!
-c4-> c-. c2-_
+@lilypond[verbatim,quote]
+\relative {
+ c''4-^ c-+ c-- c-!
+ c4-> c-. c2-_
+}
@end lilypond
@node Fingerings
Similarly, @notation{fingering} indications can be added to a note
using a dash (@code{-}) and the digit to be printed:
-@lilypond[verbatim,quote,relative=2]
-c4-3 e-5 b-2 a-1
+@lilypond[verbatim,quote]
+\relative { c''4-3 e-5 b-2 a-1 }
@end lilypond
Articulations and fingerings are usually placed automatically, but
articulations on the same note. However, in most cases it is best
to let LilyPond determine the articulation directions.
-@lilypond[verbatim,quote,relative=2]
-c4_-^1 d^. f^4_2-> e^-_+
+@lilypond[verbatim,quote]
+\relative { c''4_-^1 d^. f^4_2-> e^-_+ }
@end lilypond
@node Dynamics
@notation{Dynamic} signs are made by adding the markings (with a
backslash) to the note:
-@lilypond[verbatim,quote,relative=2]
-c4\ff c\mf c\p c\pp
+@lilypond[verbatim,quote]
+\relative { c''4\ff c\mf c\p c\pp }
@end lilypond
example @code{\f}, will end the (de)crescendo, or the command
@code{\!} can be used:
-@lilypond[verbatim,quote,relative=2]
-c4\< c\ff\> c c\!
+@lilypond[verbatim,quote]
+\relative { c''4\< c\ff\> c c\! }
@end lilypond
Text may be added to your scores:
-@lilypond[verbatim,quote,relative=2]
-c2^"espr" a_"legato"
+@lilypond[verbatim,quote,fragment]
+c''2^"espr" a'_"legato"
@end lilypond
Extra formatting may be added with the @code{\markup} command:
-@lilypond[verbatim,quote,relative=2]
-c2^\markup { \bold espr }
-a2_\markup {
+@lilypond[verbatim,quote,fragment]
+c''2^\markup { \bold espr }
+a'2_\markup {
\dynamic f \italic \small { 2nd } \hspace #0.1 \dynamic p
}
@end lilypond
All @notation{beams} are drawn automatically:
-@lilypond[verbatim,quote,relative=2]
-a8 ais d ees r d c16 b a8
+@lilypond[verbatim,quote]
+\relative { a'8 ais d ees r d c16 b a8 }
@end lilypond
If you do not like the automatic beams, they may be overridden
manually. To correct just an occasional beam mark the first note
to be beamed with @code{[} and the last one with @code{]}.
-@lilypond[verbatim,quote,relative=2]
-a8[ ais] d[ ees r d] c16 b a8
+@lilypond[verbatim,quote]
+\relative { a'8[ ais] d[ ees r d] c16 b a8 }
@end lilypond
If you want to turn off automatic beaming entirely or for an
to turn off automatic beaming and @code{\autoBeamOn} to turn it
on again.
-@lilypond[verbatim,quote,relative=2]
-\autoBeamOff
-a8 c b4 d8. c16 b4 |
-\autoBeamOn
-a8 c b4 d8. c16 b4 |
+@lilypond[verbatim,quote]
+\relative {
+ \autoBeamOff
+ a'8 c b4 d8. c16 b4 |
+ \autoBeamOn
+ a8 c b4 d8. c16 b4 |
+}
@end lilypond
@code{\partial}. It is followed by a duration: @code{\partial 4}
is a quarter note pickup and @code{\partial 8} an eighth note.
-@lilypond[verbatim,quote,relative=2]
-\partial 8 f8 |
-c2 d |
+@lilypond[verbatim,quote]
+\relative {
+ \partial 8 f''8 |
+ c2 d |
+}
@end lilypond
@node Tuplets
For triplets, there are three notes instead of two, so
@notation{triplets} have 3/2 as their fraction.
-@lilypond[verbatim,quote,relative=2]
-\tuplet 3/2 { f8 g a }
-\tuplet 3/2 { c8 r c }
-\tuplet 3/2 { f,8 g16[ a g a] }
-\tuplet 3/2 { d4 a8 }
+@lilypond[verbatim,quote]
+\relative {
+ \tuplet 3/2 { f''8 g a }
+ \tuplet 3/2 { c8 r c }
+ \tuplet 3/2 { f,8 g16[ a g a] }
+ \tuplet 3/2 { d4 a8 }
+}
@end lilypond
@node Grace notes
although they can also be created by prefixing a music expression
with the keyword @code{\appoggiatura} or @code{\acciaccatura}:
-@lilypond[verbatim,quote,relative=2]
-c2 \grace { a32 b } c2 |
-c2 \appoggiatura b16 c2 |
-c2 \acciaccatura b16 c2 |
+@lilypond[verbatim,quote]
+\relative {
+ c''2 \grace { a32 b } c2 |
+ c2 \appoggiatura b16 c2 |
+ c2 \acciaccatura b16 c2 |
+}
@end lilypond
In LilyPond input files, music is represented by @emph{music
expressions}. A single note is a music expression:
-@lilypond[verbatim,quote,relative=2]
-a4
+@lilypond[verbatim,quote,fragment]
+a'4
@end lilypond
Enclosing a note in braces creates a @emph{compound music
expression}. Here we have created a compound music expression
with two notes:
-@lilypond[verbatim,quote,relative=2]
-{ a4 g4 }
+@lilypond[verbatim,quote]
+\relative { a'4 g4 }
@end lilypond
Putting a group of music expressions (e.g. notes) in braces means
that they are in sequence (i.e. each one follows the previous
one). The result is another music expression:
-@lilypond[verbatim,quote,relative=2]
-{ { a4 g } f4 g }
+@lilypond[verbatim,quote]
+\relative { { a'4 g } f4 g }
@end lilypond
@node Analogy mathematical expressions
notes) are combined simultaneously:
@lilypond[verbatim,quote]
-\relative {
- <<
- { a'2 g }
- { f2 e }
- { d2 b }
- >>
-}
+<<
+ \relative { a'2 g }
+ \relative { f'2 e }
+ \relative { d'2 b }
+>>
@end lilypond
Note that we have indented each level of the input with a
and @code{>>}:
@lilypond[verbatim,quote]
-\relative {
- <<
- \new Staff { \clef "treble" c''4 }
- \new Staff { \clef "bass" c,,4 }
- >>
-}
+<<
+ \new Staff { \clef "treble" c''4 }
+ \new Staff { \clef "bass" c4 }
+>>
@end lilypond
The command @code{\new} introduces a @q{notation context.} A
than polyrhythmic scores.
@lilypond[verbatim,quote]
-\relative {
- <<
- \new Staff { \clef "treble" \key d \major \time 3/4 c''4 }
- \new Staff { \clef "bass" c,,4 }
- >>
-}
+<<
+ \new Staff { \clef "treble" \key d \major \time 3/4 c''4 }
+ \new Staff { \clef "bass" c4 }
+>>
@end lilypond
@node Staff groups
Here is a small example:
@lilypond[verbatim,quote]
-\relative {
- \new PianoStaff <<
- \new Staff { \time 2/4 c''4 e | g g, | }
- \new Staff { \clef "bass" c,,4 c' | e c | }
- >>
-}
+\new PianoStaff <<
+ \new Staff \relative { \time 2/4 c''4 e | g g, | }
+ \new Staff \relative { \clef "bass" c4 c' | e c | }
+>>
@end lilypond
Other staff groupings are introduced with @code{\new GrandStaff},
all the notes in a chord must have the same duration, and that the
duration is placed after the closing bracket.
-@lilypond[verbatim,quote,relative=2]
-r4 <c e g> <c f a>2
+@lilypond[verbatim,quote]
+\relative { r4 <c'' e g> <c f a>2 }
@end lilypond
Think of chords as almost equivalent to single notes:
brackets. For example, you can combine markings like beams and
ties with chords. They must be placed outside the angle brackets.
-@lilypond[verbatim,quote,relative=2]
-r4 <c e g>~ <c f a>2 |
-<c e g>8[ <c f a> <c e g> <c f a>]
- <c e g>8\>[ <c f a> <c f a> <c e g>]\! |
-r4 <c e g>8.\p <c f a>16( <c e g>4-. <c f a>) |
+@lilypond[verbatim,quote]
+\relative {
+ r4 <c'' e g>~ <c f a>2 |
+ <c e g>8[ <c f a> <c e g> <c f a>]
+ <c e g>8\>[ <c f a> <c f a> <c e g>]\! |
+ r4 <c e g>8.\p <c f a>16( <c e g>4-. <c f a>) |
+}
@end lilypond
@seealso
}
@end lilypond
-Here is a four-octave scale:
-
-@lilypond[verbatim,quote]
-{
- \clef "bass"
- c,4 d, e, f, |
- g,4 a, b, c |
- d4 e f g |
- a4 b c' d' |
- \clef "treble"
- e'4 f' g' a' |
- b'4 c'' d'' e'' |
- f''4 g'' a'' b'' |
- c'''1 |
-}
-@end lilypond
-
-As you can see, writing a melody in the treble clef involves a lot
+Writing a melody in the treble clef involves a lot
of quote @code{'} marks. Consider this fragment from Mozart:
@lilypond[verbatim,quote]
inserted beam and end before the end of the beam -- not very
musical, perhaps, but possible:
-@lilypond[quote,verbatim,ragged-right,relative=2]
-g8\( a b[ c b\) a] g4
+@lilypond[quote,verbatim,ragged-right]
+\relative { g'8\( a b[ c b\) a] g4 }
@end lilypond
In general, different kinds of brackets, bracket-like constructs,
extending into a tuplet, a tie crossing two tuplets, and a
phrasing slur extending out of a tuplet (lines 3 and 4).
-@lilypond[quote,verbatim,ragged-right,relative=1]
-r16[ g \tuplet 3/2 { r16 e'8] }
-g,16( a \tuplet 3/2 { b16 d) e }
-g,8[( a \tuplet 3/2 { b8 d) e~] } |
-\tuplet 5/4 { e32\( a, b d e } a4.\)
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ r16[ g' \tuplet 3/2 { r16 e'8] }
+ g,16( a \tuplet 3/2 { b16 d) e }
+ g,8[( a \tuplet 3/2 { b8 d) e~] } |
+ \tuplet 5/4 { e32\( a, b d e } a4.\)
+}
@end lilypond
so when exactly are multiple voices needed? Look first at
this example of four chords:
-@lilypond[quote,verbatim,ragged-right,relative=1]
-\key g \major
-<d g>4 <d fis> <d a'> <d g>
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ <d' g>4 <d fis> <d a'> <d g>
+}
@end lilypond
This can be expressed using just the single angle bracket chord
Here's how we split the chords above into two voices and add both
the passing note and a slur:
-@lilypond[quote,verbatim,ragged-right,relative=2]
-\key g \major
-% Voice "1" Voice "2"
-<< { g4 fis8( g) a4 g } \\ { d4 d d d } >>
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ % Voice "1" Voice "2"
+ << { g'4 fis8( g) a4 g } \\ { d4 d d d } >>
+}
@end lilypond
Notice how the stems of the second voice now point down.
Here's another simple example:
-@lilypond[quote,verbatim,ragged-right,relative=2]
-\key d \minor
-% Voice "1" Voice "2"
-<< { r4 g g4. a8 } \\ { d,2 d4 g } >> |
-<< { bes4 bes c bes } \\ { g4 g g8( a) g4 } >> |
-<< { a2. r4 } \\ { fis2. s4 } >> |
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key d \minor
+ % Voice "1" Voice "2"
+ << { r4 g' g4. a8 } \\ { d,2 d4 g } >> |
+ << { bes4 bes c bes } \\ { g4 g g8( a) g4 } >> |
+ << { a2. r4 } \\ { fis2. s4 } >> |
+}
@end lilypond
It is not necessary to use a separate @code{<< \\ >>} construct
notes in each bar it may be better to split out each voice
separately, like this:
-@lilypond[quote,verbatim,ragged-right,relative=2]
-\key d \minor
-<< {
- % Voice "1"
- r4 g g4. a8 |
- bes4 bes c bes |
- a2. r4 |
-} \\ {
- % Voice "2"
- d,2 d4 g |
- g4 g g8( a) g4 |
- fis2. s4 |
-} >>
+@lilypond[quote,verbatim,ragged-right]
+<<
+ \key d \minor
+ \relative { % Voice "1"
+ r4 g' g4. a8 |
+ bes4 bes c bes |
+ a2. r4 |
+ } \\
+ \relative { % Voice "2"
+ d'2 d4 g |
+ g4 g g8( a) g4 |
+ fis2. s4 |
+ }
+>>
@end lilypond
output. For example, compare the input and output of the
following example:
-@lilypond[quote,verbatim,relative=2]
-cis4 cis2. | a4 a2. |
+@lilypond[quote,verbatim]
+\relative { cis''4 cis2. | a4 a2. | }
@end lilypond
The input is rather sparse, but in the output, bar lines,
other things) several times. The change is from the default
value, not the most recently set value.
-@lilypond[quote,verbatim,ragged-right,relative=1]
-c4 d
-% make note heads smaller
-\set fontSize = #-4
-e4 f |
-% make note heads larger
-\set fontSize = #2.5
-g4 a
-% return to default size
-\unset fontSize
-b4 c |
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ c'4 d
+ % make note heads smaller
+ \set fontSize = #-4
+ e4 f |
+ % make note heads larger
+ \set fontSize = #2.5
+ g4 a
+ % return to default size
+ \unset fontSize
+ b4 c |
+}
@end lilypond
We have now seen how to set the values of several different types of
LilyPond input must be surrounded by @code{@{ @}} marks or a
@q{@w{@code{@bs{}relative @{ @dots{} @}}}}, as we saw in
-@ref{Working on input files}. For the rest of this manual, most
-examples will omit this. To replicate the examples, you may copy
-and paste the displayed input, but to put the pitches in the same
-octaves as seen in the manual you @strong{must} add a particular
-form of @code{@bs{}relative} with an explicit starting pitch
-@code{c''} like this:
+@ref{Working on input files}. For the rest of this manual,
+some short examples will omit this. To replicate these examples,
+you can copy displayed input, but paste it between @code{@{}
+and @code{@}} in your input file.
@example
-\relative c'' @{
+@{
@dots{}example goes here@dots{}
@}
@end example
@cindex color property, example
@cindex NoteHead, example of overriding
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-c4 d
-\override NoteHead.color = #red
-e4 f |
-\override NoteHead.color = #green
-g4 a b c |
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ c'4 d
+ \override NoteHead.color = #red
+ e4 f |
+ \override NoteHead.color = #green
+ g4 a b c |
+}
@end lilypond
@cindex color property, example
@cindex NoteHead, example of overriding
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-c4 d
-\override NoteHead.color = #red
-e4 f |
-\override NoteHead.color = #green
-g4 a
-\revert NoteHead.color
-b4 c |
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ c'4 d
+ \override NoteHead.color = #red
+ e4 f |
+ \override NoteHead.color = #green
+ g4 a
+ \revert NoteHead.color
+ b4 c |
+}
@end lilypond
@cindex color property, example
@cindex NoteHead, example of overriding
-@lilypond[quote,verbatim,relative=1]
-c4 d
-\override NoteHead.color = #red
-e4 f |
-\once \override NoteHead.color = #green
-g4 a
-\revert NoteHead.color
-b c |
+@lilypond[quote,verbatim]
+\relative {
+ c'4 d
+ \override NoteHead.color = #red
+ e4 f |
+ \once \override NoteHead.color = #green
+ g4 a
+ \revert NoteHead.color
+ b c |
+}
@end lilypond
The @code{\once} prefix may also be used in front of many
predefined commands to limit their effect to one musical moment:
-@lilypond[quote,verbatim,relative=1]
-c4( d)
-\once \slurDashed
-e4( f) |
-g4( a)
-\once \hideNotes
-b( c) |
+@lilypond[quote,verbatim]
+\relative {
+ c'4( d)
+ \once \slurDashed
+ e4( f) |
+ g4( a)
+ \once \hideNotes
+ b( c) |
+}
@end lilypond
However, predefined commands of the form @code{\@dots{}Neutral},
@cindex font-size property, example
@cindex NoteHead, example of overriding
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-<c e g>4
-\once \override NoteHead.font-size = #-3
-<c e g>4
-<c e g>4
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ <c' e g>4
+ \once \override NoteHead.font-size = #-3
+ <c e g>4
+ <c e g>4
+}
@end lilypond
We see the override affects @emph{all} the note heads in the chord.
@cindex font-size property, example
@cindex @code{\tweak}, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-<c e g>4
-<c \tweak font-size #-3 e g>4
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ <c' e g>4
+ <c \tweak font-size #-3 e g>4
+}
@end lilypond
Note that the syntax of @code{\tweak} is different from that of the
@cindex color property, example
@cindex @code{\tweak}, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-a4^"Black"
+@lilypond[quote,fragment,ragged-right,verbatim]
+a'4^"Black"
-\tweak color #red ^"Red"
-\tweak color #green _"Green"
@end lilypond
the layout object, provided that LilyPond can trace its origin back to
the original event:
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-<\tweak Accidental.color #red cis4
- \tweak Accidental.color #green es
- g>
+@lilypond[quote,fragment,ragged-right,verbatim]
+<\tweak Accidental.color #red cis''4
+ \tweak Accidental.color #green es''
+ g''>
@end lilypond
This long form of the @code{\tweak} command can be described as
@cindex direction property, example
@cindex color property, example
-@lilypond[quote,ragged-right,verbatim,fragment,relative=2]
-\tweak direction #up
-\tuplet 3/4 {
- \tweak color #red
- \tuplet 3/2 { c8[ c c] }
- \tuplet 3/2 { c8[ c c] }
- \tuplet 3/2 { c8[ c c] }
+@lilypond[quote,ragged-right,verbatim]
+\relative c'' {
+ \tweak direction #up
+ \tuplet 3/4 {
+ \tweak color #red
+ \tuplet 3/2 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
+ }
}
@end lilypond
@cindex transparent property, example
@cindex TupletNumber, example of overriding
-@lilypond[quote,ragged-right,verbatim,fragment,relative=1]
-\tuplet 3/2 { c8[ c c] }
-\once \override TupletNumber.text = #tuplet-number::calc-fraction-text
-\tuplet 3/2 {
- c8[ c]
- c8[ c]
- \once \override TupletNumber.transparent = ##t
- \tuplet 3/2 { c8[ c c] }
- \tuplet 3/2 { c8[ c c] }
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ \tuplet 3/2 { c'8[ c c] }
+ \once \override TupletNumber.text = #tuplet-number::calc-fraction-text
+ \tuplet 3/2 {
+ c8[ c]
+ c8[ c]
+ \once \override TupletNumber.transparent = ##t
+ \tuplet 3/2 { c8[ c c] }
+ \tuplet 3/2 { c8[ c c] }
+ }
}
@end lilypond
@c Mozart, Die Zauberflöte Nr.7 Duett
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
{
\key es \major
\time 6/8
- {
- r4 bes8 bes[( g]) g |
+ \relative {
+ r4 bes'8 bes[( g]) g |
g8[( es]) es d[( f]) as |
as8 g
}
@cindex Slur example of overriding
@cindex thickness property, example
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
{
\key es \major
\time 6/8
- {
+ \relative {
% Increase thickness of all following slurs from 1.2 to 5.0
\override Slur.thickness = #5.0
- r4 bes8 bes[( g]) g |
+ r4 bes'8 bes[( g]) g |
g8[( es]) es d[( f]) as |
as8 g
}
@cindex Slur, example of overriding
@cindex thickness property, example
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
{
\key es \major
\time 6/8
- {
- r4 bes8
+ \relative {
+ r4 bes'8
% Increase thickness of immediately following slur only
\once \override Slur.thickness = #5.0
bes8[( g]) g |
@cindex Slur, example of overriding
@cindex thickness property, example
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
{
\key es \major
\time 6/8
- {
- r4 bes8
+ \relative {
+ r4 bes'8
% Increase thickness of immediately following slur only
\once \override Slur.thickness = #5.0
bes[( g]) g |
@cindex Slur, example of overriding
@cindex thickness property, example
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
{
\key es \major
\time 6/8
- {
- r4 bes8
+ \relative {
+ r4 bes'8
% Increase thickness of all following slurs from 1.2 to 5.0
\override Slur.thickness = #5.0
bes[( g]) g |
@cindex LyricText, example of overriding
@cindex @code{\addlyrics}, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
{
\key es \major
\time 6/8
- {
- r4 bes8 bes[( g]) g |
+ \relative {
+ r4 bes'8 bes[( g]) g |
g8[( es]) es d[( f]) as |
as8 g
}
@cindex BarLine, example of overriding
@cindex stencil property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override BarLine.stencil = ##f
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex BarLine, example of overriding
@cindex stencil property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.BarLine.stencil = ##f
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
shorthand for it called @code{\omit}:
@funindex \omit
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\omit Staff.BarLine
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@code{point-stencil} function, which sets the stencil to an object
with zero size:
-@lilypond[quote,verbatim,relative=2]
-{
- c4 c
+@lilypond[quote,verbatim]
+\relative {
+ c''4 c
\once \override NoteHead.stencil = #point-stencil
c4 c
}
@cindex BarLine, example of overriding
@cindex break-visibility property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.BarLine.break-visibility = ##(#f #f #f)
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex TimeSignature, example of overriding
@cindex transparent property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.TimeSignature.transparent = ##t
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@code{\hide}:
@funindex \hide
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\hide Staff.TimeSignature
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex TimeSignature, example of overriding
@cindex stencil property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\omit Staff.TimeSignature
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex BarLine, example of overriding
@cindex color property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.BarLine.color = #white
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex BarLine, example of overriding
@cindex color property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.BarLine.color = #(x11-color 'white)
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex BarLine, example of overriding
@cindex color property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.BarLine.color = #(rgb-color 1 1 1)
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex color property, example
@cindex x11-color, example of using
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-{
+@lilypond[quote,ragged-right,verbatim]
+\relative {
\time 12/16
\override Staff.StaffSymbol.color = #(x11-color 'grey30)
\override Staff.TimeSignature.color = #(x11-color 'grey60)
\override Voice.NoteHead.color = #(x11-color 'grey85)
\override Voice.Stem.color = #(x11-color 'grey85)
\override Staff.BarLine.color = #(x11-color 'grey10)
- c4 b8 c d16 c d8 |
+ c''4 b8 c d16 c d8 |
g,8 a16 b8 c d4 e16 |
e8
}
@cindex alignAboveContext property, example
@cindex @code{\with}, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\new Staff ="main" {
\relative {
r4 g'8 g c4 c8 d |
@cindex Clef, example of overriding
@cindex TimeSignature, example of overriding
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\new Staff ="main" {
\relative {
r4 g'8 g c4 c8 d |
@cindex Clef, example of overriding
@cindex TimeSignature, example of overriding
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\new Staff ="main" {
\relative {
r4 g'8 g c4 c8 d |
and @code{\omit} for setting the @code{transparent} property and
clearing the @code{stencil} here, leading to the result
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\new Staff ="main" {
\relative {
r4 g'8 g c4 c8 d |
@cindex TimeSignature, example of overriding
@cindex fontSize property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\new Staff ="main" {
\relative {
r4 g'8 g c4 c8 d |
@cindex staff-space property, example
@cindex stencil property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
\new Staff ="main" {
\relative {
r4 g'8 g c4 c8 d |
@cindex markup example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-c2^"Text1"
-c2^"Text2" |
-c2^"Text3"
-c2^"Text4" |
+@lilypond[quote,fragment,ragged-right,verbatim]
+c''2^"Text1"
+c''2^"Text2" |
+c''2^"Text3"
+c''2^"Text4" |
@end lilypond
Staves are also positioned, by default, as closely together as
@cindex Slur, example of overriding
@cindex direction property, example
-@lilypond[quote,verbatim,relative=2]
-a4( g) c( a) |
+@lilypond[quote,fragment,verbatim]
+a'4( g') c''( a') |
\override Slur.direction = #DOWN
-a4( g) c( a) |
+a'4( g') c''( a') |
\override Slur.direction = #UP
-a4( g) c( a) |
+a'4( g') c''( a') |
\revert Slur.direction
-a4( g) c( a) |
+a'4( g') c''( a') |
@end lilypond
Here we have used the constants @code{DOWN} and @code{UP}.
Or, if just a single layout object needs to be forced up or down, the
direction indicators, @code{^} or @code{_}, may be used:
-@lilypond[quote,verbatim,relative=2]
-a4( g) c( a) |
-a4^( g) c_( a) |
+@lilypond[quote,fragment,verbatim]
+a'4( g') c''( a') |
+a'4^( g') c''_( a') |
@end lilypond
@node Fingering
@cindex Fingering, example of overriding
@cindex direction property, example
-@lilypond[quote,verbatim,relative=2]
-c4-5 a-3 f-1 c'-5 |
-\override Fingering.direction = #DOWN
-c4-5 a-3 f-1 c'-5 |
-\override Fingering.direction = #UP
-c4-5 a-3 f-1 c'-5 |
+@lilypond[quote,verbatim]
+\relative {
+ c''4-5 a-3 f-1 c'-5 |
+ \override Fingering.direction = #DOWN
+ c4-5 a-3 f-1 c'-5 |
+ \override Fingering.direction = #UP
+ c4-5 a-3 f-1 c'-5 |
+}
@end lilypond
However, overriding the @code{direction} property is not the
@cindex fingering example
-@lilypond[quote,verbatim,relative=2]
-c4-5 a-3 f-1 c'-5 |
-c4_5 a_3 f_1 c'_5 |
-c4^5 a^3 f^1 c'^5 |
+@lilypond[quote,verbatim]
+\relative {
+ c''4-5 a-3 f-1 c'-5 |
+ c4_5 a_3 f_1 c'_5 |
+ c4^5 a^3 f^1 c'^5 |
+}
@end lilypond
The @code{direction} property is ignored for chords, but the
@cindex fingering example
-@lilypond[quote,verbatim,relative=2]
-<c-5 g-3>4
-<c-5 g-3 e-2>4
-<c-5 g-3 e-2 c-1>4
+@lilypond[quote,verbatim]
+\relative {
+ <c''-5 g-3>4
+ <c-5 g-3 e-2>4
+ <c-5 g-3 e-2 c-1>4
+}
@end lilypond
@noindent
@cindex fingering example
-@lilypond[quote,verbatim,relative=2]
-<c-5 g-3 e-2 c-1>4
-<c^5 g_3 e_2 c_1>4
-<c^5 g^3 e^2 c_1>4
+@lilypond[quote,verbatim]
+\relative {
+ <c''-5 g-3 e-2 c-1>4
+ <c^5 g_3 e_2 c_1>4
+ <c^5 g^3 e^2 c_1>4
+}
@end lilypond
Even greater control over the placement of fingering of the
@cindex @code{\set}, example of using
@cindex fingeringOrientations property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-\set fingeringOrientations = #'(left)
-<f-2>4
-<c-1 e-2 g-3 b-5>4
-\set fingeringOrientations = #'(left)
-<f-2>4
-<c-1 e-2 g-3 b-5>4 |
-\set fingeringOrientations = #'(up left down)
-<f-2>4
-<c-1 e-2 g-3 b-5>4
-\set fingeringOrientations = #'(up left)
-<f-2>4
-<c-1 e-2 g-3 b-5>4 |
-\set fingeringOrientations = #'(right)
-<f-2>4
-<c-1 e-2 g-3 b-5>4
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ \set fingeringOrientations = #'(left)
+ <f'-2>4
+ <c-1 e-2 g-3 b-5>4
+ \set fingeringOrientations = #'(left)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4 |
+ \set fingeringOrientations = #'(up left down)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4
+ \set fingeringOrientations = #'(up left)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4 |
+ \set fingeringOrientations = #'(right)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4
+}
@end lilypond
@noindent
@code{Fingering} object in the IR to be @w{@code{-5}}, so let's
try @w{@code{-7}}:
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-\override Fingering.font-size = #-7
-\set fingeringOrientations = #'(left)
-<f-2>4
-<c-1 e-2 g-3 b-5>4
-\set fingeringOrientations = #'(left)
-<f-2>4
-<c-1 e-2 g-3 b-5>4 |
-\set fingeringOrientations = #'(up left down)
-<f-2>4
-<c-1 e-2 g-3 b-5>4
-\set fingeringOrientations = #'(up left)
-<f-2>4
-<c-1 e-2 g-3 b-5>4 |
-\set fingeringOrientations = #'(right)
-<f-2>4
-<c-1 e-2 g-3 b-5>4
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ \override Fingering.font-size = #-7
+ \set fingeringOrientations = #'(left)
+ <f'-2>4
+ <c-1 e-2 g-3 b-5>4
+ \set fingeringOrientations = #'(left)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4 |
+ \set fingeringOrientations = #'(up left down)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4
+ \set fingeringOrientations = #'(up left)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4 |
+ \set fingeringOrientations = #'(right)
+ <f-2>4
+ <c-1 e-2 g-3 b-5>4
+}
@end lilypond
@node Outside-staff objects
@cindex TextSpanner, example of overriding
@cindex bound-details property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
+@lilypond[quote,fragment,ragged-right,verbatim]
% Set details for later Text Spanner
\override TextSpanner.bound-details.left.text
= \markup { \small \bold Slower }
\dynamicUp
% Start Ottava Bracket
\ottava #1
-c'4 \startTextSpan
+c''4 \startTextSpan
% Add Dynamic Text and hairpin
-c4\pp\<
-c4
+c''4\pp\<
+c''4
% Add Text Script
-c4^Text |
-c4 c
+c''4^Text |
+c''4 c''
% Add Dynamic Text and terminate hairpin
-c4\ff c \stopTextSpan |
+c''4\ff c'' \stopTextSpan |
% Stop Ottava Bracket
\ottava #0
-c,4 c c c |
+c'4 c' c' c' |
@end lilypond
This example also shows how to create Text Spanners --
@cindex TextSpanner, example of overriding
@cindex bound-details property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
+@lilypond[quote,fragment,ragged-right,verbatim]
% Set details for later Text Spanner
\override TextSpanner.bound-details.left.text
= \markup { \small \bold Slower }
\once \override Staff.OttavaBracket.outside-staff-priority = #340
% Start Ottava Bracket
\ottava #1
-c'4 \startTextSpan
+c''4 \startTextSpan
% Add Dynamic Text
-c4\pp
+c''4\pp
% Add Dynamic Line Spanner
-c4\<
+c''4\<
% Add Text Script
-c4^Text |
-c4 c
+c''4^Text |
+c''4 c''
% Add Dynamic Text
-c4\ff c \stopTextSpan |
+c''4\ff c'' \stopTextSpan |
% Stop Ottava Bracket
\ottava #0
-c,4 c c c |
+c'4 c' c' c' |
@end lilypond
Note that some of these objects, in particular bar numbers,
other outside-staff objects according to that value. Here's an
example showing the effect of the two methods:
-@lilypond[quote,verbatim,relative=2]
-c4( c^\markup { \tiny \sharp } d4.) c8 |
-c4(
-\once \override TextScript.avoid-slur = #'inside
-\once \override TextScript.outside-staff-priority = ##f
-c4^\markup { \tiny \sharp } d4.) c8 |
-\once \override Slur.outside-staff-priority = #500
-c4( c^\markup { \tiny \sharp } d4.) c8 |
+@lilypond[quote,verbatim]
+\relative c'' {
+ c4( c^\markup { \tiny \sharp } d4.) c8 |
+ c4(
+ \once \override TextScript.avoid-slur = #'inside
+ \once \override TextScript.outside-staff-priority = ##f
+ c4^\markup { \tiny \sharp } d4.) c8 |
+ \once \override Slur.outside-staff-priority = #500
+ c4( c^\markup { \tiny \sharp } d4.) c8 |
+}
@end lilypond
Changing the @code{outside-staff-priority} can also be used to
@cindex TextScript, example of overriding
@cindex outside-staff-priority property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-c2^"Text1"
-c2^"Text2" |
+@lilypond[quote,fragment,ragged-right,verbatim]
+c''2^"Text1"
+c''2^"Text2" |
\once \override TextScript.outside-staff-priority = #500
-c2^"Text3"
-c2^"Text4" |
+c''2^"Text3"
+c''2^"Text4" |
@end lilypond
This certainly lifts @qq{Text3} above @qq{Text4} but it also lifts it
command reverses this behavior, causing the notes to be spaced
out as far as is necessary to accommodate the text:
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,fragment,ragged-right,verbatim]
\textLengthOn % Cause notes to space out to accommodate text
-c2^"Text1"
-c2^"Text2" |
-c2^"Text3"
-c2^"Text4" |
+c''2^"Text1"
+c''2^"Text2" |
+c''2^"Text3"
+c''2^"Text4" |
@end lilypond
The command to revert to the default behavior is
@cindex TextScript, example of overriding
@cindex outside-staff-priority property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
-% This markup is short enough to fit without collision
-c2^"Tex" c'' |
-R1 |
-
-% This is too long to fit, so it is displaced upwards
-c,,2^"Text" c'' |
-R1 |
-
-% Turn off collision avoidance
-\once \override TextScript.outside-staff-priority = ##f
-c,,2^"Long Text " c'' |
-R1 |
-
-% Turn off collision avoidance
-\once \override TextScript.outside-staff-priority = ##f
-\textLengthOn % and turn on textLengthOn
-c,,2^"Long Text " % Spaces at end are honored
-c''2 |
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ % This markup is short enough to fit without collision
+ c''2^"Tex" c'' |
+ R1 |
+
+ % This is too long to fit, so it is displaced upwards
+ c,,2^"Text" c'' |
+ R1 |
+
+ % Turn off collision avoidance
+ \once \override TextScript.outside-staff-priority = ##f
+ c,,2^"Long Text " c'' |
+ R1 |
+
+ % Turn off collision avoidance
+ \once \override TextScript.outside-staff-priority = ##f
+ \textLengthOn % and turn on textLengthOn
+ c,,2^"Long Text " % Spaces at end are honored
+ c''2 |
+}
@end lilypond
@node Dynamics placement
This can give quite acceptable results, as this example
shows:
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-\clef "bass"
-\key aes \major
-\time 9/8
-\dynamicUp
-bes4.~\f\< \( bes4 bes8 des4\ff\> c16 bes\! |
-ees,2.~\)\mf ees4 r8 |
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ \clef "bass"
+ \key aes \major
+ \time 9/8
+ \dynamicUp
+ bes4.~\f\< \( bes4 bes8 des4\ff\> c16 bes\! |
+ ees,2.~\)\mf ees4 r8 |
+}
@end lilypond
However, if the notes and attached dynamics are close
not be the optimum placement, as this rather artificial example
shows:
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim,fragment]
\dynamicUp
-a4\f b\mf a\mp b\p
+\relative { a'4\f b\mf a\mp b\p }
@end lilypond
@noindent
@cindex extra-spacing-width property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim,fragment]
\dynamicUp
% Extend width by 1 staff space
\override DynamicText.extra-spacing-width = #'(-0.5 . 0.5)
-a4\f b\mf a\mp b\p
+\relative { a'4\f b\mf a\mp b\p }
@end lilypond
@noindent
@cindex Script, example of overriding
@cindex padding property, example
-@lilypond[quote,fragment,relative=1,verbatim]
-c2\fermata
+@lilypond[quote,fragment,verbatim]
+c'2\fermata
\override Script.padding = #3
b2\fermata
@end lilypond
@cindex MetronomeMark, example of overriding
@cindex padding property, example
-@lilypond[quote,fragment,relative=1,verbatim]
+@lilypond[quote,fragment,verbatim]
% This will not work, see below
\override MetronomeMark.padding = #3
\tempo 4 = 120
-c1 |
+c'1 |
% This works
\override Score.MetronomeMark.padding = #3
\tempo 4 = 80
-d1 |
+d'1 |
@end lilypond
Note in the second example how important it is to figure out what
@cindex DynamicLineSpanner, example of overriding
@cindex staff-padding property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+@lilypond[quote,fragment,ragged-right,verbatim]
\override DynamicLineSpanner.staff-padding = #3
-a4\f b\mf a\p b\mp
+\relative { a'4\f b\mf a\p b\mp }
@end lilypond
@cindex StringNumber, example of overriding
@cindex self-alignment-X property, example
-@lilypond[quote,fragment,ragged-right,verbatim,relative=3]
+@lilypond[quote,fragment,ragged-right,verbatim]
\voiceOne
-<a\2>
+<a''\2>
\once \override StringNumber.self-alignment-X = #RIGHT
-<a\2>
+<a''\2>
@end lilypond
@node The staff-position property
for notes and rests that occur at the same time. Here's an
example of a collision of this type:
-@lilypond[quote,verbatim,fragment,ragged-right, relative=1]
-<< { c4 c c c } \\ { R1 } >>
+@lilypond[quote,verbatim,ragged-right]
+<< \relative { c'4 c c c } \\ { R1 } >>
@end lilypond
The best solution here is to move the multimeasure rest down, since the
@cindex MultiMeasureRest, example of overriding
@cindex staff-position property, example
-@lilypond[quote,verbatim,fragment,ragged-right, relative=1]
+@lilypond[quote,verbatim,ragged-right]
<<
- { c4 c c c }
+ \relative { c'4 c c c }
\\
\override MultiMeasureRest.staff-position = #-8
{ R1 }
@cindex Fingering, example of overriding
@cindex extra-offset property, example
-@lilypond[quote,relative=1,verbatim]
-f4-5
+@lilypond[quote,fragment,verbatim]
+f'4-5
\once \override Fingering.extra-offset = #'(-0.3 . -1.8)
-f4-5
+f'4-5
@end lilypond
Here's an example in which the phrasing slur and slur collide:
-@lilypond[quote,verbatim,fragment,ragged-right,relative=2]
-a8 \( ( a'16 ) a \)
+@lilypond[quote,verbatim,ragged-right]
+\relative { a'8 \( ( a'16 ) a \) }
@end lilypond
@cindex PhrasingSlur, example of overriding
select the phrasing slur from the candidates it has found with its
end points closest to these:
-@lilypond[quote,verbatim,fragment,ragged-right,relative=2]
+@lilypond[quote,verbatim,fragment,ragged-right]
\once \override PhrasingSlur.positions = #'(2.5 . 4.5)
-a8 \( ( a'16 ) a \)
+a'8 \( ( a''16 ) a'' \)
@end lilypond
This is an improvement, but why not lower the right end of the slur
Here's a further example. We see that the beams
collide with the ties:
-@lilypond[quote,verbatim,fragment,ragged-right,relative=1]
+@lilypond[quote,verbatim,ragged-right]
{
\time 4/2
<<
- { c1~ 2. e8 f }
+ \relative { c'1~ 2. e8 f }
\\
- {
- e'8 e e e
+ \relative {
+ e''8 e e e
e e e e
f2 g
}
>>
<<
- { c,,1~ 2. e8 f }
+ \relative { c'1~ 2. e8 f }
\\
- {
- e'8 e e e
+ \relative {
+ e''8 e e e
e e e e
f2 g
}
@cindex Beam, example of overriding
@cindex positions property, example
-@lilypond[quote,verbatim,ragged-right,relative=1]
+@lilypond[quote,verbatim,ragged-right]
{
\time 4/2
<<
- { c1~ 2. e8 f }
+ \relative { c'1~ 2. e8 f }
\\
- {
+ \relative {
\override Beam.positions = #'(-1 . -1)
- e'8 e e e
+ e''8 e e e
e e e e
f2 g
}
>>
<<
- { c,,1~ 2. e8 f }
+ \relative { c'1~ 2. e8 f }
\\
- {
- e'8 e e e
+ \relative {
+ e''8 e e e
e e e e
f2 g
\revert Beam.positions
connected with ties. By using two voices, with the tied notes in one
of them
-@lilypond[quote,fragment,relative=2]
-<< { b8~ 8\noBeam } \\ { b8[ g] } >>
+@lilypond[quote]
+<< { b'8~ 8\noBeam } \\ { b'8[ g'] } >>
@end lilypond
@noindent
@cindex @code{\omit}, example
@cindex example of @code{\omit}
-@lilypond[quote,fragment,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
{
\once \omit Stem
\once \omit Flag
- b8~ 8\noBeam
+ b'8~ 8\noBeam
}
\\
- { b8[ g] }
+ { b'8[ g'] }
>>
@end lilypond
@code{mensural-c3}, @code{mensural-c4},@*
@code{mensural-c5}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "mensural-c2"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@item
@tab
@code{mensural-f}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "mensural-f"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@item
@tab
@code{mensural-g}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "mensural-g"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@item
@code{blackmensural-c3}, @code{blackmensural-c4},@*
@code{blackmensural-c5}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "blackmensural-c2"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@item
@code{neomensural-c1}, @code{neomensural-c2},@*
@code{neomensural-c3}, @code{neomensural-c4}
@tab
-@lilypond[relative=1,notime]
- \clef "neomensural-c2" c1
+@lilypond[fragment,notime]
+ \clef "neomensural-c2" c'1
@end lilypond
@item
@code{petrucci-c3}, @code{petrucci-c4},@*
@code{petrucci-c5}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "petrucci-c2"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@item
@code{petrucci-f3}, @code{petrucci-f4},@*
@code{petrucci-f5}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "petrucci-f3"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@item
@tab
@code{petrucci-g}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\clef "petrucci-g"
\override NoteHead.style = #'mensural
- c1
+ c'1
@end lilypond
@end multitable
@code{neomensural} style. The following examples show the
differences in style:
-@lilypond[ragged-right,relative=1,quote]
-{
+@lilypond[ragged-right,quote]
+\relative c' {
\textLengthOn
\time 2/2
select ancient flags. Besides the @code{default} flag style,
only the @code{mensural} style is supported.
-@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-\override Flag.style = #'mensural
-\override Stem.thickness = #1.0
-\override NoteHead.style = #'mensural
-\autoBeamOff
-c8 d e f c16 d e f c32 d e f s8
-c'8 d e f c16 d e f c32 d e f
+@lilypond[quote,fragment,ragged-right,verbatim]
+\relative c' {
+ \override Flag.style = #'mensural
+ \override Stem.thickness = #1.0
+ \override NoteHead.style = #'mensural
+ \autoBeamOff
+ c8 d e f c16 d e f c32 d e f s8
+ c'8 d e f c16 d e f c32 d e f
+}
@end lilypond
Note that the innermost flare of each mensural flag is
@funindex suggestAccidentals
-@lilypond[verbatim,relative=1]
-fis gis
-\set suggestAccidentals = ##t
-ais bis
+@lilypond[verbatim]
+\relative {
+ fis' gis
+ \set suggestAccidentals = ##t
+ ais bis
+}
@end lilypond
This will treat @emph{every} subsequent accidental as
@code{vaticana-do1}, @code{vaticana-do2},@*
@code{vaticana-do3}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.line-count = #4
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'vaticana.punctum
\clef "vaticana-do2"
- c
+ c'
@end lilypond
@item
@tab
@code{vaticana-fa1}, @code{vaticana-fa2}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.line-count = #4
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'vaticana.punctum
\clef "vaticana-fa2"
- c
+ c'
@end lilypond
@item
@code{medicaea-do1}, @code{medicaea-do2},@*
@code{medicaea-do3}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.line-count = #4
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'medicaea.punctum
\clef "medicaea-do2"
- c
+ c'
@end lilypond
@item
@tab
@code{medicaea-fa1}, @code{medicaea-fa2}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.line-count = #4
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'medicaea.punctum
\clef "medicaea-fa2"
- c
+ c'
@end lilypond
@item
@code{hufnagel-do1}, @code{hufnagel-do2},@*
@code{hufnagel-do3}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.line-count = #4
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'hufnagel.punctum
\clef "hufnagel-do2"
- c
+ c'
@end lilypond
@item
@tab
@code{hufnagel-fa1}, @code{hufnagel-fa2}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.line-count = #4
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'hufnagel.punctum
\clef "hufnagel-fa2"
- c
+ c'
@end lilypond
@item
@tab
@code{hufnagel-do-fa}
@tab
-@lilypond[relative=1,notime]
+@lilypond[fragment,notime]
\override Staff.StaffSymbol.color = #red
\override Staff.LedgerLineSpanner.color = #red
\hide Voice.Stem
\override NoteHead.style = #'hufnagel.punctum
\clef "hufnagel-do-fa"
- c
+ c'
@end lilypond
@end multitable
There is only one clef used in Kievan notation (the Tse-fa-ut Clef).
It is used to indicate the position of @code{c}:
-@lilypond[quote,relative=1,notime,verbatim]
+@lilypond[quote,fragment,notime,verbatim]
\clef "kievan-do"
\kievanOn
- c
+ c'
@end lilypond
@seealso
but may occur in earlier manuscripts. It has been included
primarily for the sake of compatibility.
-@lilypond[quote,relative=1,notime,verbatim]
+@lilypond[quote,fragment,notime,verbatim]
\clef "kievan-do"
\override Accidental.glyph-name-alist =
#alteration-kievan-glyph-name-alist
-bes' dis,
+bes' dis'
@end lilypond
@seealso
Kievan notation, which may be called the Kievan final bar line.
It can be invoked as @code{\bar "k"}.
-@lilypond[quote,relative=1,notime,verbatim]
+@lilypond[quote,fragment,notime,verbatim]
\kievanOn
\clef "kievan-do"
- c \bar "k"
+ c' \bar "k"
@end lilypond
@seealso
The @code{\new} prefix without a name is commonly used to create
scores with many staves:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
- \new Staff {
+ \new Staff \relative {
% leave the Voice context to be created implicitly
- c4 c
- }
- \new Staff {
- d4 d
+ c''4 c
}
+ \new Staff \relative {
+ d''4 d
+}
>>
@end lilypond
@noindent
and to place several voices into one staff:
-@lilypond[quote,verbatim,relative=2]
-<<
- \new Staff <<
- \new Voice {
- \voiceOne
- c8 c c4 c c
- }
- \new Voice {
- \voiceTwo
- g4 g g g
- }
- >>
+@lilypond[quote,verbatim]
+\new Staff <<
+ \new Voice \relative {
+ \voiceOne
+ c''8 c c4 c c
+ }
+ \new Voice \relative {
+ \voiceTwo
+ g'4 g g g
+ }
>>
@end lilypond
@code{\new} with or without a name will always create a fresh,
distinct, context, even if one with the same name already exists:
-@lilypond[quote,verbatim,relative=2]
-<<
- \new Staff <<
- \new Voice = "A" {
- \voiceOne
- c8 c c4 c c
- }
- \new Voice = "A" {
- \voiceTwo
- g4 g g g
- }
- >>
+@lilypond[quote,verbatim]
+\new Staff <<
+ \new Voice = "A" \relative {
+ \voiceOne
+ c''8 c c4 c c
+ }
+ \new Voice = "A" \relative {
+ \voiceTwo
+ g'4 g g g
+ }
>>
@end lilypond
example which removes @code{Time_signature_engraver} and
@code{Clef_engraver} from a @code{Staff} context,
-@lilypond[quote,relative=1,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Staff {
- f2 g
+ \new Staff \relative {
+ f'2 g
}
\new Staff \with {
\remove "Time_signature_engraver"
\remove "Clef_engraver"
- } {
- f2 g2
+ } \relative {
+ f'2 g2
}
>>
@end lilypond
Suppose we want to move the fingering indication in the fragment
below:
-@lilypond[quote,relative=2,verbatim]
-c-2
+@lilypond[quote,fragment,verbatim]
+c''-2
@end lilypond
If you visit the documentation on fingering instructions (in
Recall that we wanted to change the position of the @b{2} in
-@lilypond[quote,relative=2,verbatim]
-c-2
+@lilypond[quote,fragment,verbatim]
+c''-2
@end lilypond
Since the @b{2} is vertically positioned next to its note, we have to
Inserting this command before the Fingering object is created,
i.e., before @code{c2}, yields the following result:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,fragment,verbatim]
\once \override Voice.Fingering.padding = #3
-c-2
+c''-2
@end lilypond
applies to the current staff. Other staves will keep their normal
appearance. Here we see the command in action:
-@lilypond[quote,verbatim,relative=2]
-c4
+@lilypond[quote,fragment,verbatim]
+c''4
\override Staff.Stem.thickness = #4.0
-c4
-c4
-c4
+c''4
+c''4
+c''4
@end lilypond
The @code{\override} command changes the definition of the @code{Stem}
causing the default context @code{Voice} to be used. Adding
@code{\once} applies the change during one timestep only.
-@lilypond[quote,verbatim,relative=2]
-c4
+@lilypond[quote,fragment,verbatim]
+c''4
\once \override Stem.thickness = #4.0
-c4
-c4
+c''4
+c''4
@end lilypond
The @code{\override} must be done before the object is
or beams, the @code{\override} command must be executed at the moment
when the object is created. In this example,
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
\override Slur.thickness = #3.0
-c8[( c
+c''8[( c''
\override Beam.beam-thickness = #0.6
-c8 c])
+c''8 c''])
@end lilypond
@noindent
For example, multimeasure rests will be combined into a single bar
if the context property @code{skipBars} is set to @code{#t}:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
R1*2
\set Score.skipBars = ##t
R1*2
set in the current bottom context (typically @code{ChordNames},
@code{Voice}, @code{TabVoice}, or @code{Lyrics}).
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
\set Score.autoBeaming = ##f
-<<
- {
- e8 e e e
- \set autoBeaming = ##t
- e8 e e e
- } \\ {
- c8 c c c c8 c c c
- }
->>
+\relative {
+ e''8 e e e
+ \set autoBeaming = ##t
+ e8 e e e
+} \\
+\relative {
+ c''8 c c c c8 c c c
+}
@end lilypond
The change is applied @q{on-the-fly}, during the music, so that the
@code{Voice}, will have no effect, because skipBars is a property of
the @code{Score} context.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
R1*2
\set skipBars = ##t
R1*2
Properties that have been set in enclosing contexts will
not be altered by an unset in an enclosed context:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
\set Score.autoBeaming = ##t
-<<
- {
- \unset autoBeaming
- e8 e e e
- \unset Score.autoBeaming
- e8 e e e
- } \\ {
- c8 c c c c8 c c c
- }
->>
+\relative {
+ \unset autoBeaming
+ e''8 e e e
+ \unset Score.autoBeaming
+ e8 e e e
+} \\
+\relative {
+ c''8 c c c c8 c c c
+}
@end lilypond
Like @code{\set}, the @var{context} argument does not have to be
Preceding a @code{\set} command by @code{\once} makes the
setting apply to only a single time-step:
-@lilypond[quote,verbatim,relative=2]
-c4
+@lilypond[quote,fragment,verbatim]
+c''4
\once \set fontSize = #4.7
-c4
-c4
+c''4
+c''4
@end lilypond
A full description of all available context properties is in the
overriding the @code{thickness} property of the @code{Stem}
object:
-@lilypond[quote,verbatim,relative=2]
-c4 c
+@lilypond[quote,fragment,verbatim]
+c''4 c''
\override Voice.Stem.thickness = #3.0
-c4 c
+c''4 c''
@end lilypond
If no context is specified in an @code{\override}, the bottom
context is used:
-@lilypond[quote,verbatim,relative=2]
-{ \override Staff.Stem.thickness = #3.0
- <<
- {
- e4 e
- \override Stem.thickness = #0.5
- e4 e
- } \\ {
- c4 c c c
- }
- >>
-}
+@lilypond[quote,fragment,verbatim]
+\override Staff.Stem.thickness = #3.0
+<<
+ \relative {
+ e''4 e
+ \override Stem.thickness = #0.5
+ e4 e
+ } \\
+ \relative {
+ c''4 c c c
+ }
+>>
@end lilypond
Some tweakable options are called @q{subproperties} and reside inside
For example,
-@lilypond[quote,verbatim,relative=2]
-c4
-\override Voice.Stem.thickness = #3.0
-c4 c
-\revert Voice.Stem.thickness
-c4
+@lilypond[quote,verbatim]
+\relative {
+ c''4
+ \override Voice.Stem.thickness = #3.0
+ c4 c
+ \revert Voice.Stem.thickness
+ c4
+}
@end lilypond
The effects of @code{\override} and @code{\revert} apply to all
grobs in the affected context from the current time forward:
-@lilypond[quote,verbatim,relative=2]
-{
- <<
- {
- e4
- \override Staff.Stem.thickness = #3.0
- e4 e e
- } \\ {
- c4 c c
- \revert Staff.Stem.thickness
- c4
- }
- >>
-}
+@lilypond[quote,verbatim]
+<<
+ \relative {
+ e''4
+ \override Staff.Stem.thickness = #3.0
+ e4 e e
+ } \\
+ \relative {
+ c''4 c c
+ \revert Staff.Stem.thickness
+ c4
+ }
+>>
@end lilypond
@funindex \once
@code{\once} can be used with @code{\override}
to affect only the current time step:
-@lilypond[quote,verbatim,relative=2]
-{
- <<
- {
- \override Stem.thickness = #3.0
- e4 e e e
- } \\ {
- c4
- \once \override Stem.thickness = #3.0
- c4 c c
- }
- >>
-}
+@lilypond[quote,verbatim]
+<<
+ \relative c {
+ \override Stem.thickness = #3.0
+ e''4 e e e
+ } \\
+ \relative {
+ c''4
+ \once \override Stem.thickness = #3.0
+ c4 c c
+ }
+>>
@end lilypond
an item in the input file, you can use the @code{\tweak} command.
For example:
-@lilypond[relative=2,verbatim,quote]
-< c
- \tweak color #red
- d
- g
- \tweak duration-log #1
- a
-> 4
--\tweak padding #8
--^
+@lilypond[verbatim,quote]
+\relative {
+ < c''
+ \tweak color #red
+ d
+ g
+ \tweak duration-log #1
+ a
+ > 4
+ -\tweak padding #8
+ -^
+}
@end lilypond
So, this works:
-@lilypond[relative=2,verbatim,quote]
-<\tweak color #red c>4
+@lilypond[verbatim,fragment,quote]
+<\tweak color #red c''>4
@end lilypond
@noindent
but this does not:
-@lilypond[relative=2,verbatim,quote]
-\tweak color #red c4
+@lilypond[verbatim,fragment,quote]
+\tweak color #red c''4
@end lilypond
@end ignore
In this example, the color of one note head and the type of another
note head are modified within a single chord:
-@lilypond[relative=2,verbatim,quote]
-< c
+@lilypond[verbatim,fragment,quote]
+< c''
\tweak color #red
- d
- g
+ d''
+ g''
\tweak duration-log #1
- a
+ a''
> 4
@end lilypond
@code{\tweak} can be used to modify slurs:
-@lilypond[verbatim,quote,relative=1]
-c-\tweak thickness #5 ( d e f)
+@lilypond[verbatim,quote]
+\relative { c'-\tweak thickness #5 ( d e f) }
@end lilypond
only acts as a container, and all layout objects are created from events
inside of the @code{EventChord}:
-@lilypond[relative=2,verbatim,quote]
-\tweak color #red c4
-\tweak color #red <c e>4
-<\tweak color #red c e>4
+@lilypond[verbatim,fragment,quote]
+\tweak color #red c''4
+\tweak color #red <c'' e''>4
+<\tweak color #red c'' e''>4
@end lilypond
The simple @code{\tweak} command cannot be used to modify any object
of the @code{\tweak} command in which the grob name is specified
explicitly:
-@lilypond[relative=2,verbatim,quote]
+@lilypond[fragment,verbatim,quote]
\tweak Stem.color #red
-\tweak Beam.color #green c8 e
-<c e \tweak Accidental.font-size #-3 ges>4
+\tweak Beam.color #green c''8 e''
+<c'' e'' \tweak Accidental.font-size #-3 ges''>4
@end lilypond
@code{\tweak} cannot be used to modify clefs or time
Several @code{\tweak} commands may be placed before a
notational element -- all affect it:
-@lilypond[verbatim,quote,relative=1]
-c
--\tweak style #'dashed-line
--\tweak dash-fraction #0.2
--\tweak thickness #3
--\tweak color #red
- \glissando
-f'
+@lilypond[verbatim,fragment,quote]
+c'
+ -\tweak style #'dashed-line
+ -\tweak dash-fraction #0.2
+ -\tweak thickness #3
+ -\tweak color #red
+ \glissando
+f''
@end lilypond
The music stream which is generated from a section of an input file,
Direction indicators affect only the next note:
-@lilypond[verbatim,quote,relative=2]
-c2( c)
-c2_( c)
-c2( c)
-c2^( c)
+@lilypond[verbatim,quote]
+\relative {
+ c''2( c)
+ c2_( c)
+ c2( c)
+ c2^( c)
+}
@end lilypond
@node The direction property
These indications affect all notes until they are canceled.
-@lilypond[verbatim,quote,relative=2]
-c2( c)
-\slurDown
-c2( c)
-c2( c)
-\slurNeutral
-c2( c)
+@lilypond[verbatim,quote]
+\relative {
+ c''2( c)
+ \slurDown
+ c2( c)
+ c2( c)
+ \slurNeutral
+ c2( c)
+}
@end lilypond
In polyphonic music, it is generally better to specify an explicit
implicitly defined by the number of elements in the list of values
for @code{'line-positions}.}
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.line-positions = #'(7 3 0 -4 -6 -7)
}
-{ a4 e' f b | d1 }
+\relative { a4 e' f b | d1 }
@end lilypond
The width of a staff can be modified. The units are staff
spaces. The spacing of objects inside the staff is not affected by
this setting.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.width = #23
}
-{ a4 e' f b | d1 }
+\relative { a4 e' f b | d1 }
@end lilypond
@end ignore
-@lilypond[verbatim,quote,relative=2]
-a~ a
-a
+@lilypond[verbatim,quote,fragment]
+a'~ a'
+a'
% increase the length of the tie
-\tweak minimum-length #5
-~ a
+~ a'
@end lilypond
-@lilypond[verbatim,quote,relative=2]
-a1
-\compressMMRests {
+@lilypond[verbatim,quote]
+\relative \compressMMRests {
+ a'1
R1*23
% increase the length of the rest bar
\once \override MultiMeasureRest.minimum-length = #20
}
@end lilypond
-@lilypond[verbatim,quote,relative=2]
-a \< a a a \!
-% increase the length of the hairpin
-\override Hairpin.minimum-length = #20
-a \< a a a \!
+@lilypond[verbatim,quote]
+\relative {
+ a' \< a a a \!
+ % increase the length of the hairpin
+ \override Hairpin.minimum-length = #20
+ a \< a a a \!
+}
@end lilypond
This override can also be used to increase the length of slurs and
phrasing slurs:
-@lilypond[verbatim,quote,relative=2]
-a( g)
-a
--\tweak minimum-length #5
-( g)
+@lilypond[verbatim,quote]
+\relative {
+ a'( g)
+ a
+ -\tweak minimum-length #5
+ ( g)
-a\( g\)
-a
--\tweak minimum-length #5
-\( g\)
+ a\( g\)
+ a
+ -\tweak minimum-length #5
+ \( g\)
+}
@end lilypond
For some layout objects, the @code{minimum-length} property becomes
the minimum length of a glissando has no effect unless the
@code{springs-and-rods} property is set:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,fragment,quote]
% default
-e \glissando c'
+e' \glissando c''
% not effective alone
\once \override Glissando.minimum-length = #20
-e, \glissando c'
+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'
+e' \glissando c''
@end lilypond
The same is true of the @code{Beam} object:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,fragment,quote]
% not effective alone
\once \override Beam.minimum-length = #20
-e8 e e e
+e'8 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
+e'8 e' e' e'
@end lilypond
@subsubsubheading The @code{to-barline} property
the spanner will extend beyond the bar line and end on the note
itself:
-@lilypond[verbatim,quote,relative=2]
-a \< a a a a \! a a a \break
-\override Hairpin.to-barline = ##f
-a \< a a a a \! a a a
+@lilypond[verbatim,quote]
+\relative {
+ a' \< a a a a \! a a a \break
+ \override Hairpin.to-barline = ##f
+ a \< a a a a \! a a a
+}
@end lilypond
This property is not effective for all spanners. For example,
two levels down within the property hierarchy, but the syntax of
the @code{\override} command is quite simple:
-@lilypond[relative=2,quote,verbatim]
-e2 \glissando b
+@lilypond[quote,fragment,verbatim]
+e''2 \glissando b'
\once \override Glissando.bound-details.left.Y = #3
\once \override Glissando.bound-details.right.Y = #-2
-e2 \glissando b
+e''2 \glissando b'
@end lilypond
The units for the @code{Y} property are @code{staff-space}s,
specified by the @code{left-broken} and @code{right-broken}
sub-lists of @code{bound-details}. For example:
-@lilypond[relative=2,ragged-right,verbatim,quote]
+@lilypond[ragged-right,fragment,verbatim,quote]
\override Glissando.breakable = ##t
\override Glissando.bound-details.right-broken.Y = #-3
-c1 \glissando \break
-f1
+c''1 \glissando \break
+f''1
@end lilypond
This is a markup that is evaluated to yield the stencil. It is used
to put @i{cresc.}, @i{tr} and other text on horizontal spanners.
-@lilypond[quote,ragged-right,relative=2,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\override TextSpanner.bound-details.left.text
= \markup { \small \bold Slower }
-c2\startTextSpan b c a\stopTextSpan
+\relative { c''2\startTextSpan b c a\stopTextSpan }
@end lilypond
@item stencil-align-dir-y
or @code{stencil-offset} will move the symbol at the edge vertically
relative to the end point of the line:
-@lilypond[relative=1,quote,verbatim]
+@lilypond[quote,fragment,verbatim]
\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
+
+\relative { c'4^\startTextSpan c c c \stopTextSpan }
@end lilypond
Note that negative values move the text @emph{up}, contrary to the
if @code{to-barline} is true and a bar line occurs before the next
note.
-@lilypond[verbatim,quote,ragged-right,relative=2]
-\endSpanners
-c2 \startTextSpan c2 c2
-\endSpanners
-c2 \< c2 c2
+@lilypond[verbatim,quote,ragged-right]
+\relative c'' {
+ \endSpanners
+ c2 \startTextSpan c2 c2
+ \endSpanners
+ c2 \< c2 c2
+}
@end lilypond
When using @code{\endSpanners} it is not necessary to close
will not be drawn. The default action can be recovered with
@code{\revert}.
-@lilypond[quote,verbatim,relative=1]
+@lilypond[quote,fragment,verbatim]
a1 a
\override Score.BarLine.stencil = ##f
a a
This rather common operation has a shortcut @code{\omit}:
-@lilypond[quote,verbatim,relative=1]
+@lilypond[quote,fragment,verbatim]
a1 a
\omit Score.BarLine
a a
set to @code{#f}. If set to @code{#t} the object still occupies
space but is made invisible.
-@lilypond[quote,verbatim,relative=2]
-a4 a
+@lilypond[quote,fragment,verbatim]
+a'4 a'
\once \override NoteHead.transparent = ##t
-a a
+a' a'
@end lilypond
This rather common operation has a shortcut @code{\hide}:
-@lilypond[quote,verbatim,relative=2]
-a4 a
+@lilypond[quote,fragment,verbatim]
+a'4 a'
\once \hide NoteHead
-a a
+a' a'
@end lilypond
@node Painting objects white
and this may leave a ghostly image of the white object, as shown
here:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
\override Staff.Clef.color = #white
-a1
+a'1
@end lilypond
This may be avoided by changing the order of printing the objects.
the @code{Clef} object must be given in a lower value of
@code{layer}, say @w{@code{-1}}, so that it is drawn earlier:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,fragment,verbatim]
\override Staff.Clef.color = #white
\override Staff.Clef.layer = #-1
-a1
+a'1
@end lilypond
@node Using break-visibility
The example below shows the use of the vector form to control the
visibility of bar lines:
-@lilypond[quote,verbatim,relative=1,ragged-right]
-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
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ f'4 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
+}
@end lilypond
Although all three components of the vector used to override
to B-flat major is still visible, even though @code{all-invisible}
is set.
-@lilypond[quote,verbatim,relative=1,ragged-right]
-\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
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ f'4 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
+}
@end lilypond
The visibility of such explicit key signature and clef changes is
@code{break-visibility} must still be overridden in the appropriate
object to remove these.
-@lilypond[quote,verbatim,relative=1,ragged-right]
-\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
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ f'4 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
+}
@end lilypond
@subsubsubheading Visibility of cancelling accidentals
change, set the Staff context property @code{printKeyCancellation}
to @code{#f}:
-@lilypond[quote,verbatim,relative=1,ragged-right]
-\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
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ f'4 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
+}
@end lilypond
With these overrides only the accidentals before the notes remain
the key change. In this case setting @code{printKeyCancellation} to
@code{#f} has no effect:
-@lilypond[quote,verbatim,relative=1,ragged-right]
-\key g \major
-f4 g a b
-\set Staff.explicitKeySignatureVisibility = #all-invisible
-\set Staff.printKeyCancellation = ##f
-\key c \major
-f4 g a b \break
-f4 g a b
-f4 g a b
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ f'4 g a b
+ \set Staff.explicitKeySignatureVisibility = #all-invisible
+ \set Staff.printKeyCancellation = ##f
+ \key c \major
+ f4 g a b \break
+ f4 g a b
+ f4 g a b
+}
@end lilypond
To suppress the cancelling accidentals even when the key is
changed to C@tie{}major or A@tie{}minor, override
the visibility of the @code{KeyCancellation} grob instead:
-@lilypond[quote,verbatim,relative=1,ragged-right]
-\key g \major
-f4 g a b
-\set Staff.explicitKeySignatureVisibility = #all-invisible
-\override Staff.KeyCancellation.break-visibility = #all-invisible
-\key c \major
-f4 g a b \break
-f4 g a b
-f4 g a b
+@lilypond[quote,verbatim,ragged-right]
+\relative {
+ \key g \major
+ f'4 g a b
+ \set Staff.explicitKeySignatureVisibility = #all-invisible
+ \override Staff.KeyCancellation.break-visibility = #all-invisible
+ \key c \major
+ f4 g a b \break
+ f4 g a b
+ f4 g a b
+}
@end lilypond
@c TODO Add visibility of cautionary accidentals before notes
Here is an example showing the different line styles available,
and how to tune them.
-@lilypond[relative=2,ragged-right,verbatim,quote]
-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
+@lilypond[ragged-right,verbatim,quote]
+\relative {
+ d''2 \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
+}
@end lilypond
The locations of the end-points of the spanner are computed
override these:
@c TODO Complete
-@lilypond[relative=2,ragged-right,verbatim,quote]
-e2 \glissando f
-\once \override Glissando.bound-details.right.Y = #-2
-e2 \glissando f
+@lilypond[ragged-right,verbatim,quote]
+\relative {
+ e''2 \glissando f
+ \once \override Glissando.bound-details.right.Y = #-2
+ e2 \glissando f
+}
@end lilypond
The value for @code{Y} is set to @w{@code{-2}} for the right end
objects is useful; the following example shows one situation where
they may be:
-@lilypond[quote,verbatim,relative=1]
-g4\< e' d' f\!
+@lilypond[quote,fragment,verbatim]
+g4\< e' d'' f''\!
\override Hairpin.rotation = #'(20 -1 0)
-g,,4\< e' d' f\!
+g4\< e' d'' f''\!
@end lilypond
@node Rotating markup
to disable the automatic collision avoidance, which would push some
of the text too high.
-@lilypond[quote,verbatim,relative=1]
+@lilypond[quote,fragment,verbatim]
\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" }
+des'^\markup { \rotate #30 "a D-Flat" }
+fis'^\markup { \rotate #30 "an F-Sharp" }
@end lilypond
@node Advanced tweaks
notes with the default fingering position and the positions with @code{X-offset}
and @code{Y-offset} modified.
-@lilypond[verbatim,quote,relative=2]
-a-3
-a
+@lilypond[verbatim,fragment,quote]
+a'-3
+a'
-\tweak X-offset #0
-\tweak Y-offset #0
-3
-a
+a'
-\tweak X-offset #-1
-\tweak Y-offset #1
-3
can be used to separately align several annotations on a single
note:
-@lilypond[quote,verbatim,relative=1]
+@lilypond[quote,verbatim,fragment]
a'
-\tweak self-alignment-X #-1
^"left-aligned"
The following example shows how to adjust a fingering mark so
that it nestles close to the note head.
-@lilypond[quote,verbatim,relative=2]
-a
+@lilypond[quote,verbatim,fragment]
+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
Each type of object has its own default reference point, to which
rehearsal marks are aligned:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
% The rehearsal mark will be aligned to the right edge of the Clef
\override Score.RehearsalMark.break-align-symbols = #'(clef)
\key a \major
\clef treble
\mark "↓"
-e1
+e'1
% The rehearsal mark will be aligned to the left edge of the Time Signature
\override Score.RehearsalMark.break-align-symbols = #'(time-signature)
\key a \major
\clef treble
\time 3/4
\mark "↓"
-e2.
+e'2.
% The rehearsal mark will be centered above the Breath Mark
\override Score.RehearsalMark.break-align-symbols = #'(breathing-sign)
\key a \major
\clef treble
\time 4/4
-e1
+e'1
\breathe
\mark "↓"
@end lilypond
line is invisible the object is aligned to the place where the bar
line would be.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
% The rehearsal mark will be aligned to the right edge of the Key Signature
\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
\key a \major
\clef treble
\mark "↓"
-e1
+e'1
% The rehearsal mark will be aligned to the right edge of the Clef
\set Staff.explicitKeySignatureVisibility = #all-invisible
\override Score.RehearsalMark.break-align-symbols = #'(key-signature clef)
\key a \major
\clef bass
\mark "↓"
-gis,,1
+gis,1
% The rehearsal mark will be centered above the Bar Line
\set Staff.explicitKeySignatureVisibility = #all-invisible
\set Staff.explicitClefVisibility = #all-invisible
\key a \major
\clef treble
\mark "↓"
-e''1
+e'1
@end lilypond
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.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
% The RehearsalMark will be aligned with the right edge of the Key Signature
\override Score.RehearsalMark.break-align-symbols = #'(key-signature)
\key a \major
\clef treble
\time 4/4
\mark "↓"
-e1
+e'1
% The RehearsalMark will be centered above the Key Signature
\once \override Score.KeySignature.break-align-anchor-alignment = #CENTER
\mark "↓"
\key a \major
-e1
+e'1
% The RehearsalMark will be aligned with the left edge of the Key Signature
\once \override Score.KeySignature.break-align-anchor-alignment = #LEFT
\key a \major
\mark "↓"
-e1
+e'1
@end lilypond
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:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
% The RehearsalMark will be aligned with the left edge of the Key Signature
% 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 "↓"
-e1
+e'1
% The RehearsalMark will be aligned with the left edge of the Key Signature
% and then shifted left by 2 staff-spaces
\once \override Score.KeySignature.break-align-anchor = #-2
\key a \major
\mark "↓"
-e1
+e'1
@end lilypond
In this example the automatic placement of the tie is not optimum,
and @code{\tieDown} would not help.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote]
<<
- { e1~ 1 }
+ { e'1~ 1 }
\\
- { r4 <g c,> <g c,> <g c,> }
+ \relative { r4 <g' c,> <g c,> <g c,> }
>>
@end lilypond
So, using the same example as above and the @code{\once\override}
form of @code{\shape}, this will raise the tie by half a staff-space:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote]
<<
{
\shape #'((0 . 0.5) (0 . 0.5) (0 . 0.5) (0 . 0.5)) Tie
- e1~ 1
+ e'1~ 1
}
\\
- { r4 <g c,> <g c,> <g c,> }
+ \relative { r4 <g' c,> <g c,> <g c,> }
>>
@end lilypond
more in the center. The following example does this, this time using
the alternative @code{\tweak} form:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote]
<<
{
- e1-\shape #'((0 . 0.5) (0 . 1) (0 . 1) (0 . 0.5)) ~ e
+ e'1-\shape #'((0 . 0.5) (0 . 1) (0 . 1) (0 . 0.5)) ~ e'
}
\\
- { r4 <g c,> <g c,> <g c,> }
+ \relative { r4 <g' c,> <g c,> <g c,> }
>>
@end lilypond
in the same way, and two different curves starting at the same
musical moment may also be shaped:
-@lilypond[verbatim,quote,ragged-right,relative=2]
-c8(\( a) a'4 e c\)
-\shape #'((0.7 . -0.4) (0.5 . -0.4) (0.3 . -0.3) (0 . -0.2)) Slur
-\shape #'((0 . 0) (0 . 0.5) (0 . 0.5) (0 . 0)) PhrasingSlur
-c8(\( a) a'4 e c\)
+@lilypond[verbatim,quote,ragged-right]
+\relative {
+ c''8(\( a) a'4 e c\)
+ \shape #'((0.7 . -0.4) (0.5 . -0.4) (0.3 . -0.3) (0 . -0.2)) Slur
+ \shape #'((0 . 0) (0 . 0.5) (0 . 0.5) (0 . 0)) PhrasingSlur
+ c8(\( a) a'4 e c\)
+}
@end lilypond
The @code{\shape} function can also displace the control points of
placeholder. In this example the line break makes the single slur
look like two:
-@lilypond[verbatim,quote,ragged-right,relative=1]
-c4( f g c
-\break
-d,4 c' f, c)
+@lilypond[verbatim,quote,ragged-right]
+\relative {
+ c'4( f g c
+ \break
+ d,4 c' f, c)
+}
@end lilypond
Changing the shapes of the two halves of the slur makes it clearer
that the slur continues over the line break:
-@lilypond[verbatim,quote,ragged-right,relative=1]
+@lilypond[verbatim,quote,ragged-right]
% () may be used as a shorthand for ((0 . 0) (0 . 0) (0 . 0) (0 . 0))
% if any of the segments does not need to be changed
-\shape #'(
- (( 0 . 0) (0 . 0) (0 . 0) (0 . 1))
- ((0.5 . 1.5) (1 . 0) (0 . 0) (0 . -1.5))
- ) Slur
-c4( f g c
-\break
-d,4 c' f, c)
+\relative c' {
+ \shape #'(
+ (( 0 . 0) (0 . 0) (0 . 0) (0 . 1))
+ ((0.5 . 1.5) (1 . 0) (0 . 0) (0 . -1.5))
+ ) Slur
+ c4( f g c
+ \break
+ d,4 c' f, c)
+}
@end lilypond
If an S-shaped curve is required the control points must always be
adjusted manually --- LilyPond will never select such shapes
automatically.
-@lilypond[verbatim,quote,relative=2]
-c8( e b-> f d' a e-> g)
-\shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) PhrasingSlur
-c8\( e b-> f d' a e-> g\)
+@lilypond[verbatim,quote]
+\relative c'' {
+ c8( e b-> f d' a e-> g)
+ \shape #'((0 . -1) (5.5 . -0.5) (-5.5 . -10.5) (0 . -5.5)) PhrasingSlur
+ c8\( e b-> f d' a e-> g\)
+}
@end lilypond
@subsubsubheading Specifying control points explicitly
It shows one way of indicating a slur extending into alternative
sections of a volta repeat.
-@lilypond[verbatim,quote,relative=2]
-c1
-\repeat volta 3 { c4 d( e f }
-\alternative {
- { g2) d }
- {
- g2
- % create a slur and move it to a new position
- % the <> is just an empty chord to carry the slur termination
- -\tweak control-points #'((-2 . 3.8) (-1 . 3.9) (0 . 4) (1 . 3.4)) ( <> )
- f,
- }
- {
- e'2
- % create a slur and move it to a new position
- -\tweak control-points #'((-2 . 3) (-1 . 3.1) (0 . 3.2) (1 . 2.4)) ( <> )
- f,
+@lilypond[verbatim,quote]
+\relative {
+ c''1
+ \repeat volta 3 { c4 d( e f }
+ \alternative {
+ { g2) d }
+ {
+ g2
+ % create a slur and move it to a new position
+ % the <> is just an empty chord to carry the slur termination
+ -\tweak control-points #'((-2 . 3.8) (-1 . 3.9) (0 . 4) (1 . 3.4)) ( <> )
+ f,
+ }
+ {
+ e'2
+ % create a slur and move it to a new position
+ -\tweak control-points #'((-2 . 3) (-1 . 3.1) (0 . 3.2) (1 . 2.4)) ( <> )
+ f,
+ }
}
}
@end lilypond
@code{thickness} affects the slur on either side of the line
break.
-@lilypond[verbatim,quote,ragged-right,relative=2]
-r2
-\once\override Slur.thickness = 10
-c8( d e f
-\break
-g8 f e d) r2
+@lilypond[verbatim,quote,ragged-right]
+\relative c'' {
+ r2
+ \once\override Slur.thickness = 10
+ c8( d e f
+ \break
+ g8 f e d) r2
+}
@end lilypond
Independently modifying the appearance of individual pieces
The following code applies an independent @code{\override} to
each of the slur segments in the previous example:
-@lilypond[verbatim,quote,ragged-right,relative=2]
-r2
-\alterBroken thickness #'(10 1) Slur
-c8( d e f
-\break
-g8 f e d) r2
+@lilypond[verbatim,quote,ragged-right]
+\relative c'' {
+ r2
+ \alterBroken thickness #'(10 1) Slur
+ c8( d e f
+ \break
+ g8 f e d) r2
+}
@end lilypond
The @code{\alterBroken} command may be used with any spanner
been added. The following example illustrates how this can be
done, in this case using the @code{\tweak} form of the command:
-@lilypond[verbatim,quote,ragged-right,relative=2]
+@lilypond[verbatim,quote,ragged-right]
% The empty list is conveniently used below, because it is the
% default setting of dash-definition, resulting in a solid curve.
-c2-\alterBroken dash-definition #'(() ((0 1.0 0.4 0.75))) \(e
-\break
-g2 e\)
+\relative {
+ c''2-\alterBroken dash-definition #'(() ((0 1.0 0.4 0.75))) \(e
+ \break
+ g2 e\)
+}
@end lilypond
It is important to understand that @code{\alterBroken} will set
Chord mode and note mode can be mixed in sequential music:
-@lilypond[verbatim,quote,ragged-right,relative=1]
-<c e g>2 <g b d>
-\chordmode { c2 f }
-<c e g>2 <g' b d>
-\chordmode { f2 g }
+@lilypond[verbatim,quote,ragged-right]
+\relative {
+ <c' e g>2 <g b d>
+ \chordmode { c2 f }
+ <c e g>2 <g' b d>
+ \chordmode { f2 g }
+}
@end lilypond
@seealso
Rests passed to a @code{ChordNames} context will cause the
@code{noChordSymbol} markup to be displayed.
-@lilypond[verbatim, quote, relative=1]
+@lilypond[verbatim,quote]
<<
\new ChordNames \chordmode {
c1
@code{\tweak} or @code{\override} commands to adjust its
@code{font-size} property:
-@lilypond[quote,verbatim,relative=1]
-% resize a note head
-<f \tweak font-size -4 b e>-5
-% resize a fingering
-bes-\tweak font-size 0 -3
-% resize an accidental
-\once \override Accidental.font-size = -4 bes!-^
-% resize an articulation
-\once \override Script.font-size = 4 bes!-^
+@lilypond[quote,verbatim]
+\relative {
+ % resize a note head
+ <f' \tweak font-size -4 b e>-5
+ % resize a fingering
+ bes-\tweak font-size 0 -3
+ % resize an accidental
+ \once \override Accidental.font-size = -4 bes!-^
+ % resize an articulation
+ \once \override Script.font-size = 4 bes!-^
+}
@end lilypond
The default @code{font-size} value for each layout object is
The @code{fontSize} context property adjusts the relative size of
all glyph-based notational elements in a context:
-@lilypond[verbatim,quote,relative=2]
-\time 3/4
-d4---5 c8( b a g) |
-\set fontSize = -6
-e'4-- c!8-4( b a g) |
-\set fontSize = 0
-fis4---3 e8( d) fis4 |
-g2.
+@lilypond[verbatim,quote]
+\relative {
+ \time 3/4
+ d''4---5 c8( b a g) |
+ \set fontSize = -6
+ e'4-- c!8-4( b a g) |
+ \set fontSize = 0
+ fis4---3 e8( d) fis4 |
+ g2.
+}
@end lilypond
The @code{fontSize} value is a number indicating the size relative
printed. This can cause confusion when setting individual
@code{font-size} properties while @code{fontSize} is already set:
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote,fragment]
% the default font-size for NoteHead is 0
% the default font-size for Fingering is -5
-c4-3
+c''4-3
\set fontSize = -3
% the effective font size for NoteHead is now -3
% the effective font size for Fingering is now -8
-c4-3
+c''4-3
\override Fingering.font-size = 0
% the effective font size for Fingering is now -3
-c4-3
+c''4-3
@end lilypond
The following shorthand commands are also available:
@item @code{\huge} @tab @code{\set fontSize = 2} @tab 126%
@end multitable
-@lilypond[verbatim,quote,relative=2]
-\teeny
-c4.-> d8---3
-\tiny
-c4.-> d8---3
-\small
-c4.-> d8---3
-\normalsize
-c4.-> d8---3
-\large
-c4.-> d8---3
-\huge
-c4.-> d8---3
+@lilypond[verbatim,quote]
+\relative c'' {
+ \teeny
+ c4.-> d8---3
+ \tiny
+ c4.-> d8---3
+ \small
+ c4.-> d8---3
+ \normalsize
+ c4.-> d8---3
+ \large
+ c4.-> d8---3
+ \huge
+ c4.-> d8---3
+}
@end lilypond
Fingering instructions can be entered using
@samp{@var{note}-@var{digit}}:
-@lilypond[verbatim,quote,relative=2]
-c4-1 d-2 f-4 e-3
+@lilypond[verbatim,quote]
+\relative { c''4-1 d-2 f-4 e-3 }
@end lilypond
Markup texts or strings may be used for finger changes.
-@lilypond[verbatim,quote,relative=2]
-c4-1 d-2 f\finger \markup \tied-lyric #"4~3" c\finger "2 - 3"
+@lilypond[verbatim,quote]
+\relative {
+ c''4-1 d-2 f\finger \markup \tied-lyric #"4~3" c\finger "2 - 3"
+}
@end lilypond
@cindex thumb-script
A thumb-script can be added (e.g. cello music) to indicate
that a note should be played with the thumb.
-@lilypond[verbatim,quote,relative=2]
-<a_\thumb a'-3>2 <b_\thumb b'-3>
+@lilypond[verbatim,quote]
+\relative { <a'_\thumb a'-3>2 <b_\thumb b'-3> }
@end lilypond
@cindex fingering chords
Fingerings for chords can also be added to individual notes by
adding them after the pitches.
-@lilypond[verbatim,quote,relative=2]
-<c-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
+@lilypond[verbatim,quote]
+\relative {
+ <c''-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
+}
@end lilypond
Fingering instructions may be manually placed above or below the
Hidden (or invisible or transparent) notes can be useful in
preparing theory or composition exercises.
-@lilypond[verbatim,quote,relative=2]
-c4 d
-\hideNotes
-e4 f
-\unHideNotes
-g a
-\hideNotes
-b
-\unHideNotes
-c
+@lilypond[verbatim,quote]
+\relative {
+ c''4 d
+ \hideNotes
+ e4 f
+ \unHideNotes
+ g a
+ \hideNotes
+ b
+ \unHideNotes
+ c
+}
@end lilypond
Note heads, stems, and flags, and rests are invisible. Beams
are invisible if they start on a hidden note. Objects that are
attached to invisible notes are still visible.
-@lilypond[verbatim,quote,relative=2]
-e8(\p f g a)--
-\hideNotes
-e8(\p f g a)--
+@lilypond[verbatim,quote]
+\relative c'' {
+ e8(\p f g a)--
+ \hideNotes
+ e8(\p f g a)--
+}
@end lilypond
Individual objects may be assigned colors. Valid color names
are listed in the @ref{List of colors}.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote,fragment]
\override NoteHead.color = #red
-c4 c
+c''4 c''
\override NoteHead.color = #(x11-color 'LimeGreen)
-d
+d''
\override Stem.color = #blue
-e
+e''
@end lilypond
If @code{x11-color} cannot make sense of the parameter then the
color returned defaults to black.
-@lilypond[verbatim,quote,relative=2]
-\override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
-\set Staff.instrumentName = \markup {
- \with-color #(x11-color 'navy) "Clarinet"
-}
+@lilypond[verbatim,quote]
+\relative c'' {
+ \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
+ 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
+}
@end lilypond
@cindex rgb-color
Exact RGB colors can be specified using the Scheme function
@code{rgb-color}.
-@lilypond[verbatim,quote,relative=2]
-\override Staff.StaffSymbol.color = #(x11-color 'SlateBlue2)
-\set Staff.instrumentName = \markup {
- \with-color #(x11-color 'navy) "Clarinet"
-}
+@lilypond[verbatim,quote]
+\relative c'' {
+ \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
+ \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
+}
@end lilypond
@seealso
the music event. When prefixed to a chord, it parenthesizes every
note. Individual notes inside a chord may also be parenthesized.
-@lilypond[verbatim,quote,relative=2]
-c2 \parenthesize d
-c2 \parenthesize <c e g>
-c2 <c \parenthesize e g>
+@lilypond[verbatim,quote]
+\relative {
+ c''2 \parenthesize d
+ c2 \parenthesize <c e g>
+ c2 <c \parenthesize e g>
+}
@end lilypond
Non-note objects may be parenthesized as well. For articulations,
a hyphen is needed before the @code{\parenthesize} command.
-@lilypond[verbatim,quote,relative=2]
-c2-\parenthesize -. d
-c2 \parenthesize r
+@lilypond[verbatim,quote]
+\relative {
+ c''2-\parenthesize -. d
+ c2 \parenthesize r
+}
@end lilypond
@seealso
square balloon. The primary purpose of this feature is to explain
notation.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Voice \with { \consists "Balloon_engraver" }
-{
+\relative c'' {
\balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
a8
\balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
Balloon text does not influence note spacing, but this can be altered:
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Voice \with { \consists "Balloon_engraver" }
-{
+\relative c'' {
\balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
a8
\balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
The possible values for @code{@var{name}} are listed in
@ref{List of articulations}. For example:
-@lilypond[verbatim,quote,relative=2]
-c4\staccato c\mordent b2\turn
-c1\fermata
+@lilypond[verbatim,quote]
+\relative {
+ c''4\staccato c\mordent b2\turn
+ c1\fermata
+}
@end lilypond
@cindex marcato
@notation{accent}, @notation{staccato}, and @notation{portato}.
Their corresponding output appears as follows:
-@lilypond[verbatim,quote,relative=2]
-c4-^ c-+ c-- c-!
-c4-> c-. c2-_
+@lilypond[verbatim,quote]
+\relative {
+ c''4-^ c-+ c-- c-!
+ c4-> c-. c2-_
+}
@end lilypond
The rules for the default placement of articulations are defined
to a multi-measure rest (and only a multi-measure rest). This
creates a @code{MultiMeasureRestText} object.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote,fragment]
\override Script.color = #red
\override MultiMeasureRestText.color = #blue
-a2\fermata r\fermata
+a'2\fermata r\fermata
R1\fermataMarkup
@end lilypond
marks may be manually placed above or below the staff; see
@ref{Direction and placement}.
-@lilypond[verbatim,quote,relative=2]
-c2\ppp c\mp
-c2\rfz c^\mf
-c2_\spp c^\ff
+@lilypond[verbatim,quote]
+\relative c'' {
+ c2\ppp c\mp
+ c2\rfz c^\mf
+ c2_\spp c^\ff
+}
@end lilypond
@cindex hairpin
@code{\>}. @notation{Hairpins} are engraved by default using this
notation.
-@lilypond[verbatim,quote,relative=2]
-c2\< c\!
-d2\< d\f
-e2\< e\>
-f2\> f\!
-e2\> e\mp
-d2\> d\>
-c1\!
+@lilypond[verbatim,quote]
+\relative c'' {
+ c2\< c\!
+ d2\< d\f
+ e2\< e\>
+ f2\> f\!
+ e2\> e\mp
+ d2\> d\>
+ c1\!
+}
@end lilypond
A hairpin that is terminated with @code{\!} will end at the
instead of the usual left edge had it been terminated with @code{\!}
before.
-@lilypond[verbatim,quote,relative=2]
-c1\< | c4 a c\< a | c4 a c\! a\< | c4 a c a\!
+@lilypond[verbatim,quote]
+\relative {
+ c''1\< | c4 a c\< a | c4 a c\! a\< | c4 a c a\!
+}
@end lilypond
Hairpins that are terminated with absolute dynamic marks instead of
of the absolute dynamic itself can alter where the preceding hairpin
ends.
-@lilypond[verbatim,quote,relative=2]
-c1\< | c4 a c\mf a | c1\< | c4 a c\ffff a
+@lilypond[verbatim,quote]
+\relative {
+ c''1\< | c4 a c\mf a | c1\< | c4 a c\ffff a
+}
@end lilypond
@cindex multiple dynamic marks on one note
This is particularly useful when adding a @notation{crescendo} and
@notation{decrescendo} to the same note:
-@lilypond[verbatim,quote,relative=2]
-c4\< c\! d\> e\!
-<< f1 { s4 s4\< s4\> s4\! } >>
+@lilypond[verbatim,quote]
+\relative {
+ c''4\< c\! d\> e\!
+ << f1 { s4 s4\< s4\> s4\! } >>
+}
@end lilypond
@cindex espressivo articulation
and decrescendo on the same note. However, be warned that this is
implemented as an articulation, not a dynamic.
-@lilypond[verbatim,quote,relative=2]
-c2 b4 a
-g1\espressivo
+@lilypond[verbatim,quote]
+\relative {
+ c''2 b4 a
+ g1\espressivo
+}
@end lilypond
@funindex \cresc
Textual decrescendos begin with @code{\decresc} or @code{\dim}.
Extender lines are engraved as required.
-@lilypond[verbatim,quote,relative=2]
-g8\cresc a b c b c d e\mf |
-f8\decresc e d c e\> d c b |
-a1\dim ~ |
-a2. r4\! |
+@lilypond[verbatim,quote]
+\relative {
+ g'8\cresc a b c b c d e\mf |
+ f8\decresc e d c e\> d c b |
+ a1\dim ~ |
+ a2. r4\! |
+}
@end lilypond
@funindex \crescTextCresc
@funindex dimHairpin
Textual marks for dynamic changes can also replace hairpins:
-@lilypond[verbatim,quote,relative=2]
-\crescTextCresc
-c4\< d e f\! |
-\dimTextDecresc
-g4\> e d c\! |
-\dimTextDecr
-e4\> d c b\! |
-\dimTextDim
-d4\> c b a\! |
-\crescHairpin
-\dimHairpin
-c4\< d\! e\> d\! |
+@lilypond[verbatim,quote]
+\relative c'' {
+ \crescTextCresc
+ c4\< d e f\! |
+ \dimTextDecresc
+ g4\> e d c\! |
+ \dimTextDecr
+ e4\> d c b\! |
+ \dimTextDim
+ d4\> c b a\! |
+ \crescHairpin
+ \dimHairpin
+ c4\< d\! e\> d\! |
+}
@end lilypond
@warning{In polyphonic music, a slur must be terminated
in the same voice it began.}
-@lilypond[verbatim,quote,relative=2]
-f4( g a) a8 b(
-a4 g2 f4)
-<c e>2( <b d>2)
+@lilypond[verbatim,quote]
+\relative {
+ f''4( g a) a8 b(
+ a4 g2 f4)
+ <c e>2( <b d>2)
+}
@end lilypond
@cindex slurs, manual placement
Slurs can be solid, dotted, or dashed. Solid is the default slur
style:
-@lilypond[verbatim,quote,relative=1]
-c4( e g2)
-\slurDashed
-g4( e c2)
-\slurDotted
-c4( e g2)
-\slurSolid
-g4( e c2)
+@lilypond[verbatim,quote]
+\relative {
+ c'4( e g2)
+ \slurDashed
+ g4( e c2)
+ \slurDotted
+ c4( e g2)
+ \slurSolid
+ g4( e c2)
+}
@end lilypond
@funindex \slurHalfDashed
second half solid) or half-solid (the first half solid, the second
half dashed):
-@lilypond[verbatim,quote,relative=1]
-c4( e g2)
-\slurHalfDashed
-g4( e c2)
-\slurHalfSolid
-c4( e g2)
-\slurSolid
-g4( e c2)
+@lilypond[verbatim,quote]
+\relative {
+ c'4( e g2)
+ \slurHalfDashed
+ g4( e c2)
+ \slurHalfSolid
+ c4( e g2)
+ \slurSolid
+ g4( e c2)
+}
@end lilypond
@funindex \slurDashPattern
Custom dash patterns for slurs can be defined:
-@lilypond[verbatim,quote,relative=1]
-c4( e g2)
-\slurDashPattern #0.7 #0.75
-g4( e c2)
-\slurDashPattern #0.5 #2.0
-c4( e g2)
-\slurSolid
-g4( e c2)
+@lilypond[verbatim,quote]
+\relative {
+ c'4( e g2)
+ \slurDashPattern #0.7 #0.75
+ g4( e c2)
+ \slurDashPattern #0.5 #2.0
+ c4( e g2)
+ \slurSolid
+ g4( e c2)
+}
@end lilypond
musical sentence are written using the commands @code{\(} and
@code{\)} respectively:
-@lilypond[verbatim,quote,relative=2]
-c4\( d( e) f(
-e2) d\)
+@lilypond[verbatim,quote]
+\relative {
+ c''4\( d( e) f(
+ e2) d\)
+}
@end lilypond
@funindex \phrasingSlurUp
Phrasing slurs can be solid, dotted, or dashed. Solid is the default
style for phrasing slurs:
-@lilypond[verbatim,quote,relative=1]
-c4\( e g2\)
-\phrasingSlurDashed
-g4\( e c2\)
-\phrasingSlurDotted
-c4\( e g2\)
-\phrasingSlurSolid
-g4\( e c2\)
+@lilypond[verbatim,quote]
+\relative {
+ c'4\( e g2\)
+ \phrasingSlurDashed
+ g4\( e c2\)
+ \phrasingSlurDotted
+ c4\( e g2\)
+ \phrasingSlurSolid
+ g4\( e c2\)
+}
@end lilypond
@funindex phrasingSlurHalfDashed
second half solid) or half-solid (the first half solid, the second
half dashed):
-@lilypond[verbatim,quote,relative=1]
-c4\( e g2\)
-\phrasingSlurHalfDashed
-g4\( e c2\)
-\phrasingSlurHalfSolid
-c4\( e g2\)
-\phrasingSlurSolid
-g4\( e c2\)
+@lilypond[verbatim,quote]
+\relative {
+ c'4\( e g2\)
+ \phrasingSlurHalfDashed
+ g4\( e c2\)
+ \phrasingSlurHalfSolid
+ c4\( e g2\)
+ \phrasingSlurSolid
+ g4\( e c2\)
+}
@end lilypond
@funindex \phrasingSlurDashPattern
Custom dash patterns for phrasing slurs can be defined:
-@lilypond[verbatim,quote,relative=1]
-c4\( e g2\)
-\phrasingSlurDashPattern #0.7 #0.75
-g4\( e c2\)
-\phrasingSlurDashPattern #0.5 #2.0
-c4\( e g2\)
-\phrasingSlurSolid
-g4\( e c2\)
+@lilypond[verbatim,quote]
+\relative {
+ c'4\( e g2\)
+ \phrasingSlurDashPattern #0.7 #0.75
+ g4\( e c2\)
+ \phrasingSlurDashPattern #0.5 #2.0
+ c4\( e g2\)
+ \phrasingSlurSolid
+ g4\( e c2\)
+}
@end lilypond
Dash pattern definitions for phrasing slurs have the same structure
Breath marks are entered using @code{\breathe}:
-@lilypond[verbatim,quote,relative=2]
-c2. \breathe d4
+@lilypond[verbatim,quote]
+{ c''2. \breathe d''4 }
@end lilypond
Unlike other expressive marks, a breath mark is not associated with
A breath mark will end an automatic beam; to override this behavior, see
@ref{Manual beams}.
-@lilypond[verbatim,quote,relative=2]
-c8 \breathe d e f g2
+@lilypond[verbatim,quote]
+\relative { c''8 \breathe d e f g2 }
@end lilypond
Musical indicators for breath marks in ancient notation,
indicates the pitch interval that the fall or doit will extend
@emph{beyond} the main note.
-@lilypond[verbatim,quote,relative=2]
-c2\bendAfter #+4
-c2\bendAfter #-4
-c2\bendAfter #+6.5
-c2\bendAfter #-6.5
-c2\bendAfter #+8
-c2\bendAfter #-8
+@lilypond[verbatim,quote]
+\relative c'' {
+ c2\bendAfter #+4
+ c2\bendAfter #-4
+ c2\bendAfter #+6.5
+ c2\bendAfter #-6.5
+ c2\bendAfter #+8
+ c2\bendAfter #-8
+}
@end lilypond
@snippets
A @notation{glissando} is created by appending @code{\glissando}
to a note:
-@lilypond[verbatim,quote,relative=2]
-g2\glissando g'
-c2\glissando c,
-\afterGrace f,1\glissando f'16
+@lilypond[verbatim,quote]
+\relative {
+ g'2\glissando g'
+ c2\glissando c,
+ \afterGrace f,1\glissando f'16
+}
@end lilypond
A glissando can connect notes across staves:
numbered from zero in the order in which they appear in the input
@file{.ly} file.
-@lilypond[verbatim,quote,relative=2]
-<c, e>1\glissando g' |
-<c, e>1\glissando |
-<g' b> |
-\break
-\set glissandoMap = #'((0 . 1) (1 . 0))
-<c, g'>1\glissando |
-<d a'> |
-\set glissandoMap = #'((0 . 0) (0 . 1) (0 . 2))
-c1\glissando |
-<d f a> |
-\set glissandoMap = #'((2 . 0) (1 . 0) (0 . 1))
-<f d a'>1\glissando |
-<c c'> |
+@lilypond[verbatim,quote]
+\relative {
+ <c' e>1\glissando g' |
+ <c, e>1\glissando |
+ <g' b> |
+ \break
+ \set glissandoMap = #'((0 . 1) (1 . 0))
+ <c, g'>1\glissando |
+ <d a'> |
+ \set glissandoMap = #'((0 . 0) (0 . 1) (0 . 2))
+ c1\glissando |
+ <d f a> |
+ \set glissandoMap = #'((2 . 0) (1 . 0) (0 . 1))
+ <f d a'>1\glissando |
+ <c c'> |
+}
@end lilypond
Different styles of glissandi can be created. For details, see
An @notation{arpeggio} on a chord (also known as a broken chord)
is denoted by appending @code{\arpeggio} to the chord construct:
-@lilypond[verbatim,quote,relative=1]
-<c e g c>1\arpeggio
+@lilypond[verbatim,quote]
+\relative { <c' e g c>1\arpeggio }
@end lilypond
Different types of arpeggios may be written.
@code{\arpeggioNormal} reverts to a normal arpeggio:
-@lilypond[verbatim,quote,relative=1]
-<c e g c>2\arpeggio
+@lilypond[verbatim,quote]
+\relative {
+ <c' e g c>2\arpeggio
-\arpeggioArrowUp
-<c e g c>2\arpeggio
+ \arpeggioArrowUp
+ <c e g c>2\arpeggio
-\arpeggioArrowDown
-<c e g c>2\arpeggio
+ \arpeggioArrowDown
+ <c e g c>2\arpeggio
-\arpeggioNormal
-<c e g c>2\arpeggio
+ \arpeggioNormal
+ <c e g c>2\arpeggio
+}
@end lilypond
@cindex arpeggio symbols, special
Special @emph{bracketed} arpeggio symbols can be created:
-@lilypond[verbatim,quote,relative=1]
-<c e g c>2
+@lilypond[verbatim,quote]
+\relative {
+ <c' e g c>2
-\arpeggioBracket
-<c e g c>2\arpeggio
+ \arpeggioBracket
+ <c e g c>2\arpeggio
-\arpeggioParenthesis
-<c e g c>2\arpeggio
+ \arpeggioParenthesis
+ <c e g c>2\arpeggio
-\arpeggioParenthesisDashed
-<c e g c>2\arpeggio
+ \arpeggioParenthesisDashed
+ <c e g c>2\arpeggio
-\arpeggioNormal
-<c e g c>2\arpeggio
+ \arpeggioNormal
+ <c e g c>2\arpeggio
+}
@end lilypond
The dash properties of the parenthesis arpeggio are controlled
Longer trills with an extender line are made with
@code{\startTrillSpan} and @code{\stopTrillSpan}:
-@lilypond[verbatim,quote,relative=2]
-d1\startTrillSpan
-d1
-c2\stopTrillSpan
-r2
+@lilypond[verbatim,quote]
+\relative {
+ d''1\startTrillSpan
+ d1
+ c2\stopTrillSpan
+ r2
+}
@end lilypond
A trill spanner crossing a line break will restart exactly above
the first note on the new line.
-@lilypond[ragged-right,verbatim,quote,relative=2]
-d1\startTrillSpan
-\break
-d1
-c2\stopTrillSpan
-r2
+@lilypond[ragged-right,verbatim,quote]
+\relative {
+ d''1\startTrillSpan
+ \break
+ d1
+ c2\stopTrillSpan
+ r2
+}
@end lilypond
Consecutive trill spans will work without explicit
@code{\stopTrillSpan} commands, since successive trill spanners will
automatically become the right bound of the previous trill.
-@lilypond[verbatim,quote,relative=2]
-d1\startTrillSpan
-d1
-b1\startTrillSpan
-d2\stopTrillSpan
-r2
+@lilypond[verbatim,quote]
+\relative {
+ d''1\startTrillSpan
+ d1
+ b1\startTrillSpan
+ d2\stopTrillSpan
+ r2
+}
@end lilypond
Trills can also be combined with grace notes. The syntax of this
construct and the method to precisely position the grace notes are
described in @ref{Grace notes}.
-@lilypond[verbatim,quote,relative=2]
-d1~\afterGrace
-d1\startTrillSpan { c32[ d]\stopTrillSpan }
-c2 r2
+@lilypond[verbatim,quote]
+\relative {
+ d''1~\afterGrace
+ d1\startTrillSpan { c32[ d]\stopTrillSpan }
+ c2 r2
+}
@end lilypond
@cindex pitched trills
argument is the main note, and the second is the @emph{trilled}
note, printed as a stemless note head in parentheses.
-@lilypond[verbatim,quote,relative=2]
-\pitchedTrill
-d2\startTrillSpan fis
-d2
-c2\stopTrillSpan
-r2
+@lilypond[verbatim,quote]
+\relative {
+ \pitchedTrill
+ d''2\startTrillSpan fis
+ d2
+ c2\stopTrillSpan
+ r2
+}
@end lilypond
@cindex pitched trill with accidental
to be added manually. Only the accidental of the first pitched trill
in a measure is printed.
-@lilypond[verbatim,quote,relative=2]
-\pitchedTrill
-eis4\startTrillSpan fis
-eis4\stopTrillSpan
-\pitchedTrill
-eis4\startTrillSpan cis
-eis4\stopTrillSpan
-\pitchedTrill
-eis4\startTrillSpan fis
-eis4\stopTrillSpan
-\pitchedTrill
-eis4\startTrillSpan fis!
-eis4\stopTrillSpan
+@lilypond[verbatim,quote]
+\relative {
+ \pitchedTrill
+ eis''4\startTrillSpan fis
+ eis4\stopTrillSpan
+ \pitchedTrill
+ eis4\startTrillSpan cis
+ eis4\stopTrillSpan
+ \pitchedTrill
+ eis4\startTrillSpan fis
+ eis4\stopTrillSpan
+ \pitchedTrill
+ eis4\startTrillSpan fis!
+ eis4\stopTrillSpan
+}
@end lilypond
@predefined
The string on which a note should be played may be indicated by
appending @code{\@var{number}} to a note.
-@lilypond[verbatim,quote,relative=0]
+@lilypond[verbatim,quote,fragment]
\clef "treble_8"
c4\5 e\4 g2\3
-<c,\5 e\4 g\3>1
+<c\5 e\4 g\3>1
@end lilypond
When fingerings and string indications are used together, their
applied to whole chords or single notes @emph{outside} of chords,
fingerings are placed using a different mechanism.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
\clef "treble_8"
g4\3-0
g-0\3
be printed in Roman numerals and placed below the staff rather
than above.
-@lilypond[verbatim,quote,relative=2]
-c2\2
+@lilypond[verbatim,quote,fragment]
+\clef "treble_8"
+c'2\2
a\3
\romanStringNumbers
-c\2
+c'\2
\set stringNumberOrientations = #'(down)
a\3
\arabicStringNumbers
@warning{If the number is entered in Scheme notation, remember to append
a space before following it with a closing @code{>} or similar.}
-@lilypond[quote,verbatim,relative=0]
+@lilypond[quote,verbatim,fragment]
\clef "treble_8"
c4\rightHandFinger #1
e\rightHandFinger #2
g\rightHandFinger #3
-c\rightHandFinger #4
-<c,\rightHandFinger #1 e\rightHandFinger #2
- g\rightHandFinger #3 c\rightHandFinger #4 >1
+c'\rightHandFinger #4
+<c\rightHandFinger #1 e\rightHandFinger #2
+ g\rightHandFinger #3 c'\rightHandFinger #4 >1
@end lilypond
For convenience, you can abbreviate @code{\rightHandFinger} to something
This example demonstrates how to include guitar position and
barring indications.
-@lilypond[quote,ragged-right,verbatim,relative=0]
-\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
+@lilypond[quote,ragged-right,verbatim,fragment]
+\relative {
+ \clef "treble_8"
+ b,16 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
+}
@end lilypond
@seealso
it skips all events, including tempo and instrument changes. You have
been warned.
-@lilypond[quote,relative=2,ragged-right,verbatim]
-c8 d
-\set Score.skipTypesetting = ##t
-e8 e e e e e e e
-\set Score.skipTypesetting = ##f
-c8 d b bes a g c2
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ c''8 d
+ \set Score.skipTypesetting = ##t
+ e8 e e e e e e e
+ \set Score.skipTypesetting = ##f
+ c8 d b bes a g c2
+}
@end lilypond
In polyphonic music, @code{Score.skipTypesetting} will affect all
Whenever a voice switches to another staff, a line connecting the
notes can be printed automatically:
-@lilypond[quote,verbatim,relative=1]
+@lilypond[quote,verbatim]
\new PianoStaff <<
\new Staff = "one" {
\showStaffSwitch
- c1
+ c'1
\change Staff = "two"
b2 a
}
(@notation{sos.}), and @notation{una corda} (@notation{U.C.}).
Sustain pedals are also found on vibraphones and celestas.
-@lilypond[quote,verbatim,relative=2]
-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
+@lilypond[quote,verbatim]
+\relative {
+ c''4\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
+}
@end lilypond
@cindex pedal indication styles
The sustain pedal and the una corda pedal use the text style by default
while the sostenuto pedal uses mixed by default.
-@lilypond[quote,verbatim,relative=2]
-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 "|."
+@lilypond[quote,verbatim]
+\relative {
+ c''4\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 "|."
+}
@end lilypond
The placement of the pedal commands matches the physical movement of the
pedals are D, C, and B on the left and E, F, G, and A on the right.
The position of the pedals may be indicated with text marks:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\textLengthOn
-cis1_\markup \concat \vcenter {
+cis''1_\markup \concat \vcenter {
[D \flat C \sharp B|E \sharp F \sharp G A \flat] }
-c!1_\markup \concat \vcenter {
+c''!1_\markup \concat \vcenter {
[ C \natural ] }
@end lilypond
or pedal diagrams:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\textLengthOn
-cis1_\markup { \harp-pedal #"^v-|vv-^" }
-c!1_\markup { \harp-pedal #"^o--|vv-^" }
+cis''1_\markup { \harp-pedal #"^v-|vv-^" }
+c''!1_\markup { \harp-pedal #"^o--|vv-^" }
@end lilypond
The @code{\harp-pedal} command accepts a string of characters, where
derived from Dutch note naming conventions. To use other names
for accidentals, see @ref{Note names in other languages}.
-@lilypond[verbatim,quote,relative=2]
-ais1 aes aisis aeses
+@lilypond[verbatim,quote,fragment]
+\relative c'' { ais1 aes aisis aeses }
@end lilypond
A natural pitch is entered as a simple note name; no suffix is
required. A natural sign will be printed when needed to cancel
the effect of an earlier accidental or key signature.
-@lilypond[verbatim,quote,relative=2]
-a4 aes a2
+@lilypond[verbatim,quote,fragment]
+\relative c'' { a4 aes a2 }
@end lilypond
@cindex quarter tones
Quarter tones may be added; the following is a series of Cs with
increasing pitches:
-@lilypond[verbatim,quote,relative=2]
-ceseh1 ces ceh c cih cis cisih
+@lilypond[verbatim,quote,fragment]
+\relative c'' { ceseh1 ces ceh c cih cis cisih }
@end lilypond
be obtained by adding the question mark@tie{}@code{?} after the
pitch.
-@lilypond[verbatim,quote,relative=2]
-cis cis cis! cis? c c c! c?
+@lilypond[verbatim,quote,fragment]
+\relative c'' { cis cis cis! cis? c c c! c? }
@end lilypond
@cindex accidental on tied note
Accidentals on tied notes are only printed at the beginning of a
new system:
-@lilypond[verbatim,quote,relative=2,ragged-right]
-cis1~ 1~
-\break
-cis
+@lilypond[verbatim,quote,fragment,ragged-right]
+\relative c'' {
+ cis1~ 1~
+ \break
+ cis
+}
@end lilypond
@code{eeses}@tie{}/@tie{}@code{eses}. Sometimes only these
contracted names are defined in the corresponding language files.
-@lilypond[verbatim,quote,relative=2]
-a2 as e es a ases e eses
+@lilypond[verbatim,quote,fragment]
+\relative c'' { a2 as e es a ases e eses }
@end lilypond
Without any explicit command, the default clef for LilyPond is the
treble (or @emph{G}) clef.
-@lilypond[verbatim,quote,relative=1,ragged-right]
-c2 c
+@lilypond[verbatim,quote,fragment,ragged-right]
+c'2 c'
@end lilypond
However, the clef can be changed by using the @code{\clef} command and
an appropriate clef name. @emph{Middle C} is shown in each of the
following examples.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
\clef treble
-c2 c
+c'2 c'
\clef alto
-c2 c
+c'2 c'
\clef tenor
-c2 c
+c'2 c'
\clef bass
-c2 c
+c'2 c'
@end lilypond
For the full range of possible clef names see @ref{Clef styles}.
Other integers can be used if required. Clef names containing
non-alphabetic characters must be enclosed in quotes
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
\clef treble
-c2 c
+c'2 c'
\clef "treble_8"
-c2 c
+c'2 c'
\clef "bass^15"
-c2 c
+c'2 c'
\clef "alto_2"
-c2 c
+c'2 c'
\clef "G_8"
-c2 c
+c'2 c'
\clef "F^5"
-c2 c
+c'2 c'
@end lilypond
Optional octavation can be obtained by enclosing the numeric
argument in parentheses or brackets:
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
\clef "treble_(8)"
-c2 c
+c'2 c'
\clef "bass^[15]"
-c2 c
+c'2 c'
@end lilypond
The pitches are displayed as if the numeric argument were
as a @emph{warning} clef, as well as the beginning of the next.
This @emph{warning} clef can be suppressed.
-@lilypond[verbatim,quote,relative=1]
-\clef treble { c2 c } \break
-\clef bass { c2 c } \break
+@lilypond[verbatim,quote,fragment]
+\clef treble { c'2 c' } \break
+\clef bass { c'2 c' } \break
\clef alto
\set Staff.explicitClefVisibility = #end-of-line-invisible
- { c2 c } \break
+ { c'2 c' } \break
\unset Staff.explicitClefVisibility
-\clef bass { c2 c } \break
+\clef bass { c'2 c' } \break
@end lilypond
By default, a clef that has previously been printed will not be
will be ignored. The the command
@code{\set Staff.forceClef = ##t} changes this behaviour.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
\clef treble
- c1
+ c'1
\clef treble
- c1
+ c'1
\set Staff.forceClef = ##t
- c1
+ c'1
\clef treble
- c1
+ c'1
@end lilypond
When there is a manual clef change, the glyph of the changed clef
will be smaller than normal. This behaviour can be overridden.
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote,fragment]
\clef "treble"
- c1
+ c'1
\clef "bass"
- c1
+ c'1
\clef "treble"
- c1
+ c'1
\override Staff.Clef.full-size-change = ##t
\clef "bass"
- c1
+ c'1
\clef "treble"
- c1
+ c'1
\revert Staff.Clef.full-size-change
\clef "bass"
- c1
+ c'1
\clef "treble"
- c1
+ c'1
@end lilypond
@snippets
need to be applied, as a separate @code{\override}, to the
@var{ClefModifier} grob.
-@lilypond[fragment,quote,verbatim,relative=1]
+@lilypond[fragment,quote,verbatim]
\new Staff \with {
\override Clef.color = #blue
\override ClefModifier.color = #red
}
-\clef "treble_8" c4
+\clef "treble_8" c'4
@end lilypond
@code{\ionian}, @code{\dorian}, @code{\phrygian}, @code{\lydian},
@code{\mixolydian}, @code{\aeolian}, and @code{\locrian}.
-@lilypond[verbatim,quote,relative=2]
-\key g \major
-fis1
-f
-fis
+@lilypond[verbatim,quote,fragment]
+\relative {
+ \key g \major
+ fis''1
+ f
+ fis
+}
@end lilypond
Additional modes can be defined, by listing the alterations
accidentals are placed within the octave ending at that staff
position.
-@lilypond[verbatim, quote,relative=0]
+@lilypond[verbatim, quote,fragment]
\override Staff.KeySignature.flat-positions = #'((-5 . 5))
\override Staff.KeyCancellation.flat-positions = #'((-5 . 5))
-\clef bass \key es \major es g bes d
-\clef treble \bar "||" \key es \major es g bes d
+\clef bass \key es \major es g bes d'
+\clef treble \bar "||" \key es \major es' g' bes' d''
\override Staff.KeySignature.sharp-positions = #'(2)
-\bar "||" \key b \major b fis b2
+\bar "||" \key b \major b' fis' b'2
@end lilypond
@snippets
@notation{Ottava brackets} introduce an extra transposition of an
octave for the staff:
-@lilypond[verbatim,quote,relative=2]
-a2 b
-\ottava #-2
-a2 b
-\ottava #-1
-a2 b
-\ottava #0
-a2 b
-\ottava #1
-a2 b
-\ottava #2
-a2 b
+@lilypond[verbatim,quote]
+\relative a' {
+ a2 b
+ \ottava #-2
+ a2 b
+ \ottava #-1
+ a2 b
+ \ottava #0
+ a2 b
+ \ottava #1
+ a2 b
+ \ottava #2
+ a2 b
+}
@end lilypond
@snippets
The appearance of note heads may be altered:
-@lilypond[verbatim,quote,relative=2]
-c4 b
-\override NoteHead.style = #'cross
-c4 b
-\revert NoteHead.style
-a b
-\override NoteHead.style = #'harmonic
-a b
-\revert NoteHead.style
-c4 d e f
+@lilypond[verbatim,quote]
+\relative c'' {
+ c4 b
+ \override NoteHead.style = #'cross
+ c4 b
+ \revert NoteHead.style
+ a b
+ \override NoteHead.style = #'harmonic
+ a b
+ \revert NoteHead.style
+ c4 d e f
+}
@end lilypond
To see all note head styles, see @ref{Note head styles}.
note head in both staff and tablature contexts and can be used to
represent any musical meaning:
-@lilypond[verbatim,quote,relative=2]
-c4 b
-\xNotesOn
- a b c4 b
-\xNotesOff
-c4 d
+@lilypond[verbatim,quote]
+\relative {
+ c''4 b
+ \xNotesOn
+ a b c4 b
+ \xNotesOff
+ c4 d
+}
@end lilypond
The music function form of this predefined command may be used
inside and outside chords to generate crossed note heads in both
staff and tablature contexts:
-@lilypond[verbatim,quote,relative=2]
-c4 b
-\xNote { e f }
-c b < g \xNote c f > b
+@lilypond[verbatim,quote]
+\relative {
+ c''4 b
+ \xNote { e f }
+ c b < g \xNote c f > b
+}
@end lilypond
As synonyms for @code{\xNote}, @code{\xNotesOn} and @code{\xNotesOff},
There is also a similar shorthand for diamond shapes:
-@lilypond[verbatim,quote,relative=2]
-<c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic> f\harmonic
+@lilypond[verbatim,quote]
+\relative c'' {
+ <c f\harmonic>2 <d a'\harmonic>4 <c g'\harmonic> f\harmonic
+}
@end lilypond
@predefined
Shape note heads can be produced in Sacred Harp, Southern Harmony,
Funk (Harmonica Sacra), Walker, and Aiken (Christian Harmony) styles:
-@lilypond[verbatim,quote,relative=2]
-\aikenHeads
-c, d e f g2 a b1 c \break
-\sacredHarpHeads
-c,4 d e f g2 a b1 c \break
-\southernHarmonyHeads
-c,4 d e f g2 a b1 c \break
-\funkHeads
-c,4 d e f g2 a b1 c \break
-\walkerHeads
-c,4 d e f g2 a b1 c \break
+@lilypond[verbatim,quote]
+\relative c'' {
+ \aikenHeads
+ c, d e f g2 a b1 c \break
+ \sacredHarpHeads
+ c,4 d e f g2 a b1 c \break
+ \southernHarmonyHeads
+ c,4 d e f g2 a b1 c \break
+ \funkHeads
+ c,4 d e f g2 a b1 c \break
+ \walkerHeads
+ c,4 d e f g2 a b1 c \break
+}
@end lilypond
@funindex \key
in a minor key, the scale step can be determined from the relative
major:
-@lilypond[verbatim,quote,relative=2]
-\key a \minor
-\aikenHeads
-a b c d e2 f g1 a \break
-\aikenHeadsMinor
-a,4 b c d e2 f g1 a \break
-\sacredHarpHeadsMinor
-a,2 b c d \break
-\southernHarmonyHeadsMinor
-a2 b c d \break
-\funkHeadsMinor
-a2 b c d \break
-\walkerHeadsMinor
-a2 b c d \break
-
+@lilypond[verbatim,quote]
+\relative c'' {
+ \key a \minor
+ \aikenHeads
+ a b c d e2 f g1 a \break
+ \aikenHeadsMinor
+ a,4 b c d e2 f g1 a \break
+ \sacredHarpHeadsMinor
+ a,2 b c d \break
+ \southernHarmonyHeadsMinor
+ a2 b c d \break
+ \funkHeadsMinor
+ a2 b c d \break
+ \walkerHeadsMinor
+ a2 b c d \break
+}
@end lilypond
the performer may choose any pitch but should play the specified
rhythm. Such note heads can be created:
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Voice \with {
\consists "Pitch_squash_engraver"
-} {
- e8 e g a a16( bes) a8 g
+} \relative {
+ e''8 e g a a16( bes) a8 g
\improvisationOn
e8 ~
2 ~ 8 f4 f8 ~
A single repeat without an alternate ending:
-@lilypond[verbatim,quote,relative=2]
-\repeat volta 2 { c4 d e f }
-c2 d
-\repeat volta 2 { d4 e f g }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat volta 2 { c''4 d e f }
+ c2 d
+ \repeat volta 2 { d4 e f g }
+}
@end lilypond
An @q{opening} repeat mark is not, by default, printed in the first full
measure. However it is possible to add one by using @code{\bar ".|:"}
before the first note.
-@lilypond[verbatim,fragment,quote,relative=2]
-\repeat volta 2 { \bar ".|:" c4 d e f }
-c2 d
-\repeat volta 2 { d4 e f g }
+@lilypond[verbatim,fragment,quote]
+\relative {
+ \repeat volta 2 { \bar ".|:" c''4 d e f }
+ c2 d
+ \repeat volta 2 { d4 e f g }
+}
@end lilypond
Alternative endings can be produced using @code{\alternative}. Each
A single repeat with one alternate ending:
-@lilypond[verbatim,quote,relative=2]
-\repeat volta 2 { c4 d e f | }
-\alternative {
- { c2 e | }
- { f2 g | }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat volta 2 { c''4 d e f | }
+ \alternative {
+ { c2 e | }
+ { f2 g | }
+ }
+ c1
}
-c1
@end lilypond
Multiple repeats with one alternate ending:
-@lilypond[verbatim,quote,relative=2]
-\repeat volta 4 { c4 d e f | }
-\alternative {
- { c2 e | }
- { f2 g | }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat volta 4 { c''4 d e f | }
+ \alternative {
+ { c2 e | }
+ { f2 g | }
+ }
+ c1
}
-c1
@end lilypond
Multiple repeats with more than one alternate ending:
-@lilypond[verbatim,quote,relative=2]
-\repeat volta 3 { c4 d e f | }
-\alternative {
- { c2 e | }
- { f2 g | }
- { a2 g | }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat volta 3 { c''4 d e f | }
+ \alternative {
+ { c2 e | }
+ { f2 g | }
+ { a2 g | }
+ }
+ c1
}
-c1
@end lilypond
@warning{If there are two or more alternatives, nothing should appear
bar lines. Do not use @code{\partial} commands or bar checks
where these repeat signs are printed:
-@lilypond[verbatim,quote,relative=1]
-% no \partial here
-c4 e g % no bar check here
-% no \partial here
-\repeat volta 4 {
- e4 |
- c2 e |
+@lilypond[verbatim,quote]
+\relative { % no \partial here
+ c'4 e g % no bar check here
% no \partial here
- g4 g g % no bar check here
+ \repeat volta 4 {
+ e4 |
+ c2 e |
+ % no \partial here
+ g4 g g % no bar check here
+ }
+ % no \partial here
+ g4 |
+ a2 a |
+ g1 |
}
-% no \partial here
-g4 |
-a2 a |
-g1 |
@end lilypond
Similarly, if a repeat begins with the initial partial measure of
in the above example, except that in this case the @code{\partial}
command is required at the beginning of the score:
-@lilypond[verbatim,quote,relative=1]
-\partial 4 % required
-\repeat volta 4 {
- e4 |
- c2 e |
+@lilypond[verbatim,quote]
+\relative {
+ \partial 4 % required
+ \repeat volta 4 {
+ e'4 |
+ c2 e |
+ % no \partial here
+ g4 g g % no bar check here
+ }
% no \partial here
- g4 g g % no bar check here
+ g4 |
+ a2 a |
+ g1 |
}
-% no \partial here
-g4 |
-a2 a |
-g1 |
@end lilypond
@cindex repeats, with ties
Ties may be added to a second ending:
-@lilypond[verbatim,quote,relative=2]
-c1
-\repeat volta 2 { c4 d e f~ }
-\alternative {
- { f2 d }
- { f2\repeatTie f, }
+@lilypond[verbatim,quote]
+\relative {
+ c''1
+ \repeat volta 2 { c4 d e f~ }
+ \alternative {
+ { f2 d }
+ { f2\repeatTie f, }
+ }
}
@end lilypond
Away from a repeat:
-@lilypond[verbatim,quote,relative=1]
-e1
-\inStaffSegno
-f2 g a b
-c1_"D.S." \bar "|."
+@lilypond[verbatim,quote]
+\relative {
+ e'1
+ \inStaffSegno
+ f2 g a b
+ c1_"D.S." \bar "|."
+}
@end lilypond
At the start of a repeat:
-@lilypond[verbatim,quote,relative=1]
-e1
-\repeat volta 2 {
- \inStaffSegno % start repeat
- f2 g a b
+@lilypond[verbatim,quote]
+\relative {
+ e'1
+ \repeat volta 2 {
+ \inStaffSegno % start repeat
+ f2 g a b
+ }
+ c1_"D.S." \bar "|."
}
-c1_"D.S." \bar "|."
@end lilypond
At the end of a repeat:
-@lilypond[verbatim,quote,relative=1]
-e1
-\repeat volta 2 {
+@lilypond[verbatim,quote]
+\relative {
+ e'1
+ \repeat volta 2 {
+ f2 g a b
+ \inStaffSegno % end repeat
+ }
f2 g a b
- \inStaffSegno % end repeat
+ c1_"D.S." \bar "|."
}
-f2 g a b
-c1_"D.S." \bar "|."
@end lilypond
Between two repeats:
-@lilypond[verbatim,quote,relative=1]
-e1
-\repeat volta 2 {
- f2 g a b
-}
-\inStaffSegno % double repeat
-\repeat volta 2 {
- f2 g a b
+@lilypond[verbatim,quote]
+\relative {
+ e'1
+ \repeat volta 2 {
+ f2 g a b
+ }
+ \inStaffSegno % double repeat
+ \repeat volta 2 {
+ f2 g a b
+ }
+ c1_"D.S." \bar "|."
}
-c1_"D.S." \bar "|."
@end lilypond
Alternative bar line symbols can be obtained by setting (in the Score
selected from the pre-defined types or types previously defined
with the @code{\defineBarLine} command (see @ref{Bar lines}).
-@lilypond[verbatim,quote,relative=1]
+@lilypond[verbatim,quote]
\defineBarLine ":|.S[" #'(":|." "S[" "")
\defineBarLine "]" #'("]" "" "")
-e1
-\repeat volta 2 {
- f2 g a b
- \once \set Score.endRepeatSegnoType = ":|.S["
- \inStaffSegno
+\relative {
+ e'1
+ \repeat volta 2 {
+ f2 g a b
+ \once \set Score.endRepeatSegnoType = ":|.S["
+ \inStaffSegno
+ }
+ f2 g \bar "]" a b
+ c1_"D.S." \bar "|."
}
-f2 g \bar "]" a b
-c1_"D.S." \bar "|."
@end lilypond
@snippets
@item start-repeat
Print a @code{.|:} bar line.
-@lilypond[verbatim,quote,relative=2]
-c1
-\set Score.repeatCommands = #'(start-repeat)
-d4 e f g
-c1
+@lilypond[verbatim,quote]
+\relative {
+ c''1
+ \set Score.repeatCommands = #'(start-repeat)
+ d4 e f g
+ c1
+}
@end lilypond
As per standard engraving practice, repeat signs are not printed
@item end-repeat
Print a @code{:|.} bar line:
-@lilypond[verbatim,quote,relative=2]
-c1
-d4 e f g
-\set Score.repeatCommands = #'(end-repeat)
-c1
+@lilypond[verbatim,quote]
+\relative {
+ c''1
+ d4 e f g
+ \set Score.repeatCommands = #'(end-repeat)
+ c1
+}
@end lilypond
@item (volta @var{number}) @dots{} (volta #f)
Create a new volta with the specified number. The volta bracket must
be explicitly terminated, or it will not be printed.
-@lilypond[verbatim,quote,relative=2]
-f4 g a b
-\set Score.repeatCommands = #'((volta "2"))
-g4 a g a
-\set Score.repeatCommands = #'((volta #f))
-c1
+@lilypond[verbatim,quote]
+\relative {
+ f''4 g a b
+ \set Score.repeatCommands = #'((volta "2"))
+ g4 a g a
+ \set Score.repeatCommands = #'((volta #f))
+ c1
+}
@end lilypond
@end table
Multiple repeat commands may occur at the same point:
-@lilypond[verbatim,quote,relative=2]
-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
-\set Score.repeatCommands = #'((volta #f))
+@lilypond[verbatim,quote]
+\relative {
+ f''4 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
+ \set Score.repeatCommands = #'((volta #f))
+}
@end lilypond
@cindex volta bracket with text
@code{@var{repeatcount}} is the number of times
@code{@var{musicexpr}} is repeated.
-@lilypond[verbatim,quote,relative=2]
-\repeat unfold 2 { c4 d e f }
-c1
+@lilypond[verbatim,quote]
+\relative {
+ \repeat unfold 2 { c''4 d e f }
+ c1
+}
@end lilypond
In some cases, especially in a @code{\relative} context, the
Unfold repeats can be made with alternate endings.
-@lilypond[verbatim,quote,relative=2]
-\repeat unfold 2 { c4 d e f }
-\alternative {
- { c2 g' }
- { c,2 b }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat unfold 2 { c''4 d e f }
+ \alternative {
+ { c2 g' }
+ { c,2 b }
+ }
+ c1
}
-c1
@end lilypond
If there are more repeats than there are alternate endings, the first
alternative is applied multiple times until the remaining alternatives
make up the total number of repeats.
-@lilypond[verbatim,quote,relative=2]
-\repeat unfold 4 { c4 d e f }
-\alternative {
- { c2 g' }
- { c,2 b }
- { e2 d }
- }
-c1
+@lilypond[verbatim,quote]
+\relative {
+ \repeat unfold 4 { c''4 d e f }
+ \alternative {
+ { c2 g' }
+ { c,2 b }
+ { e2 d }
+ }
+ c1
+}
@end lilypond
If there are more alternate endings than repeats then only the first
alternatives are applied. The remaining alternatives will be ignored
and not printed.
-@lilypond[verbatim,quote,relative=2]
-\repeat unfold 2 { c4 d e f }
-\alternative {
- { c2 g' }
- { c,2 b }
- { e2 d }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat unfold 2 { c''4 d e f }
+ \alternative {
+ { c2 g' }
+ { c,2 b }
+ { e2 d }
+ }
+ c1
}
-c1
@end lilypond
It is also possible to nest multiple @code{unfold} functions (with or
without alternate endings).
-@lilypond[verbatim,quote,relative=2]
-\repeat unfold 2 {
- \repeat unfold 2 { c4 d e f }
- \alternative {
- { c2 g' }
- { c,2 b }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat unfold 2 {
+ \repeat unfold 2 { c''4 d e f }
+ \alternative {
+ { c2 g' }
+ { c,2 b }
+ }
}
+ c1
}
-c1
@end lilypond
Chord constructs can be repeated by the chord repetition symbol
Patterns that are shorter than one measure are replaced by slashes.
-@lilypond[verbatim,quote,relative=2]
-\repeat percent 4 { c128 d e f }
-\repeat percent 4 { c64 d e f }
-\repeat percent 5 { c32 d e f }
-\repeat percent 4 { c16 d e f }
-\repeat percent 4 { c8 d }
-\repeat percent 4 { c4 }
-\repeat percent 2 { c2 }
+@lilypond[verbatim,quote]
+\relative c'' {
+ \repeat percent 4 { c128 d e f }
+ \repeat percent 4 { c64 d e f }
+ \repeat percent 5 { c32 d e f }
+ \repeat percent 4 { c16 d e f }
+ \repeat percent 4 { c8 d }
+ \repeat percent 4 { c4 }
+ \repeat percent 2 { c2 }
+}
@end lilypond
Patterns of one or two measures are replaced by percent-like symbols.
-@lilypond[verbatim,quote,relative=2]
-\repeat percent 2 { c4 d e f }
-\repeat percent 2 { c2 d }
-\repeat percent 2 { c1 }
+@lilypond[verbatim,quote]
+\relative c'' {
+ \repeat percent 2 { c4 d e f }
+ \repeat percent 2 { c2 d }
+ \repeat percent 2 { c1 }
+}
@end lilypond
-@lilypond[verbatim,quote,relative=2]
-\repeat percent 3 { c4 d e f | c2 g' }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat percent 3 { c''4 d e f | c2 g' }
+}
@end lilypond
Patterns that are shorter than one measure but contain mixed durations
use a double-percent symbol.
-@lilypond[verbatim,quote,relative=2]
-\repeat percent 4 { c8. <d f>16 }
-\repeat percent 2 { \tuplet 3/2 { r8 c d } e4 }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat percent 4 { c''8. <d f>16 }
+ \repeat percent 2 { \tuplet 3/2 { r8 c d } e4 }
+}
@end lilypond
@snippets
To place tremolo marks between notes, use @code{\repeat} with
tremolo style:
-@lilypond[quote,verbatim,relative=2]
-\repeat tremolo 8 { c16 d }
-\repeat tremolo 6 { c16 d }
-\repeat tremolo 2 { c16 d }
+@lilypond[quote,verbatim]
+\relative c'' {
+ \repeat tremolo 8 { c16 d }
+ \repeat tremolo 6 { c16 d }
+ \repeat tremolo 2 { c16 d }
+}
@end lilypond
The @code{\repeat tremolo} syntax expects exactly two notes within
beam is added to the note's stem. If @code{@var{N}} is omitted,
the last value is used:
-@lilypond[quote,verbatim,relative=2]
-c2:8 c:32
-c: c:
+@lilypond[quote,verbatim]
+\relative {
+ c''2:8 c:32
+ c: c:
+}
@end lilypond
@snippets
specified. Shorter values are possible, but only as beamed notes.
@c Two 64th notes are needed to obtain beams
-@lilypond[quote,verbatim,relative=2]
-\time 8/1
-c\longa c\breve c1 c2
-c4 c8 c16 c32 c64 c128 c128
+@lilypond[quote,verbatim]
+\relative {
+ \time 8/1
+ c''\longa c\breve c1 c2
+ c4 c8 c16 c32 c64 c128 c128
+}
@end lilypond
Here are the same durations with automatic beaming turned off.
@c not strictly "writing rhythms"; more of a "displaying" thing,
@c but it's ok here. -gp
-@lilypond[quote,verbatim,relative=2]
-\time 8/1
-\autoBeamOff
-c\longa c\breve c1 c2
-c4 c8 c16 c32 c64 c128 c128
+@lilypond[quote,verbatim]
+\relative {
+ \time 8/1
+ \autoBeamOff
+ c''\longa c\breve c1 c2
+ c4 c8 c16 c32 c64 c128 c128
+}
@end lilypond
A note with the duration of a quadruple breve may be entered with
entered duration. The default for the first note is a quarter
note.
-@lilypond[quote,verbatim,relative=2]
-a a a2 a a4 a a1 a
+@lilypond[quote,verbatim]
+\relative { a' a a2 a a4 a a1 a }
@end lilypond
Durations occuring on their own within a music sequence will take
their pitches from the preceding note or chord.
-@lilypond[quote,verbatim,relative=2]
-\time 8/1
-c \longa \breve 1 2
-4 8 16 32 64 128 128
+@lilypond[quote,verbatim]
+\relative {
+ \time 8/1
+ c'' \longa \breve 1 2
+ 4 8 16 32 64 128 128
+}
@end lilypond
@cindex notes, dotted
duration. Double-dotted notes are specified by appending two
dots, and so on.
-@lilypond[quote,verbatim,relative=2]
-a4 b c4. b8 a4. b4.. c8.
+@lilypond[quote,verbatim]
+\relative { a'4 b c4. b8 a4. b4.. c8. }
@end lilypond
Some durations cannot be represented with just binary durations
optionally with a bracket. The most common tuplets are triplets
(3@tie{}notes sound within the duration normally allowed for@tie{}2).
-@lilypond[quote,verbatim,relative=2]
-a2 \tuplet 3/2 { b4 4 4 }
-c4 c \tuplet 3/2 { b4 a g }
+@lilypond[quote,verbatim]
+\relative {
+ a'2 \tuplet 3/2 { b4 4 4 }
+ c4 c \tuplet 3/2 { b4 a g }
+}
@end lilypond
@cindex tuplet grouping
to specify the duration of one tuplet group directly before the music
in order to have the tuplets grouped automatically:
-@lilypond[quote,verbatim,relative=2]
-g2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
+@lilypond[quote,verbatim]
+\relative {
+ g'2 r8 \tuplet 3/2 8 { cis16 d e e f g g f e }
+}
@end lilypond
@cindex tuplet bracket placement
Tuplet brackets may be manually placed above or below the staff:
-@lilypond[quote,verbatim,relative=2]
-\tupletUp \tuplet 3/2 { c8 d e }
-\tupletNeutral \tuplet 3/2 { c8 d e }
-\tupletDown \tuplet 3/2 { f,8 g a }
-\tupletNeutral \tuplet 3/2 { f8 g a }
+@lilypond[quote,verbatim]
+\relative {
+ \tupletUp \tuplet 3/2 { c''8 d e }
+ \tupletNeutral \tuplet 3/2 { c8 d e }
+ \tupletDown \tuplet 3/2 { f,8 g a }
+ \tupletNeutral \tuplet 3/2 { f8 g a }
+}
@end lilypond
Tuplets may be nested:
-@lilypond[quote,verbatim,relative=2]
-\autoBeamOff
-c4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
+@lilypond[quote,verbatim]
+\relative {
+ \autoBeamOff
+ c''4 \tuplet 5/4 { f8 e f \tuplet 3/2 { e[ f g] } } f4
+}
@end lilypond
Modifying nested tuplets which begin at the same musical moment must be
In the following example, the first three notes take up exactly
two beats, but no triplet bracket is printed.
-@lilypond[quote,relative=2,verbatim]
-\time 2/4
-% Alter durations to triplets
-a4*2/3 gis a
-% Normal durations
-a4 a
-% Double the duration of chord
-<a d>4*2
-% Duration of quarter, appears like sixteenth
-b16*4 c4
+@lilypond[quote,verbatim]
+\relative {
+ \time 2/4
+ % Alter durations to triplets
+ a'4*2/3 gis a
+ % Normal durations
+ a4 a
+ % Double the duration of chord
+ <a d>4*2
+ % Duration of quarter, appears like sixteenth
+ b16*4 c4
+}
@end lilypond
The duration of spacer rests may also be modified by
fraction @emph{num}/@emph{den}. Here is an example showing how music
can be compressed and expanded:
-@lilypond[quote,relative=2,verbatim]
-\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
+@lilypond[quote,verbatim]
+\relative {
+ \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
+ }
}
@end lilypond
of each pair of notes being tied. This indicates that the note
should be tied to the following note, which must be at the same pitch.
-@lilypond[quote,verbatim,relative=2]
-a2~ 4~ 16 r r8
+@lilypond[quote,verbatim]
+{ a'2~ 4~ 16 r r8 }
@end lilypond
Ties can make use of the @q{last explicit pitch} interpretation of
isolated durations:
-@lilypond[quote,verbatim,relative=2]
-a2~ 4~ 16 r r8
+@lilypond[quote,verbatim]
+{ a'2~ 4~ 16 r r8 }
@end lilypond
Ties are used either when the note crosses a bar line, or when
created. Chords may be partially tied by placing the ties inside
the chord.
-@lilypond[quote,verbatim,relative=1]
-<c e g>2 ~ 2
-<c e g>4~ <c e g c>
-<c~ e g~ b> <c e g b>
+@lilypond[quote,verbatim]
+\relative c' {
+ <c e g>2~ 2 |
+ <c e g>4~ <c e g c>
+ <c~ e g~ b> <c e g b> |
+}
@end lilypond
@cindex repeating ties
When a second alternative of a repeat starts with a tied note, you
have to specify the repeated tie as follows:
-@lilypond[quote,relative=2,verbatim]
-\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 } }
+@lilypond[quote,verbatim]
+\relative {
+ \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 }
+ }
+}
@end lilypond
@cindex laissez vibrer
piano, harp and other string and percussion instruments. They can
be entered as follows:
-@lilypond[quote,verbatim,relative=1]
-<c f g>1\laissezVibrer
+@lilypond[quote,verbatim,fragment]
+<c' f' g'>1\laissezVibrer
@end lilypond
@cindex ties, placement
Ties may be made dashed, dotted, or a combination of solid and
dashed.
-@lilypond[quote, verbatim, relative=1]
-\tieDotted
-c2~ 2
-\tieDashed
-c2~ 2
-\tieHalfDashed
-c2~ 2
-\tieHalfSolid
-c2~ 2
-\tieSolid
-c2~ 2
+@lilypond[quote, verbatim]
+\relative c' {
+ \tieDotted
+ c2~ 2
+ \tieDashed
+ c2~ 2
+ \tieHalfDashed
+ c2~ 2
+ \tieHalfSolid
+ c2~ 2
+ \tieSolid
+ c2~ 2
+}
@end lilypond
Custom dash patterns can be specified:
-@lilypond[quote, verbatim, relative=1]
-\tieDashPattern #0.3 #0.75
-c2~ 2
-\tieDashPattern #0.7 #1.5
-c2~ 2
-\tieSolid
-c2~ 2
+@lilypond[quote, verbatim]
+\relative c' {
+ \tieDashPattern #0.3 #0.75
+ c2~ 2
+ \tieDashPattern #0.7 #1.5
+ c2~ 2
+ \tieSolid
+ c2~ 2
+}
@end lilypond
Dash pattern definitions for ties have the same structure as dash
Override @var{whiteout-box} and @var{layer} layout properties of objects
that should cause a gap in ties.
-@lilypond[verbatim,quote,ragged-right,relative=2]
-\override Tie.layer = #-2
-\override Staff.TimeSignature.layer = #-1
-\override Staff.KeySignature.layer = #-1
-\override Staff.TimeSignature.whiteout-box = ##t
-\override Staff.KeySignature.whiteout-box = ##t
-b2 b~
-\time 3/4
-\key a \major
-b r4
+@lilypond[verbatim,quote,ragged-right]
+\relative {
+ \override Tie.layer = #-2
+ \override Staff.TimeSignature.layer = #-1
+ \override Staff.KeySignature.layer = #-1
+ \override Staff.TimeSignature.whiteout = ##t
+ \override Staff.KeySignature.whiteout = ##t
+ b'2 b~
+ \time 3/4
+ \key a \major
+ b r4
+}
@end lilypond
@predefined
@c \time 16/1 is used to avoid spurious bar lines
@c and long tracts of empty measures
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\new Staff {
% These two lines are just to prettify this example
\time 16/1
allows for precise manual formatting of polyphonic music, since the
automatic rest collision formatter will not move these rests.
-@lilypond[quote,verbatim,relative=2]
-a4\rest d4\rest
+@lilypond[quote,verbatim]
+\relative { a'4\rest d4\rest }
@end lilypond
@snippets
An invisible rest (also called a @q{spacer rest}) can be entered
like a note with the note name@tie{}@code{s}:
-@lilypond[verbatim,quote,relative=2]
-c4 c s c
-s2 c
+@lilypond[verbatim,quote]
+\relative c'' {
+ c4 c s c |
+ s2 c |
+}
@end lilypond
@cindex lyrics, skip
the lyrics derive their durations from the notes in an associated
melody through @code{\addlyrics} or @code{\lyricsto}.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
{
- a2 \skip2 a2 a2
+ a'2 \skip2 a'2 a'2
}
\new Lyrics {
\lyricmode {
Because @code{\skip} is a command, it does not affect the default
durations of following notes, unlike@tie{}@code{s}.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
{
- \repeat unfold 8 { a4 }
+ \repeat unfold 8 { a'4 }
}
{
- a4 \skip 2 a |
- s2 a
+ a'4 \skip 2 a' |
+ s2 a'
}
>>
@end lilypond
contexts to be created if none exist, just like notes and rests
do:
-@lilypond[quote,verbatim,relative=2]
-s1 s s
+@lilypond[quote,verbatim]
+{ s1 s s }
@end lilypond
@code{\skip} simply skips musical time; it creates no output of
any kind.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
% This is valid input, but does nothing
-\skip 1 \skip1 \skip 1
+{ \skip 1 \skip1 \skip 1 }
@end lilypond
@seealso
Rests for one or more full measures are entered like notes with
the note name uppercase @code{R}:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
% Rest measures contracted to single measure
\compressMMRests {
R1*4
R1*24
R1*4
- b2^"Tutti" b4 a4
+ b'2^"Tutti" b'4 a'4
}
@end lilypond
always be an integral number of measure-lengths, so augmentation dots
or fractions must often be used:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\compressMMRests {
\time 2/4
R1 | R2 |
A full-measure rest is printed as either a whole or breve rest,
centered in the measure, depending on the time signature.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\time 4/4
R1 |
\time 6/4
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:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
% Default behavior
\time 3/4 r2. | R2.*2 |
\time 2/4 R2 |
The predefined command @code{\fermataMarkup}
is provided for adding fermatas.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\compressMMRests {
\time 3/4
R2.*10^\markup { \italic "ad lib." }
be directed to the correct object, or they will be ignored. See the
following example:}
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
% This fails, as the wrong object name is specified
\override TextScript.padding = #5
R1^"wrong"
The time signature is set as follows:
-@lilypond[quote,verbatim,relative=2]
-\time 2/4 c2
-\time 3/4 c2.
+@lilypond[quote,verbatim,fragment]
+\time 2/4 c''2
+\time 3/4 c''2.
@end lilypond
Mid-measure time signature changes are covered in @ref{Upbeats}.
there. This default behavior may be changed, see
@ref{Visibility of objects}.
-@lilypond[quote,verbatim,relative=2]
-\time 2/4
-c2 c
-\break
-c c
-\break
-\time 4/4
-c c c c
+@lilypond[quote,verbatim]
+\relative c'' {
+ \time 2/4
+ c2 c
+ \break
+ c c
+ \break
+ \time 4/4
+ c c c c
+}
@end lilypond
@cindex time signature style
The time signature symbol that is used in 2/2 and 4/4 time can be
changed to a numeric style:
-@lilypond[quote,verbatim,relative=2]
-% 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
+@lilypond[quote,verbatim]
+\relative c'' {
+ % 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
+}
@end lilypond
A basic metronome mark is simple to write:
-@lilypond[verbatim,quote,relative=1]
-\tempo 4 = 120
-c2 d
-e4. d8 c2
+@lilypond[verbatim,quote]
+\relative {
+ \tempo 4 = 120
+ c'2 d
+ e4. d8 c2
+}
@end lilypond
Metronome marks may also be printed as a range of two numbers:
-@lilypond[verbatim,quote,relative=1]
-\tempo 4 = 40 - 46
-c4. e8 a4 g
-b,2 d4 r
+@lilypond[verbatim,quote]
+\relative {
+ \tempo 4 = 40 - 46
+ c'4. e8 a4 g
+ b,2 d4 r
+}
@end lilypond
Tempo indications with text can be used instead:
-@lilypond[verbatim,quote,relative=2]
-\tempo "Allegretto"
-c4 e d c
-b4. a16 b c4 r4
+@lilypond[verbatim,quote]
+\relative {
+ \tempo "Allegretto"
+ c''4 e d c
+ b4. a16 b c4 r4
+}
@end lilypond
Combining a metronome mark and text will automatically place the
metronome mark within parentheses:
-@lilypond[verbatim,quote,relative=2]
-\tempo "Allegro" 4 = 160
-g4 c d e
-d4 b g2
+@lilypond[verbatim,quote]
+\relative {
+ \tempo "Allegro" 4 = 160
+ g'4 c d e
+ d4 b g2
+}
@end lilypond
In general, the text can be any markup object:
-@lilypond[verbatim,quote,relative=2]
-\tempo \markup { \italic Faster } 4 = 132
-a8-. r8 b-. r gis-. r a-. r
+@lilypond[verbatim,quote]
+\relative {
+ \tempo \markup { \italic Faster } 4 = 132
+ a'8-. r8 b-. r gis-. r a-. r
+}
@end lilypond
A parenthesized metronome mark with no textual indication may be
written by including an empty string in the input:
-@lilypond[verbatim,quote,relative=2]
-\tempo "" 8 = 96
-d4 g e c
+@lilypond[verbatim,quote]
+\relative {
+ \tempo "" 8 = 96
+ d''4 g e c
+}
@end lilypond
@funindex \markLengthOn
restores the default behavior of ignoring tempo marks
for horizontal spacing.
-@lilypond[verbatim,quote,relative=0]
+@lilypond[verbatim,quote]
\compressMMRests {
\markLengthOn
\tempo "Molto vivace"
@code{@var{duration}} is the length of the music preceding the
first bar.
-@lilypond[quote,verbatim,relative=1]
-\time 3/4
-\partial 4.
-r4 e8 | a4 c8 b c4 |
+@lilypond[quote,verbatim]
+\relative {
+ \time 3/4
+ \partial 4.
+ r4 e'8 | a4 c8 b c4 |
+}
@end lilypond
When @code{\partial} is used after the beginning of a score,
@code{@var{duration}} is the @emph{remaining} length of the
current measure. It does not create a new numbered bar.
-@lilypond[quote,verbatim,relative=1]
-\set Score.barNumberVisibility = #all-bar-numbers-visible
-\override Score.BarNumber.break-visibility =
- #end-of-line-invisible
-\time 9/8
-d'4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
-\time 12/8
-\partial 4.
-c8( d) e | f2.~ 4 f8 a,( c) f |
+@lilypond[quote,verbatim]
+\relative {
+ \set Score.barNumberVisibility = #all-bar-numbers-visible
+ \override Score.BarNumber.break-visibility =
+ #end-of-line-invisible
+ \time 9/8
+ d''4.~ 4 d8 d( c) b | c4.~ 4. \bar "||"
+ \time 12/8
+ \partial 4.
+ c8( d) e | f2.~ 4 f8 a,( c) f |
+}
@end lilypond
The @code{\partial} command is @emph{required} when the time
signature changes in mid measure, but it may also be used alone.
-@lilypond[quote,verbatim,relative=1]
-\set Score.barNumberVisibility = #all-bar-numbers-visible
-\override Score.BarNumber.break-visibility =
- #end-of-line-invisible
-\time 6/8
-\partial 8
-e8 | a4 c8 b[ c b] |
-\partial 4
-r8 e,8 | a4 \bar "||"
-\partial 4
-r8 e8 | a4
-c8 b[ c b] |
+@lilypond[quote,verbatim]
+\relative {
+ \set Score.barNumberVisibility = #all-bar-numbers-visible
+ \override Score.BarNumber.break-visibility =
+ #end-of-line-invisible
+ \time 6/8
+ \partial 8
+ e'8 | a4 c8 b[ c b] |
+ \partial 4
+ r8 e,8 | a4 \bar "||"
+ \partial 4
+ r8 e8 | a4
+ c8 b[ c b] |
+}
@end lilypond
The @code{\partial} command sets the @code{Timing.measurePosition}
@code{\cadenzaOn}, then @q{switched back on} at the appropriate place
using @code{\cadenzaOff}.
-@lilypond[verbatim,relative=2,quote]
-c4 d e d
-\cadenzaOn
-c4 c d8[ d d] f4 g4.
-\cadenzaOff
-\bar "|"
-d4 e d c
+@lilypond[verbatim,quote]
+\relative c'' {
+ c4 d e d
+ \cadenzaOn
+ c4 c d8[ d d] f4 g4.
+ \cadenzaOff
+ \bar "|"
+ d4 e d c
+}
@end lilypond
Bar numbering is resumed at the end of the cadenza.
-@lilypond[verbatim,relative=2,quote]
-% 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
+@lilypond[verbatim,quote]
+\relative c'' {
+ % 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
+}
@end lilypond
Inserting a @code{\bar} command within a cadenza does not start a new
reminder accidentals need to be inserted manually, see
@ref{Accidentals}.
-@lilypond[verbatim,relative=2,quote]
-c4 d e d
-\cadenzaOn
-cis4 d cis d
-\bar "|"
-% First cis is printed without alteration even if it's after a \bar
-cis4 d cis! d
-\cadenzaOff
-\bar "|"
+@lilypond[verbatim,quote]
+\relative c'' {
+ c4 d e d
+ \cadenzaOn
+ cis4 d cis d
+ \bar "|"
+ % First cis is printed without alteration even if it's after a \bar
+ cis4 d cis! d
+ \cadenzaOff
+ \bar "|"
+}
@end lilypond
Automatic beaming is disabled by @code{\cadenzaOn}. Therefore, all
beaming in cadenzas must be entered manually. See @ref{Manual beams}.
-@lilypond[verbatim,relative=2,quote]
-\repeat unfold 8 { c8 }
-\cadenzaOn
-cis8 c c c c
-\bar"|"
-c8 c c
-\cadenzaOff
-\repeat unfold 8 { c8 }
+@lilypond[verbatim,quote]
+\relative {
+ \repeat unfold 8 { c''8 }
+ \cadenzaOn
+ cis8 c c c c
+ \bar"|"
+ c8 c c
+ \cadenzaOff
+ \repeat unfold 8 { c8 }
+}
@end lilypond
These predefined commands affect all staves in the score, even when
following example, notes and rests crossing the bar lines are split,
notes are also tied.
-@lilypond[quote,verbatim,relative=1]
+@lilypond[quote,verbatim]
\new Voice \with {
\remove "Note_heads_engraver"
\consists "Completion_heads_engraver"
\remove "Rest_engraver"
\consists "Completion_rest_engraver"
}
-
-{ c2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2 }
+\relative {
+ c'2. c8 d4 e f g a b c8 c2 b4 a g16 f4 e d c8. c2 r1*2
+}
@end lilypond
These engravers split all running notes and rests at the bar line, and
The property @code{completionUnit} sets a preferred duration for
the split notes.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\new Voice \with {
\remove "Note_heads_engraver"
\consists "Completion_heads_engraver"
-} {
- \time 9/8 g\breve. d4. \bar "||"
+} \relative {
+ \time 9/8 g\breve. d''4. \bar "||"
\set completionUnit = #(ly:make-moment 3 8)
g\breve. d4.
}
These engravers split notes with scaled duration, such as those in tuplets,
into notes with the same scale-factor as in the input note.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\new Voice \with {
\remove "Note_heads_engraver"
\consists "Completion_heads_engraver"
-} {
+} \relative {
\time 2/4 r4
- \tuplet 3/2 {g4 a b}
+ \tuplet 3/2 {g'4 a b}
\scaleDurations 2/3 {g a b}
g4*2/3 a b
\tuplet 3/2 {g4 a b}
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
-@lilypond[quote,relative=1,verbatim]
+@lilypond[quote,verbatim]
<<
\new RhythmicStaff {
- \new Voice = "myRhythm" {
+ \new Voice = "myRhythm" \relative {
\time 4/4
- c4 e8 f g2
+ c'4 e8 f g2
r4 g g f
g1
}
@funindex \autoBeamOff
@funindex autoBeamOff
-@lilypond[quote,verbatim,relative=2]
-\time 2/4 c8 c c c
-\time 6/8 c8 c c c8. c16 c8
+@lilypond[quote,verbatim]
+\relative c'' {
+ \time 2/4 c8 c c c
+ \time 6/8 c8 c c c8. c16 c8
+}
@end lilypond
If these automatic decisions are not satisfactory, beaming can be
If automatic beaming is not required, it may be turned off with
@code{\autoBeamOff} and on with @code{\autoBeamOn}:
-@lilypond[quote,relative=1,verbatim]
-c4 c8 c8. c16 c8. c16 c8
-\autoBeamOff
-c4 c8 c8. c16 c8.
-\autoBeamOn
-c16 c8
+@lilypond[quote,verbatim]
+\relative c' {
+ c4 c8 c8. c16 c8. c16 c8
+ \autoBeamOff
+ c4 c8 c8. c16 c8.
+ \autoBeamOn
+ c16 c8
+}
@end lilypond
@cindex melismata, with beams
time signature are retained and reinstated whenever that time signature
is re-established.
-@lilypond[quote,relative=2,verbatim]
-\time 5/16
-c16^"default" c c c c |
-% beamExceptions are unlikely to be defined for 5/16 time,
-% but let's disable them anyway to be sure
-\set Timing.beamExceptions = #'()
-\set Timing.beatStructure = #'(2 3)
-c16^"(2+3)" c c c c |
-\set Timing.beatStructure = #'(3 2)
-c16^"(3+2)" c c c c |
+@lilypond[quote,verbatim]
+\relative c'' {
+ \time 5/16
+ c16^"default" c c c c |
+ % beamExceptions are unlikely to be defined for 5/16 time,
+ % but let's disable them anyway to be sure
+ \set Timing.beamExceptions = #'()
+ \set Timing.beatStructure = #'(2 3)
+ c16^"(2+3)" c c c c |
+ \set Timing.beatStructure = #'(3 2)
+ c16^"(3+2)" c c c c |
+}
@end lilypond
-@lilypond[quote,relative=2,verbatim]
-\time 4/4
-a8^"default" a a a a a a a
-% Disable beamExceptions because they are definitely
-% defined for 4/4 time
-\set Timing.beamExceptions = #'()
-\set Timing.baseMoment = #(ly:make-moment 1/4)
-\set Timing.beatStructure = #'(1 1 1 1)
-a8^"changed" a a a a a a a
+@lilypond[quote,verbatim]
+\relative {
+ \time 4/4
+ a'8^"default" a a a a a a a
+ % Disable beamExceptions because they are definitely
+ % defined for 4/4 time
+ \set Timing.beamExceptions = #'()
+ \set Timing.baseMoment = #(ly:make-moment 1/4)
+ \set Timing.beatStructure = #'(1 1 1 1)
+ a8^"changed" a a a a a a a
+}
@end lilypond
Beam setting changes can be limited to specific contexts. If no
setting is included in a lower-level context, the setting of the
enclosing context will apply.
-@lilypond[quote, verbatim,relative=1]
+@lilypond[quote, verbatim]
\new Staff {
\time 7/8
% No need to disable beamExceptions
specified if the beaming is to be applied to all voices in the
staff:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\time 7/8
% rhythm 3-1-1-2
% Change applied to Voice by default -- does not work correctly
% Because of autogenerated voices, all beating will
% be at baseMoment (1 . 8)
\set beatStructure = #'(3 1 1 2)
-<< {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
+<< \relative {a'8 a a a16 a a a a8 a} \\ \relative {f'4. f8 f f f} >>
% Works correctly with context Staff specified
\set Staff.beatStructure = #'(3 1 1 2)
-<< {a8 a a a16 a a a a8 a} \\ {f4. f8 f f f} >>
+<< \relative {a'8 a a a16 a a a a8 a} \\ \relative {f'4. f8 f f f} >>
@end lilypond
The value of @code{baseMoment} can be adjusted to change
the value of @code{beatStructure} must be set to be
compatible with the new value of @code{baseMoment}.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\time 5/8
% No need to disable beamExceptions
% as they are not defined for 5/8 time
\set Timing.baseMoment = #(ly:make-moment 1/16)
\set Timing.beatStructure = #'(7 3)
-\repeat unfold 10 { a16 }
+\repeat unfold 10 { a'16 }
@end lilypond
@code{baseMoment} is a @i{moment}; a unit of musical duration. A
function has no other way to discern the measure length). Here is
a simple example:
-@lilypond[quote,relative=2,verbatim]
-\time 3/16
-\set Timing.beatStructure = #'(2 1)
-\set Timing.beamExceptions =
- \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
-c16 c c |
-\repeat unfold 6 { c32 } |
+@lilypond[quote,verbatim]
+\relative c'' {
+ \time 3/16
+ \set Timing.beatStructure = #'(2 1)
+ \set Timing.beamExceptions =
+ \beamExceptions { 32[ 32] 32[ 32] 32[ 32] }
+ c16 c c |
+ \repeat unfold 6 { c32 } |
+}
@end lilypond
@warning{A @code{beamExceptions} value must be @emph{complete}
will reset the automatic beaming settings for the @code{Timing}
context to the default behavior.
-@lilypond[quote,verbatim,relative=2]
-\time 6/8
-\repeat unfold 6 { a8 }
-% group (4 + 2)
-\set Timing.beatStructure = #'(4 2)
-\repeat unfold 6 { a8 }
-% go back to default behavior
-\time 6/8
-\repeat unfold 6 { a8 }
+@lilypond[quote,verbatim]
+\relative a' {
+ \time 6/8
+ \repeat unfold 6 { a8 }
+ % group (4 + 2)
+ \set Timing.beatStructure = #'(4 2)
+ \repeat unfold 6 { a8 }
+ % go back to default behavior
+ \time 6/8
+ \repeat unfold 6 { a8 }
+}
@end lilypond
The default automatic beaming settings for a time signature
@code{beamExceptions} rule can override the @code{beatStructure} setting
if @code{beamExceptions} is not reset.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\time 4/4
\set Timing.baseMoment = #(ly:make-moment 1/8)
\set Timing.beatStructure = #'(3 3 2)
% This won't beam (3 3 2) because of beamExceptions
-\repeat unfold 8 {c8} |
+\repeat unfold 8 {c''8} |
% This will beam (3 3 2) because we clear beamExceptions
\set Timing.beamExceptions = #'()
-\repeat unfold 8 {c8}
+\repeat unfold 8 {c''8}
@end lilypond
In a similar fashion, eighth notes in 3/4 time are beamed as a full
measure by default. To beam eighth notes in 3/4 time on the beat,
reset @code{beamExceptions}.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\time 3/4
% by default we beam in (6) due to beamExceptions
-\repeat unfold 6 {a8} |
+\repeat unfold 6 {a'8} |
% This will beam (1 1 1) due to default baseMoment and beatStructure
\set Timing.beamExceptions = #'()
-\repeat unfold 6 {a8}
+\repeat unfold 6 {a'8}
@end lilypond
In engraving from the Romantic and Classical periods,
This behavior is controlled by the context property @code{beamHalfMeasure},
which has effect only in time signatures with 3 in the numerator:
-@lilypond[quote,verbatim,relative=2]
-\time 3/4
-r4. a8 a a |
-\set Timing.beamHalfMeasure = ##f
-r4. a8 a a |
+@lilypond[quote,verbatim]
+\relative a' {
+ \time 3/4
+ r4. a8 a a |
+ \set Timing.beamHalfMeasure = ##f
+ r4. a8 a a |
+}
@end lilypond
@subsubsubheading How automatic beaming works
One way to avoid this problem is to set the time signature
in only one staff.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
\new Staff {
\time 3/4
\set Timing.baseMoment = #(ly:make-moment 1/8)
\set Timing.beatStructure = #'(1 5)
\set Timing.beamExceptions = #'()
- \repeat unfold 6 { a8 }
+ \repeat unfold 6 { a'8 }
}
\new Staff {
- \repeat unfold 6 { a8 }
+ \repeat unfold 6 { a'8 }
}
>>
@end lilypond
beaming settings for a time signature are described in
@ref{Time signature}.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
\new Staff {
\overrideTimeSignatureSettings
#'(1 5) % beatStructure
#'() % beamExceptions
\time 3/4
- \repeat unfold 6 { a8 }
+ \repeat unfold 6 { a'8 }
}
\new Staff {
\time 3/4
- \repeat unfold 6 { a8 }
+ \repeat unfold 6 { a'8 }
}
>>
@end lilypond
notes. Such beams can be specified manually by
marking the begin and end point with @code{[} and @code{]}.
-@lilypond[quote,relative=1,verbatim]
-r4 r8[ g' a r] r g[ | a] r
+@lilypond[quote,verbatim]
+\relative { r4 r8[ g' a r] r g[ | a] r }
@end lilypond
@cindex manual beams, direction shorthand for
Beaming direction can be set manually using direction indicators:
-@lilypond[quote,relative=2,verbatim]
-c8^[ d e] c,_[ d e f g]
+@lilypond[quote,verbatim]
+\relative { c''8^[ d e] c,_[ d e f g] }
@end lilypond
@funindex \noBeam
Individual notes may be marked with @code{\noBeam} to prevent them
from being beamed:
-@lilypond[quote,verbatim,relative=2]
-\time 2/4
-c8 c\noBeam c c
+@lilypond[quote,verbatim]
+\relative {
+ \time 2/4
+ c''8 c\noBeam c c
+}
@end lilypond
Grace note beams and normal note beams can occur simultaneously.
Unbeamed grace notes are not put into normal note beams.
-@lilypond[quote,verbatim,relative=2]
-c4 d8[
-\grace { e32 d c d }
-e8] e[ e
-\grace { f16 }
-e8 e]
+@lilypond[quote,verbatim]
+\relative {
+ c''4 d8[
+ \grace { e32 d c d }
+ e8] e[ e
+ \grace { f16 }
+ e8 e]
+}
@end lilypond
@funindex stemLeftBeamCount
with only one beam on the left side, i.e., the eighth-note beam of
the group as a whole.
-@lilypond[quote,relative=2,verbatim]
-a8[ r16 f g a]
-a8[ r16
-\set stemLeftBeamCount = #2
-\set stemRightBeamCount = #1
-f16
-\set stemLeftBeamCount = #1
-g16 a]
+@lilypond[quote,verbatim]
+\relative a' {
+ a8[ r16 f g a]
+ a8[ r16
+ \set stemLeftBeamCount = #2
+ \set stemRightBeamCount = #1
+ f16
+ \set stemLeftBeamCount = #1
+ g16 a]
+}
@end lilypond
lengthening. The first four 32nd notes gradually speed up, while
the last four 32nd notes are at a constant tempo.
-@lilypond[relative=1,verbatim,quote]
-\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] }
+@lilypond[verbatim,quote]
+\relative c' {
+ \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] }
+}
@end lilypond
@noindent
other types with the @code{\bar} command. For example, a closing
double bar line is usually placed at the end of a piece:
-@lilypond[quote,relative=1,verbatim]
-e4 d c2 \bar "|."
+@lilypond[quote,verbatim]
+\relative { e'4 d c2 \bar "|." }
@end lilypond
It is not invalid if the final note in a measure does not
Two types of simple bar lines and five types of double bar lines are
available for manual insertion:
-@lilypond[quote,relative=1,verbatim]
-f1 \bar "|"
-f1 \bar "."
-g1 \bar "||"
-a1 \bar ".|"
-b1 \bar ".."
-c1 \bar "|.|"
-d1 \bar "|."
-e1
+@lilypond[quote,verbatim]
+\relative {
+ f'1 \bar "|"
+ f1 \bar "."
+ g1 \bar "||"
+ a1 \bar ".|"
+ b1 \bar ".."
+ c1 \bar "|.|"
+ d1 \bar "|."
+ e1
+}
@end lilypond
@noindent
together with dotted and dashed bar lines:
-@lilypond[quote,relative=1,verbatim]
-f1 \bar ";"
-g1 \bar "!"
-a1
+@lilypond[quote,verbatim]
+\relative {
+ f'1 \bar ";"
+ g1 \bar "!"
+ a1
+}
@end lilypond
@noindent
and nine types of repeat bar lines:
-@lilypond[quote,relative=1,verbatim]
-f1 \bar ".|:"
-g1 \bar ":..:"
-a1 \bar ":|.|:"
-b1 \bar ":|.:"
-c1 \bar ":.|.:"
-d1 \bar "[|:"
-e1 \bar ":|][|:"
-f1 \bar ":|]"
-g1 \bar ":|."
-a1
+@lilypond[quote,verbatim]
+\relative {
+ f'1 \bar ".|:"
+ g1 \bar ":..:"
+ a1 \bar ":|.|:"
+ b1 \bar ":|.:"
+ c1 \bar ":.|.:"
+ d1 \bar "[|:"
+ e1 \bar ":|][|:"
+ f1 \bar ":|]"
+ g1 \bar ":|."
+ a1
+}
@end lilypond
Additionally, a bar line can be printed as a simple tick:
-@lilypond[quote,relative=1,verbatim]
-f1 \bar "'" g1
+@lilypond[quote,fragment,verbatim]
+f'1 \bar "'" g'1
@end lilypond
However, as such ticks are typically used in Gregorian chant, it is
preferable to use @code{\divisioMinima} there instead, described in
Lilypond supports kievan notation and provides a special kievan
bar line:
-@lilypond[quote,relative=1,verbatim]
-f1 \bar "k"
+@lilypond[quote,fragment,verbatim]
+f'1 \bar "k"
@end lilypond
Further details of this notation are explained in
@ref{Typesetting Kievan square notation}.
For in-line segno signs, there are three types of bar lines which
differ in their behavior at line breaks:
-@lilypond[quote,relative=2,verbatim]
-c4 c c c
-\bar "S"
-c4 c c c \break
-\bar "S"
-c4 c c c
-\bar "S-|"
-c4 c c c \break
-\bar "S-|"
-c4 c c c
-\bar "S-S"
-c4 c c c \break
-\bar "S-S"
-c1
+@lilypond[quote,verbatim]
+\relative c'' {
+ c4 c c c
+ \bar "S"
+ c4 c c c \break
+ \bar "S"
+ c4 c c c
+ \bar "S-|"
+ c4 c c c \break
+ \bar "S-|"
+ c4 c c c
+ \bar "S-S"
+ c4 c c c \break
+ \bar "S-S"
+ c1
+}
@end lilypond
@cindex repeats
line at the end of the line and a start repeat at the beginning of
the next line.
-@lilypond[quote,relative=2,verbatim]
-c4 c c c
-\bar ".|:-||"
-c4 c c c \break
-\bar ".|:-||"
-c4 c c c
+@lilypond[quote,verbatim]
+\relative c'' {
+ c4 c c c
+ \bar ".|:-||"
+ c4 c c c \break
+ \bar ".|:-||"
+ c4 c c c
+}
@end lilypond
For combinations of repeats with the segno sign, there are six different
variations:
-@lilypond[quote,relative=2,verbatim]
-c4 c c c
-\bar ":|.S"
-c4 c c c \break
-\bar ":|.S"
-c4 c c c
-\bar ":|.S-S"
-c4 c c c \break
-\bar ":|.S-S"
-c4 c c c
-\bar "S.|:-S"
-c4 c c c \break
-\bar "S.|:-S"
-c4 c c c
-\bar "S.|:"
-c4 c c c \break
-\bar "S.|:"
-c4 c c c
-\bar ":|.S.|:"
-c4 c c c \break
-\bar ":|.S.|:"
-c4 c c c
-\bar ":|.S.|:-S"
-c4 c c c \break
-\bar ":|.S.|:-S"
-c1
+@lilypond[quote,verbatim]
+\relative c'' {
+ c4 c c c
+ \bar ":|.S"
+ c4 c c c \break
+ \bar ":|.S"
+ c4 c c c
+ \bar ":|.S-S"
+ c4 c c c \break
+ \bar ":|.S-S"
+ c4 c c c
+ \bar "S.|:-S"
+ c4 c c c \break
+ \bar "S.|:-S"
+ c4 c c c
+ \bar "S.|:"
+ c4 c c c \break
+ \bar "S.|:"
+ c4 c c c
+ \bar ":|.S.|:"
+ c4 c c c \break
+ \bar ":|.S.|:"
+ c4 c c c
+ \bar ":|.S.|:-S"
+ c4 c c c \break
+ \bar ":|.S.|:-S"
+ c1
+}
@end lilypond
Additionally there is an @code{\inStaffSegno} command which creates
The part following the @code{"-"} sign is not used for building up
the bar line.
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
\defineBarLine "||-dashedSpan" #'("||" "" "!!")
\new StaffGroup <<
- \new Staff {
+ \new Staff \relative c'' {
c1 \bar "||"
c1 \bar "||-dashedSpan"
c1
}
- \new Staff {
+ \new Staff \relative c'' {
c1
c1
c1
Furthermore, the space character @code{" "} serves as a placeholder
for defining span bars correctly aligned to the main bar lines:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
\defineBarLine ":|.-wrong" #'(":|." "" "|.")
\defineBarLine ":|.-right" #'(":|." "" " |.")
\new StaffGroup <<
- \new Staff {
+ \new Staff \relative c'' {
c1 \bar ":|.-wrong"
c1 \bar ":|.-right"
c1
}
- \new Staff {
+ \new Staff \relative c'' {
c1
c1
c1
connected between different staves of a @code{StaffGroup},
@code{PianoStaff}, or @code{GrandStaff}.
-@lilypond[quote,relative=1,verbatim]
+@lilypond[quote,verbatim]
<<
\new StaffGroup <<
- \new Staff {
- e4 d
+ \new Staff \relative {
+ e'4 d
\bar "||"
f4 e
}
- \new Staff { \clef bass c4 g e g }
+ \new Staff \relative { \clef bass c'4 g e g }
>>
- \new Staff { \clef bass c2 c2 }
+ \new Staff \relative { \clef bass c'2 c2 }
>>
@end lilypond
@code{currentBarNumber} property, which is normally updated
automatically for every measure. It may also be set manually:
-@lilypond[verbatim,quote,relative=1]
-c1 c c c
-\break
-\set Score.currentBarNumber = #50
-c1 c c c
+@lilypond[verbatim,quote]
+\relative c' {
+ c1 c c c
+ \break
+ \set Score.currentBarNumber = #50
+ c1 c c c
+}
@end lilypond
@cindex bar numbers, regular spacing
line visible}, @code{beginning of line visible}. In the following
example bar numbers are printed at all possible places:
-@lilypond[verbatim,quote,relative=1]
-\override Score.BarNumber.break-visibility = ##(#t #t #t)
-\set Score.currentBarNumber = #11
-% Permit first bar number to be printed
-\bar ""
-c1 | c | c | c
-\break
-c1 | c | c | c
+@lilypond[verbatim,quote]
+\relative c' {
+ \override Score.BarNumber.break-visibility = ##(#t #t #t)
+ \set Score.currentBarNumber = #11
+ % Permit first bar number to be printed
+ \bar ""
+ c1 | c | c | c |
+ \break
+ c1 | c | c | c |
+}
@end lilypond
@snippets
To print a rehearsal mark, use the @code{\mark} command.
-@lilypond[quote,verbatim,relative=2]
-c1 \mark \default
-c1 \mark \default
-c1 \mark \default
-c1 \mark \default
+@lilypond[quote,verbatim]
+\relative c'' {
+ c1 \mark \default
+ c1 \mark \default
+ c1 \mark \default
+ c1 \mark \default
+}
@end lilypond
@noindent
mark manually. The value to use is stored in the property
@code{rehearsalMark}.
-@lilypond[quote,verbatim,relative=2]
-c1 \mark \default
-c1 \mark \default
-c1 \mark #8
-c1 \mark \default
-c1 \mark \default
+@lilypond[quote,verbatim]
+\relative c'' {
+ c1 \mark \default
+ c1 \mark \default
+ c1 \mark #8
+ c1 \mark \default
+ c1 \mark \default
+}
@end lilypond
@noindent
\set Score.markFormatter = #format-mark-circle-alphabet
@end example
-@lilypond[quote,verbatim,relative=2]
-\set Score.markFormatter = #format-mark-box-alphabet
-c1 \mark \default
-c1 \mark \default
-c1 \mark #8
-c1 \mark \default
-c1 \mark \default
+@lilypond[quote,verbatim]
+\relative c'' {
+ \set Score.markFormatter = #format-mark-box-alphabet
+ c1 \mark \default
+ c1 \mark \default
+ c1 \mark #8
+ c1 \mark \default
+ c1 \mark \default
+}
@end lilypond
@cindex rehearsal mark format
procedure. After a few measures, it is set to a procedure that
produces a boxed number.
-@lilypond[quote,verbatim,relative=2]
-\set Score.markFormatter = #format-mark-numbers
-c1 \mark \default
-c1 \mark \default
-\set Score.markFormatter = #format-mark-box-numbers
-c1 \mark \default
-\set Score.markFormatter = #format-mark-circle-numbers
-c1 \mark \default
-\set Score.markFormatter = #format-mark-circle-letters
-c1
+@lilypond[quote,verbatim]
+\relative c'' {
+ \set Score.markFormatter = #format-mark-numbers
+ c1 \mark \default
+ c1 \mark \default
+ \set Score.markFormatter = #format-mark-box-numbers
+ c1 \mark \default
+ \set Score.markFormatter = #format-mark-circle-numbers
+ c1 \mark \default
+ \set Score.markFormatter = #format-mark-circle-letters
+ c1
+}
@end lilypond
The file @file{scm/translation-functions.scm} contains the
Music glyphs (such as the segno sign) may be printed inside a
@code{\mark}
-@lilypond[quote,verbatim,relative=1]
-c1 \mark \markup { \musicglyph #"scripts.segno" }
-c1 \mark \markup { \musicglyph #"scripts.coda" }
-c1 \mark \markup { \musicglyph #"scripts.ufermata" }
-c1
+@lilypond[quote,verbatim]
+\relative c' {
+ c1 \mark \markup { \musicglyph #"scripts.segno" }
+ c1 \mark \markup { \musicglyph #"scripts.coda" }
+ c1 \mark \markup { \musicglyph #"scripts.ufermata" }
+ c1
+}
@end lilypond
@noindent
Grace notes are musical ornaments, printed in a smaller font, that take
up no additional logical time in a measure.
-@lilypond[quote,relative=2,verbatim]
-c4 \grace b16 a4(
-\grace { b16 c16 } a2)
+@lilypond[quote,verbatim]
+\relative {
+ c''4 \grace b16 a4(
+ \grace { b16 c16 } a2)
+}
@end lilypond
There are three other types of grace notes possible; the
between notes that are slurred themselves, using the
@code{\slashedGrace} function.
-@lilypond[quote,relative=2,verbatim]
-\acciaccatura d8 c4
-\appoggiatura e8 d4
-\acciaccatura { g16 f } e2
-\slashedGrace a,8 g4
-\slashedGrace b16 a4(
-\slashedGrace b8 a2)
+@lilypond[quote,verbatim]
+\relative {
+ \acciaccatura d''8 c4
+ \appoggiatura e8 d4
+ \acciaccatura { g16 f } e2
+ \slashedGrace a,8 g4
+ \slashedGrace b16 a4(
+ \slashedGrace b8 a2)
+}
@end lilypond
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
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Staff { e2 \grace { c16 d e f } e2 }
- \new Staff { c2 \grace { g8 b } c2 }
+ \new Staff \relative { e''2 \grace { c16 d e f } e2 }
+ \new Staff \relative { c''2 \grace { g8 b } c2 }
>>
@end lilypond
command. It takes two arguments: the main note, and the grace
notes following the main note.
-@lilypond[quote,verbatim,relative=2]
-c1 \afterGrace d1 { c16[ d] } c1
+@lilypond[quote,verbatim]
+\relative { c''1 \afterGrace d1 { c16[ d] } c1 }
@end lilypond
This will put the grace notes after a space lasting 3/4 of the
the results from setting the space at the default, at 15/16, and
finally at 1/2 of the main note.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
- \new Staff {
- c1 \afterGrace d1 { c16[ d] } c1
+ \new Staff \relative {
+ c''1 \afterGrace d1 { c16[ d] } c1
}
- \new Staff {
+ \new Staff \relative {
#(define afterGraceFraction (cons 15 16))
- c1 \afterGrace d1 { c16[ d] } c1
+ c''1 \afterGrace d1 { c16[ d] } c1
}
- \new Staff {
+ \new Staff \relative {
#(define afterGraceFraction (cons 1 2))
- c1 \afterGrace d1 { c16[ d] } c1
+ c''1 \afterGrace d1 { c16[ d] } c1
}
>>
@end lilypond
specified using spacers. The following example places the grace
note after a space lasting 7/8 of the main note.
-@lilypond[quote,verbatim,relative=2]
-\new Voice {
+@lilypond[quote,verbatim]
+\new Voice \relative {
<<
- { d1^\trill_( }
+ { d''1^\trill_( }
{ s2 s4. \grace { c16 d } }
>>
c1)
inside the grace expression. Here, the grace note's default stem
direction is overridden and then reverted.
-@lilypond[quote,verbatim,relative=2]
-\new Voice {
+@lilypond[quote,verbatim]
+\new Voice \relative {
\acciaccatura {
\stemDown
- f16->
+ f''16->
\stemNeutral
}
g4 e c2
synchronized. Take care when you mix staves with grace notes and
staves without, for example,
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Staff { e4 \bar ".|:" \grace c16 d2. }
- \new Staff { c4 \bar ".|:" d2. }
+ \new Staff \relative { e''4 \bar ".|:" \grace c16 d2. }
+ \new Staff \relative { c''4 \bar ".|:" d2. }
>>
@end lilypond
This can be remedied by inserting grace skips of the corresponding
durations in the other staves. For the above example
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Staff { e4 \bar ".|:" \grace c16 d2. }
- \new Staff { c4 \bar ".|:" \grace s16 d2. }
+ \new Staff \relative { e''4 \bar ".|:" \grace c16 d2. }
+ \new Staff \relative { c''4 \bar ".|:" \grace s16 d2. }
>>
@end lilypond
and @code{>}. A chord may be followed by a duration just like simple
notes.
-@lilypond[verbatim,quote,relative=2]
-<a c e>1 <a c e>2 <f a c e>4 <a c>8. <g c e>16
+@lilypond[verbatim,quote]
+\relative {
+ <a' c e>1 <a c e>2 <f a c e>4 <a c>8. <g c e>16
+}
@end lilypond
Chords may also be followed by articulations, again just like simple
notes.
-@lilypond[verbatim,quote,relative=2]
-<a c e>1\fermata <a c e>2-> <f a c e>4\prall <a c>8.^! <g c e>16-.
+@lilypond[verbatim,quote]
+\relative {
+ <a' c e>1\fermata <a c e>2-> <f a c e>4\prall <a c>8.^! <g c e>16-.
+}
@end lilypond
The notes within the chord themselves can also be followed by articulation
and ornamentation.
-@lilypond[verbatim,quote,relative=2]
-<a c\prall e>1 <a-> c-^ e>2 <f-. a c-. e-.>4
-<a-+ c-->8. <g\fermata c e\turn>16
+@lilypond[verbatim,quote]
+\relative {
+ <a' c\prall e>1 <a-> c-^ e>2 <f-. a c-. e-.>4
+ <a-+ c-->8. <g\fermata c e\turn>16
+}
@end lilypond
However some notation, such as dynamics, hairpins and slurs must be
attached to the chord, rather than notes within the chord, otherwise
they will not print.
-@lilypond[verbatim,quote,relative=2]
-<a\f c( e>1 <a c) e>\f <a\< c e>( <a\! c e>)
-<a c e>\< <a c e> <a c e>\!
+@lilypond[verbatim,quote]
+\relative {
+ <a'\f c( e>1 <a c) e>\f <a\< c e>( <a\! c e>)
+ <a c e>\< <a c e> <a c e>\!
+}
@end lilypond
@cindex chords, empty
be combined with them (for more complex possibilities of combining such
elements, see @ref{Simultaneous expressions}):
-@lilypond[verbatim,quote,relative=2]
-\grace { g8( a b }
-<> ) \p \< -. -\markup \italic "sempre staccato"
-\repeat unfold 4 { c4 e } c1\f
+@lilypond[verbatim,quote]
+\relative {
+ \grace { g'8( a b }
+ <> ) \p \< -. -\markup \italic "sempre staccato"
+ \repeat unfold 4 { c4 e } c1\f
+}
@end lilypond
@cindex relative pitch, chords
in the chord are relative to the note that came before it
@emph{within the same chord}.
-@lilypond[verbatim,quote,relative=2]
-<a c e>1 <f a c> <a c e> <f' a c> <b, e b,>
+@lilypond[verbatim,quote]
+\relative {
+ <a' c e>1 <f a c> <a c e> <f' a c> <b, e b,>
+}
@end lilypond
For more information about chords, see @ref{Chord notation}.
In order to save typing, a shortcut can be used to repeat the preceding
chord. The chord repetition symbol is @code{q}:
-@lilypond[verbatim,quote,relative=2]
-<a c e>1 q <f a c>2 q
+@lilypond[verbatim,quote]
+\relative {
+ <a' c e>1 q <f a c>2 q
+}
@end lilypond
As with regular chords, the chord repetition symbol can be used with
durations, articulations, markups, slurs, beams, etc. as only the
pitches of the previous chord are duplicated.
-@lilypond[verbatim,quote,relative=2]
-<a c e>1\p^"text" q2\<( q8)[-! q8.]\! q16-1-2-3 q8\prall
+@lilypond[verbatim,quote]
+\relative {
+ <a' c e>1\p^"text" q2\<( q8)[-! q8.]\! q16-1-2-3 q8\prall
+}
@end lilypond
The chord repetition symbol always remembers the last instance of
a chord so it is possible to repeat the most recent chord even if
other non-chorded notes or rests have been added since.
-@lilypond[verbatim,quote,relative=2]
-<a c e>1 c'4 q2 r8 q8 |
-q2 c, |
+@lilypond[verbatim,quote]
+\relative {
+ <a' c e>1 c'4 q2 r8 q8 |
+ q2 c, |
+}
@end lilypond
However, the chord repetition symbol does not retain any dynamics,
The following examples show simultaneous expressions on one staff:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\new Voice { % explicit single voice
- << { a4 b g2 } { d4 g c,2 } >>
+ << \relative { a'4 b g2 }
+ \relative { d'4 g c,2 } >>
}
@end lilypond
-@lilypond[quote,verbatim,relative=2]
-% single first note
-a << { a4 b g } { d4 g c, } >>
+@lilypond[quote,verbatim]
+\relative {
+ % single first note
+ a' << \relative { a'4 b g }
+ \relative { d'4 g c, } >>
+}
@end lilypond
This can be useful if the simultaneous sections have identical
changes in a @emph{single} @samp{Voice} are collected and engraved in
musical order:
-@lilypond[quote,verbatim,relative=2]
-<a c>4-. <>-. << c a >> << { c-. <c a> } { a s-. } >>
+@lilypond[quote,verbatim]
+\relative {
+ <a' c>4-. <>-. << c a >> << { c-. <c a> } { a s-. } >>
+}
@end lilypond
Multiple stems or beams or different note durations or properties at
The following example shows how simultaneous expressions can
generate multiple staves implicitly:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
% no single first note
-<< { a4 b g2 } { d4 g2 c,4 } >>
+<< \relative { a'4 b g2 }
+ \relative { d'4 g2 c,4 } >>
@end lilypond
Here different rhythms cause no problems because they are
entered by applying the function @code{\makeClusters} to a sequence
of chords, e.g.,
-@lilypond[quote,relative=2,verbatim]
-\makeClusters { <g b>2 <c g'> }
+@lilypond[quote,verbatim]
+\relative \makeClusters { <g' b>2 <c g'> }
@end lilypond
Ordinary notes and clusters can be put together in the same staff,
The basic structure needed to achieve multiple independent
voices in a single staff is illustrated in the following example:
-@lilypond[quote,relative=3,verbatim]
+@lilypond[quote,verbatim]
\new Staff <<
\new Voice = "first"
- { \voiceOne r8 r16 g e8. f16 g8[ c,] f e16 d }
+ \relative { \voiceOne r8 r16 g'' e8. f16 g8[ c,] f e16 d }
\new Voice= "second"
- { \voiceTwo d16 c d8~ 16 b c8~ 16 b c8~ 16 b8. }
+ \relative { \voiceTwo d''16 c d8~ 16 b c8~ 16 b c8~ 16 b8. }
>>
@end lilypond
This allows lyrics to be assigned to one continuing voice before,
during and after a polyphonic section:
-@lilypond[quote, verbatim, relative=2]
-<<
+@lilypond[quote,verbatim]
+\relative <<
\new Voice = "melody" {
- a4
+ a'4
<<
{
\voiceOne
The first example could be typeset as follows:
-@lilypond[quote,relative=3,verbatim]
+@lilypond[quote,verbatim]
<<
- { r8 r16 g e8. f16 g8[ c,] f e16 d }
+ \relative { r8 r16 g'' e8. f16 g8[ c,] f e16 d }
\\
- { d16 c d8~ 16 b c8~ 16 b c8~ 16 b8. }
+ \relative { d''16 c d8~ 16 b c8~ 16 b c8~ 16 b8. }
>>
@end lilypond
three, which has the stems up as desired. Spacer rests are
used to avoid printing doubled rests.
-@lilypond[quote,relative=3,verbatim]
+@lilypond[quote,verbatim]
<<
- { r8 g g g g f16 ees f8 d }
+ \relative { r8 g'' g g g f16 ees f8 d }
\\
- { ees,8 r ees r d r d r }
+ \relative { ees'8 r ees r d r d r }
\\
- { d'8 s c s bes s a s }
+ \relative { d''8 s c s bes s a s }
>>
@end lilypond
@code{Voice} context, thus forming chords. To achieve this, enclose
them in a simple simultaneous music construct within an explicit voice:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
\new Voice <<
- { e4 f8 d e16 f g8 d4 }
- { c4 d8 b c16 d e8 b4 }
+ \relative { e''4 f8 d e16 f g8 d4 }
+ \relative { c''4 d8 b c16 d e8 b4 }
>>
@end lilypond
Voices may be given distinct colors and shapes, allowing them to be
easily identified:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- { \voiceOneStyle d4 c2 b4 }
+ \relative { \voiceOneStyle d''4 c2 b4 }
\\
- { \voiceTwoStyle e,2 e }
+ \relative { \voiceTwoStyle e'2 e }
\\
- { \voiceThreeStyle b2. c4 }
+ \relative { \voiceThreeStyle b2. c4 }
\\
- { \voiceFourStyle g'2 g }
+ \relative { \voiceFourStyle g'2 g }
>>
@end lilypond
different circumstances, on beats 1 and 3 in bar 1 and beat 1
in bar 2, where the automatic merging fails.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
- {
- c8 d e d c d c4
+ \relative {
+ c''8 d e d c d c4
g'2 fis
- } \\ {
- c2 c8. b16 c4
+ } \\
+ \relative {
+ c''2 c8. b16 c4
e,2 r
- } \\ {
+ } \\
+ \relative {
\oneVoice
s1
- e8 a b c d2
+ e'8 a b c d2
}
>>
@end lilypond
Notes with different note heads may be merged as shown
below. In this example the note heads on beat 1 of bar 1 are now merged:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
- {
+ \relative {
\mergeDifferentlyHeadedOn
- c8 d e d c d c4
+ c''8 d e d c d c4
g'2 fis
- } \\ {
- c2 c8. b16 c4
+ } \\
+ \relative {
+ c''2 c8. b16 c4
e,2 r
- } \\ {
+ } \\
+ \relative {
\oneVoice
s1
- e8 a b c d2
+ e'8 a b c d2
}
>>
@end lilypond
Note heads with different dots as shown in beat 3 of bar 1 may be
also be merged:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- {
+ \relative {
\mergeDifferentlyHeadedOn
\mergeDifferentlyDottedOn
- c8 d e d c d c4
+ c''8 d e d c d c4
g'2 fis
- } \\ {
- c2 c8. b16 c4
+ } \\
+ \relative {
+ c''2 c8. b16 c4
e,2 r
- } \\ {
+ } \\
+ \relative {
\oneVoice
s1
- e8 a b c d2
+ e'8 a b c d2
}
>>
@end lilypond
@notation{g} out of the column, and @code{\mergeDifferentlyHeadedOn}
then works properly.
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- {
+ \relative {
\mergeDifferentlyHeadedOn
\mergeDifferentlyDottedOn
- c8 d e d c d c4
+ c''8 d e d c d c4
\shiftOn
g'2 fis
- } \\ {
- c2 c8. b16 c4
+ } \\
+ \relative {
+ c''2 c8. b16 c4
e,2 r
- } \\ {
+ } \\
+ \relative {
\oneVoice
s1
- e8 a b c d2
+ e'8 a b c d2
}
>>
@end lilypond
Using @code{\override NoteColumn.ignore-collision = ##t} will cause
differently headed notes in different voices to merge incorrectly.
-@lilypond[quote,relative=1,verbatim]
+@lilypond[quote,verbatim,fragment]
\mergeDifferentlyHeadedOn
-<< { c16 a' b a } \\ { c,2 } >>
+<< \relative { c'16 a' b a } \\ \relative { c'2 } >>
\override NoteColumn.ignore-collision = ##t
-<< { c16 a' b a } \\ { c,2 } >>
+<< \relative { c'16 a' b a } \\ \relative { c'2 } >>
@end lilypond
@ignore
To manually force a line break at a bar line, use the
@code{\break} command:
-@lilypond[quote,ragged-right,relative=2,verbatim]
-c4 c c c | \break
-c4 c c c |
+@lilypond[quote,ragged-right,verbatim]
+\relative c'' {
+ c4 c c c | \break
+ c4 c c c |
+}
@end lilypond
By default, a @code{\break} in the middle of a measure is ignored,
and a warning is printed. To force a line break in the middle of
a measure, add an invisible bar line with @w{@samp{\bar ""}}:
-@lilypond[quote,ragged-right,relative=2,verbatim]
-c4 c c
-\bar "" \break
-c |
-c4 c c c |
+@lilypond[quote,ragged-right,verbatim]
+\relative c'' {
+ c4 c c
+ \bar "" \break
+ c |
+ c4 c c c |
+}
@end lilypond
A @code{\break} occurring at a bar line is also ignored if the
lines. This behavior can be changed by setting
@code{\override Beam.breakable = ##t}:
-@lilypond[quote,ragged-right,relative=2,verbatim]
-\override Beam.breakable = ##t
-c2. c8[ c | \break
-c8 c] c2. |
+@lilypond[quote,ragged-right,verbatim]
+\relative c'' {
+ \override Beam.breakable = ##t
+ c2. c8[ c | \break
+ c8 c] c2. |
+}
@end lilypond
The @code{\noBreak} command forbids a line break at the bar line
with the lower @code{outside-staff-priority} will be placed closer to
the staff.
-@lilypond[quote,ragged-right,relative=2,verbatim]
-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
+@lilypond[quote,ragged-right,verbatim]
+\relative c'' {
+ 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
+}
@end lilypond
The vertical padding around outside-staff objects
can be controlled with @code{outside-staff-padding}.
-@lilypond[quote,ragged-right,relative=2,verbatim,staffsize=18]
-\once \override TextScript.outside-staff-padding = #0
-a4-"outside-staff-padding = #0"
-\once \override TextScript.outside-staff-padding = #3
-d-"outside-staff-padding = #3"
-c-"default outside-staff-padding"
-b-"default outside-staff-padding"
-R1
+@lilypond[quote,ragged-right,verbatim,staffsize=18]
+\relative {
+ \once \override TextScript.outside-staff-padding = #0
+ a'4-"outside-staff-padding = #0"
+ \once \override TextScript.outside-staff-padding = #3
+ d-"outside-staff-padding = #3"
+ c-"default outside-staff-padding"
+ b-"default outside-staff-padding"
+ R1
+}
@end lilypond
increases the horizontal spacing required, and in this case moves the text up
to prevent it from getting too close to the ledger lines.
-@lilypond[quote,ragged-right,relative=2,verbatim]
-c4^"Word" c c''2
-R1
-\once \override TextScript.outside-staff-horizontal-padding = #1
-c,,4^"Word" c c''2
+@lilypond[quote,ragged-right,verbatim]
+\relative {
+ c''4^"Word" c c''2
+ R1
+ \once \override TextScript.outside-staff-horizontal-padding = #1
+ c,,4^"Word" c c''2
+}
@end lilypond
@seealso
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.
-@lilypond[quote,verbatim,relative=1]
-c2 c4. c8
-c4. c8 c4. c8
-c8 c c4 c c
+@lilypond[quote,verbatim]
+\relative c' {
+ c2 c4. c8
+ c4. c8 c4. c8
+ c8 c c4 c c
+}
@end lilypond
Normally, @code{spacing-increment} is set to 1.2 staff space, which is
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:
-@lilypond[quote,verbatim,relative=2]
-c2 c4. c8 | c4. c16[ c] c4. c8 | c8 c c4 c c
+@lilypond[quote,verbatim]
+\relative { c''2 c4. c8 | c4. c16[ c] c4. c8 | c8 c c4 c c }
@end lilypond
once with exaggerated corrections:
@lilypond[quote,ragged-right]
-{
- c'4 e''4 e'4 b'4 |
- b'4 e''4 b'4 e''4 |
+\fixed c' {
+ c4 e'4 e4 b4 |
+ b4 e'4 b4 e'4 |
\override Staff.NoteSpacing.stem-spacing-correction = #1.5
\override Staff.StaffSpacing.stem-spacing-correction = #1.5
- c'4 e''4 e'4 b'4 |
- b'4 e''4 b'4 e''4 |
+ c4 e'4 e4 b4 |
+ b4 e'4 b4 e'4 |
}
@end lilypond
section, and hence the 16ths notes are automatically spaced slightly
wider.
-@lilypond[relative=1,verbatim,quote]
-\time 2/4
-c4 c8 c
-c8 c c4 c16[ c c8] c4
-\newSpacingSection
-\time 4/16
-c16[ c c8]
+@lilypond[verbatim,quote]
+\relative c' {
+ \time 2/4
+ c4 c8 c
+ c8 c c4 c16[ c c8] c4
+ \newSpacingSection
+ \time 4/16
+ c16[ c c8]
+}
@end lilypond
The @code{\newSpacingSection} command creates a new
music until the properties are changed in a new spacing section, for
example,
-@lilypond[relative=1,verbatim,quote]
-\time 4/16
-c16[ c c8]
-\newSpacingSection
-\override Score.SpacingSpanner.spacing-increment = #2
-c16[ c c8]
-\newSpacingSection
-\revert Score.SpacingSpanner.spacing-increment
-c16[ c c8]
+@lilypond[verbatim,quote]
+\relative c' {
+ \time 4/16
+ c16[ c c8]
+ \newSpacingSection
+ \override Score.SpacingSpanner.spacing-increment = #2
+ c16[ c c8]
+ \newSpacingSection
+ \revert Score.SpacingSpanner.spacing-increment
+ c16[ c c8]
+}
@end lilypond
When @code{strict-note-spacing} is set, notes are spaced without
regard for clefs, bar lines, and grace notes,
-@lilypond[quote,ragged-right,relative=2,verbatim]
+@lilypond[quote,ragged-right,fragment,verbatim]
\override Score.SpacingSpanner.strict-note-spacing = ##t
-\new Staff { c8[ c \clef alto c \grace { c16 c } c8 c c] c32[ c] }
+\new Staff \relative {
+ c''8[ c \clef alto c \grace { c16 c } c8 c c] c32[ c] }
@end lilypond
@seealso
another system without. For example, dynamics that @q{stick out} of
a system can be moved closer to the staff:
-@lilypond[verbatim,quote,relative=1]
-e4 c g\f c
-e4 c g-\tweak X-offset #-2.7 \f c
+@lilypond[verbatim,quote]
+\relative e' {
+ e4 c g\f c
+ e4 c g-\tweak X-offset #-2.7 \f c
+}
@end lilypond
@item
The basic staff context is @code{Staff}:
-@lilypond[verbatim,quote,relative=2]
-\new Staff { c4 d e f }
+@lilypond[verbatim,quote]
+\new Staff \relative { c''4 d e f }
@end lilypond
The @code{DrumStaff} context creates a five-line staff set up for
displays the rhythmic values of the input. Real durations are
preserved. For details, see @ref{Showing melody rhythms}.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new RhythmicStaff { c4 d e f }
@end lilypond
@code{TabStaff} creates a tablature with six strings in standard
guitar tuning. For details, see @ref{Default tablatures}.
-@lilypond[verbatim,quote,relative=2]
-\new TabStaff { c4 d e f }
+@lilypond[verbatim,quote]
+\new TabStaff \relative { c''4 d e f }
@end lilypond
There are two staff contexts specific for the notation of ancient
The @code{GregorianTranscriptionStaff} context creates a staff to
notate modern Gregorian chant. It does not show bar lines.
-@lilypond[verbatim,quote,relative=2]
-\new GregorianTranscriptionStaff { c4 d e f e d }
+@lilypond[verbatim,quote]
+\new GregorianTranscriptionStaff \relative { c''4 d e f e d }
@end lilypond
New single staff contexts may be defined. For details, see
the group is started with a vertical line, and the bar lines are
not connected.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
<<
- \new Staff { c1 c }
- \new Staff { c1 c }
+ \new Staff \relative { c''1 c }
+ \new Staff \relative { c''1 c }
>>
@end lilypond
In the @code{StaffGroup} context, the group is started with a
bracket and bar lines are drawn through all the staves.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new StaffGroup <<
- \new Staff { c1 c }
- \new Staff { c1 c }
+ \new Staff \relative { c''1 c }
+ \new Staff \relative { c''1 c }
>>
@end lilypond
In a @code{ChoirStaff}, the group starts with a bracket, but bar
lines are not connected.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new ChoirStaff <<
- \new Staff { c1 c }
- \new Staff { c1 c }
+ \new Staff \relative { c''1 c }
+ \new Staff \relative { c''1 c }
>>
@end lilypond
In a @code{GrandStaff}, the group begins with a brace, and bar
lines are connected between the staves.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new GrandStaff <<
- \new Staff { c1 c }
- \new Staff { c1 c }
+ \new Staff \relative { c''1 c }
+ \new Staff \relative { c''1 c }
>>
@end lilypond
that it supports printing the instrument name directly. For
details, see @ref{Instrument names}.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new PianoStaff <<
\set PianoStaff.instrumentName = #"Piano"
- \new Staff { c1 c }
- \new Staff { c1 c }
+ \new Staff \relative { c''1 c }
+ \new Staff \relative { \clef bass c1 c }
>>
@end lilypond
case, each child context creates a new bracket adjacent to the
bracket of its parent group.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new StaffGroup <<
- \new Staff { c2 c | c2 c }
+ \new Staff \relative { c''2 c | c2 c }
\new StaffGroup <<
- \new Staff { g2 g | g2 g }
+ \new Staff \relative { g'2 g | g2 g }
\new StaffGroup \with {
systemStartDelimiter = #'SystemStartSquare
}
<<
- \new Staff { e2 e | e2 e }
- \new Staff { c2 c | c2 c }
+ \new Staff \relative { e'2 e | e2 e }
+ \new Staff \relative { c'2 c | c2 c }
>>
>>
>>
stop or (re)start the staff lines respectively, from being printed at
any point witin a score.
-@lilypond[verbatim,quote,relative=2]
-\stopStaff f4 d \startStaff g, e
-f'4 d \stopStaff g, e
-f'4 d \startStaff g, e
+@lilypond[verbatim,quote]
+\relative {
+ \stopStaff f''4 d \startStaff g, e
+ f'4 d \stopStaff g, e
+ f'4 d \startStaff g, e
+}
@end lilypond
@predefined
The number of staff lines can be altered:
-@lilypond[verbatim,quote,relative=2]
-f4 d \stopStaff
-\override Staff.StaffSymbol.line-count = #2
-\startStaff g, e |
+@lilypond[verbatim,quote]
+\relative {
+ f''4 d \stopStaff
+ \override Staff.StaffSymbol.line-count = #2
+ \startStaff g, e |
-f'4 d \stopStaff
-\revert Staff.StaffSymbol.line-count
-\startStaff g, e |
+ f'4 d \stopStaff
+ \revert Staff.StaffSymbol.line-count
+ \startStaff g, e |
+}
@end lilypond
The position of each staff line can also be altered. A list of
printed for every value entered so that the number of staff lines, as
well as their position, can be changed with a single override.
-@lilypond[verbatim,quote,relative=2]
-f4 d \stopStaff
-\override Staff.StaffSymbol.line-positions = #'(1 3 5 -1 -3)
-\startStaff g, e |
-f'4 d \stopStaff
-\override Staff.StaffSymbol.line-positions = #'(8 6.5 -6 -8 -0.5)
-\startStaff g, e
+@lilypond[verbatim,quote]
+\relative {
+ f''4 d \stopStaff
+ \override Staff.StaffSymbol.line-positions = #'(1 3 5 -1 -3)
+ \startStaff g, e |
+ f'4 d \stopStaff
+ \override Staff.StaffSymbol.line-positions = #'(8 6.5 -6 -8 -0.5)
+ \startStaff g, e |
+}
@end lilypond
To preserve typical stem directions (in the bottom half of the staff
Staff line thickness can be altered. Ledger lines and note stems, by
default, are also affected.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.thickness = #3
+} \relative {
+ f''4 d g, e
}
-{ f4 d g, e }
@end lilypond
It is also possible to set ledger line thickness independently of staff
lines.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.thickness = #2
\override StaffSymbol.ledger-line-thickness = #'(0.5 . 0.4)
+} \relative {
+ f'''4 a, a,, f
}
-{ f'4 a, a,, f }
@end lilypond
@noindent
The vertical positions of ledger lines can be altered,
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.ledger-positions = #'(-3 -2 -1 2 5 6)
+} \relative {
+ f'''4 a, a,, f
}
-{ f'4 a, a,, f }
@end lilypond
Additional ledger lines can be made to appear above or below note heads
depending on the current position relative to other note heads that
also have their own ledger lines.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.ledger-extra = #4
+} \relative {
+ f'''4 a, d, f,
}
-{ f'4 a, d, f, }
@end lilypond
Ledger lines can also be made to appear inside the staff where custom
The @code{\stopStaff} is needed in the example to revert the
@code{\override} for the whole @code{StaffSymbol}.
-@lilypond[verbatim,quote,relative=1]
-\override Staff.StaffSymbol.line-positions = #'(-8 0 2 4)
-d4 e f g
-\stopStaff
-\startStaff
-\override Staff.StaffSymbol.ledger-positions = #'(-8 -6 (-4 -2) 0)
-d4 e f g
+@lilypond[verbatim,quote]
+\relative d' {
+ \override Staff.StaffSymbol.line-positions = #'(-8 0 2 4)
+ d4 e f g
+ \stopStaff
+ \startStaff
+ \override Staff.StaffSymbol.ledger-positions = #'(-8 -6 (-4 -2) 0)
+ d4 e f g
+}
@end lilypond
The distance between staff lines can be altered. This affects ledger
line spacing as well.
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Staff \with {
\override StaffSymbol.staff-space = #1.5
+} \relative {
+ f'''4 d, g, e,
}
-{ f'4 d, g, e, }
@end lilypond
@snippets
@code{instrumentName} is used for the first staff, and the value
of @code{shortInstrumentName} is used for all succeeding staves.
-@lilypond[verbatim,quote,ragged-right,relative=1]
+@lilypond[verbatim,quote,ragged-right]
\new Staff \with {
instrumentName = #"Violin "
shortInstrumentName = #"Vln. "
+} \relative {
+ c'4.. g'16 c4.. g'16 \break | c1 |
}
-{ c4.. g'16 c4.. g'16 \break | c1 }
@end lilypond
@cindex instrument names, complex
@code{\markup} can be used to create more complex instrument names:
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote]
\new Staff \with {
instrumentName = \markup {
\column { "Clarinetti"
\line { "in B" \smaller \flat }
}
}
+} \relative {
+ c''4 c,16 d e f g2
}
-{ c4 c,16 d e f g2 }
@end lilypond
@cindex instrument names, centering
names and short instrument names are centered by default. To center
multi-line instrument names, @code{\center-column} must be used:
-@lilypond[verbatim,quote,indent=1.5\cm,relative=2]
+@lilypond[verbatim,quote,indent=1.5\cm]
<<
\new Staff \with {
instrumentName = #"Flute"
- }
- { f2 g4 f }
+ } \relative {
+ f''2 g4 f
+}
\new Staff \with {
instrumentName = \markup {
\center-column { "Clarinet"
\line { "in B" \smaller \flat }
}
}
- }
- { c4 b c2 }
+ } \relative { c''4 b c2 }
>>
@end lilypond
settings, see @ref{paper variables for shifts and indents,,@code{@bs{}paper} variables for shifts and indents}.
@lilypond[verbatim,quote,ragged-right]
-\relative {
- <<
- \new Staff \with {
- instrumentName = #"Alto Flute in G"
- shortInstrumentName = #"Flt."
- }
- {
- f''2 g4 f \break
- g4 f g2
- }
- \new Staff \with {
- instrumentName = #"Clarinet"
- shortInstrumentName = #"Clar."
- }
- {
- c,4 b c2 \break
- c2 b4 c
- }
- >>
-}
+<<
+ \new Staff \with {
+ instrumentName = #"Alto Flute in G"
+ shortInstrumentName = #"Flt."
+ } \relative {
+ f''2 g4 f \break
+ g4 f g2
+ }
+ \new Staff \with {
+ instrumentName = #"Clarinet"
+ shortInstrumentName = #"Clar."
+ } \relative {
+ c''4 b c2 \break
+ c2 b4 c
+ }
+>>
\layout {
indent = 3.0\cm
The simplest way to format cue notes is to explicitly create a
@code{CueVoice} context within the part.
-@lilypond[verbatim,relative=1]
-R1
-<<
- { e2\rest r4. e8 }
- \new CueVoice {
- \stemUp d'8^"flute" c d e fis2
- }
->>
-d,4 r a r
+@lilypond[verbatim]
+\relative {
+ R1
+ <<
+ { e'2\rest r4. e8 }
+ \new CueVoice {
+ \stemUp d'8^"flute" c d e fis2
+ }
+ >>
+ d,4 r a r
+}
@end lilypond
The @code{\cueClef} command can also be used with an explict
command can then be used to switch back to the original clef, again with
an appropriately sized clef.
-@lilypond[verbatim,noragged-right,relative=1]
-\clef "bass"
-R1
-<<
- { e2\rest r4. \cueClefUnset e,8 }
- \new CueVoice {
- \cueClef "treble" \stemUp d''8^"flute" c d e fis2
- }
->>
-d,,4 r a r
+@lilypond[verbatim,noragged-right]
+\relative {
+ \clef "bass"
+ R1
+ <<
+ { e'2\rest r4. \cueClefUnset e,8 }
+ \new CueVoice {
+ \cueClef "treble" \stemUp d''8^"flute" c d e fis2
+ }
+ >>
+ d,,4 r a r
+}
@end lilypond
The @code{\cueClef} and @code{\cueClefUnset} command can also be used
without a @code{CueVoice} if required.
-@lilypond[verbatim,noragged-right,relative=1]
-\clef "bass"
-R1
-\cueClef "treble"
-d'8^"flute" c d e fis2
-\cueClefUnset
-d,,4 r a r
+@lilypond[verbatim,noragged-right]
+\relative {
+ \clef "bass"
+ R1
+ \cueClef "treble"
+ d''8^"flute" c d e fis2
+ \cueClefUnset
+ d,,4 r a r
+}
@end lilypond
For more complex cue note placement, e.g including transposition, or
manually placed above or below the staff, using the syntax described
in @ref{Direction and placement}.
-@lilypond[quote,verbatim,relative=2]
-a8^"pizz." g f e a4-"scherz." f
+@lilypond[quote,verbatim]
+\relative { a'8^"pizz." g f e a4-"scherz." f }
@end lilypond
This syntax is actually a shorthand; more complex text formatting may be
added to a note by explicitly using a @code{\markup} block, as described
in @ref{Formatting text}.
-@lilypond[quote,verbatim,relative=2]
-a8^\markup { \italic pizz. } g f e
-a4_\markup { \tiny scherz. \bold molto } f
+@lilypond[quote,verbatim]
+\relative {
+ a'8^\markup { \italic pizz. } g f e
+ a4_\markup { \tiny scherz. \bold molto } f }
@end lilypond
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.
-@lilypond[quote,verbatim,relative=2]
-a8^"pizz." g f e
-\textLengthOn
-a4_"scherzando" f
+@lilypond[quote,verbatim]
+\relative {
+ a'8^"pizz." g f e
+ \textLengthOn
+ a4_"scherzando" f
+}
@end lilypond
In addition to text scripts, articulations can be attached to notes.
@qq{spanners}, may be created from one note to another using the
following syntax:
-@lilypond[verbatim,quote,relative=2]
-\override TextSpanner.bound-details.left.text = "rit."
-b1\startTextSpan
-e,\stopTextSpan
+@lilypond[verbatim,quote]
+\relative {
+ \override TextSpanner.bound-details.left.text = "rit."
+ b'1\startTextSpan
+ e,\stopTextSpan
+}
@end lilypond
@cindex text spanners, formatting
obtained using @code{\markup} blocks, as described in
@ref{Formatting text}.
-@lilypond[quote,relative=2,verbatim]
-\override TextSpanner.bound-details.left.text =
- \markup { \upright "rit." }
-b1\startTextSpan c
-e,\stopTextSpan
+@lilypond[quote,verbatim]
+\relative {
+ \override TextSpanner.bound-details.left.text =
+ \markup { \upright "rit." }
+ b'1\startTextSpan c
+ e,\stopTextSpan
+}
@end lilypond
The line style, as well as the text string, can be defined as an
@c \mark needs to be placed on a separate line (it's not
@c attached to an object like \markup is). -vv
-@lilypond[verbatim,quote,relative=2]
-c4
-\mark "Allegro"
-c c c
+@lilypond[verbatim,quote]
+\relative {
+ c''4
+ \mark "Allegro"
+ c c c
+}
@end lilypond
This syntax makes it possible to put any text on a bar line;
more complex text formatting may be added using a @code{\markup}
block, as described in @ref{Formatting text}:
-@lilypond[quote,verbatim,relative=1]
-<c e>1
-\mark \markup { \italic { colla parte } }
-<d f>2 <e g>
-<c f aes>1
+@lilypond[quote,verbatim]
+\relative {
+ <c' e>1
+ \mark \markup { \italic { colla parte } }
+ <d f>2 <e g>
+ <c f aes>1
+}
@end lilypond
@noindent
or fermata, by specifying the appropriate symbol name as explained in
@ref{Music notation inside markup}:
-@lilypond[quote,verbatim,relative=2]
-<bes f>2 <aes d>
-\mark \markup { \musicglyph #"scripts.ufermata" }
-<e g>1
+@lilypond[quote,verbatim]
+\relative {
+ <bes' f>2 <aes d>
+ \mark \markup { \musicglyph #"scripts.ufermata" }
+ <e g>1
+}
@end lilypond
@noindent
specified at a line break, the mark will be printed at the beginning of
the next line.
-@lilypond[quote,verbatim,relative=2,ragged-right]
-\mark "Allegro"
-c1 c
-\mark "assai" \break
-c c
+@lilypond[quote,verbatim,ragged-right]
+\relative c'' {
+ \mark "Allegro"
+ c1 c
+ \mark "assai" \break
+ c c
+}
@end lilypond
@funindex \markLengthOn
backslash @code{\} character. Such commands only affect the first
following expression.
-@lilypond[quote,verbatim,relative=2]
-a1-\markup intenso
-a2^\markup { poco \italic più forte }
-c e1
-d2_\markup { \italic "string. assai" }
-e
-b1^\markup { \bold { molto \italic agitato } }
-c
+@lilypond[quote,verbatim]
+\relative {
+ a'1-\markup intenso
+ a2^\markup { poco \italic più forte }
+ c e1
+ d2_\markup { \italic "string. assai" }
+ e
+ b1^\markup { \bold { molto \italic agitato } }
+ c
+}
@end lilypond
@cindex special characters in markup mode
Double quotation marks themselves may be printed by preceding them
with backslashes.
-@lilypond[quote,verbatim,relative=2]
-a1^"\italic markup..."
-a_\markup { \italic "... prints \"italic\" letters!" }
-a a
+@lilypond[quote,verbatim]
+\relative {
+ a'1^"\italic markup..."
+ a_\markup { \italic "... prints \"italic\" letters!" }
+ a a
+}
@end lilypond
To be treated as a distinct expression, a list of words needs to be
centered and aligned; in the following example, the second
@code{\markup} expression is treated the same as the first one:
-@lilypond[quote,verbatim,relative=2]
-c1^\markup { \center-column { a bbb c } }
-c1^\markup { \center-column { a { bbb c } } }
-c1^\markup { \center-column { a \line { bbb c } } }
-c1^\markup { \center-column { a "bbb c" } }
+@lilypond[quote,verbatim]
+\relative c'' {
+ c1^\markup { \center-column { a bbb c } }
+ c1^\markup { \center-column { a { bbb c } } }
+ c1^\markup { \center-column { a \line { bbb c } } }
+ c1^\markup { \center-column { a "bbb c" } }
+}
@end lilypond
Markups can be stored in variables. Such variables may be
Basic font switching is supported in markup mode:
-@lilypond[quote,verbatim,relative=2]
-d1^\markup {
- \bold { Più mosso }
- \italic { non troppo \underline Vivo }
+@lilypond[quote,verbatim]
+\relative {
+ d''1^\markup {
+ \bold { Più mosso }
+ \italic { non troppo \underline Vivo }
+ }
+ r2 r4 r8
+ d,_\markup { \italic quasi \smallCaps Tromba }
+ f1 d2 r
}
-r2 r4 r8
-d,_\markup { \italic quasi \smallCaps Tromba }
-f1 d2 r
@end lilypond
@cindex font size
It can be set to predefined size,
-@lilypond[quote,verbatim,relative=2]
-b1_\markup { \huge Sinfonia }
-b1^\markup { \teeny da }
-b1-\markup { \normalsize camera }
+@lilypond[quote,verbatim]
+\relative b' {
+ b1_\markup { \huge Sinfonia }
+ b1^\markup { \teeny da }
+ b1-\markup { \normalsize camera }
+}
@end lilypond
It can be set relative to its previous value,
-@lilypond[quote,verbatim,relative=2]
-b1_\markup { \larger Sinfonia }
-b1^\markup { \smaller da }
-b1-\markup { \magnify #0.6 camera }
+@lilypond[quote,verbatim]
+\relative b' {
+ b1_\markup { \larger Sinfonia }
+ b1^\markup { \smaller da }
+ b1-\markup { \magnify #0.6 camera }
+}
@end lilypond
It can be increased or decreased relative to the value set by the
global staff size,
-@lilypond[quote,verbatim,relative=2]
-b1_\markup { \fontsize #-2 Sinfonia }
-b1^\markup { \fontsize #1 da }
-b1-\markup { \fontsize #3 camera }
+@lilypond[quote,verbatim]
+\relative b' {
+ b1_\markup { \fontsize #-2 Sinfonia }
+ b1^\markup { \fontsize #1 da }
+ b1-\markup { \fontsize #3 camera }
+}
@end lilypond
It can also be set to a fixed point-size, regardless of the global staff
size,
-@lilypond[quote,verbatim,relative=2]
-b1_\markup { \abs-fontsize #20 Sinfonia }
-b1^\markup { \abs-fontsize #8 da }
-b1-\markup { \abs-fontsize #14 camera }
+@lilypond[quote,verbatim]
+\relative b' {
+ b1_\markup { \abs-fontsize #20 Sinfonia }
+ b1^\markup { \abs-fontsize #8 da }
+ b1-\markup { \abs-fontsize #14 camera }
+}
@end lilypond
If the text includes spaces, then it is best to put it all inside quote
indication is aligned on its left edge: in the following example,
there is no difference between the first and the second markup.
-@lilypond[quote,verbatim,relative=2]
-d1-\markup { poco }
-f
-d-\markup { \left-align poco }
-f
-d-\markup { \center-align { poco } }
-f
-d-\markup { \right-align poco }
+@lilypond[quote,verbatim]
+\relative {
+ d''1-\markup { poco }
+ f
+ d-\markup { \left-align poco }
+ f
+ d-\markup { \center-align { poco } }
+ f
+ d-\markup { \right-align poco }
+}
@end lilypond
@funindex \halign
Horizontal alignment may be fine-tuned using a numeric value:
-@lilypond[quote,verbatim,relative=2]
-a1-\markup { \halign #-1 poco }
-e'
-a,-\markup { \halign #0 poco }
-e'
-a,-\markup { \halign #0.5 poco }
-e'
-a,-\markup { \halign #2 poco }
+@lilypond[quote,verbatim]
+\relative {
+ a'1-\markup { \halign #-1 poco }
+ e'
+ a,-\markup { \halign #0 poco }
+ e'
+ a,-\markup { \halign #0.5 poco }
+ e'
+ a,-\markup { \halign #2 poco }
+}
@end lilypond
@noindent
demonstrates these two possibilities; the last markup in this example
has no anchor point, and therefore is not moved.
-@lilypond[quote,verbatim,relative=1]
-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. }
+@lilypond[quote,verbatim]
+\relative {
+ d'2^\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
}
-a'4 a g2 a
@end lilypond
@funindex \general-align
text objects in markup mode. Any object affected by these commands
must be preceded with an anchor point:
-@lilypond[quote,verbatim,relative=1]
-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."
+@lilypond[quote,verbatim]
+\relative {
+ d'2^\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'4 a g2 a
@end lilypond
@cindex multi-line markup
native PostScript code. In such a case, it may be useful to
explicitly specify the size of the drawing, as demonstrated below:
-@lilypond[quote,verbatim,relative=1]
-c1^\markup {
+@lilypond[quote,verbatim,fragment]
+c'1^\markup {
\combine
\epsfile #X #10 #"./context-example.eps"
\with-dimensions #'(0 . 6) #'(0 . 10)
closepath
stroke"
}
-c
+c'
@end lilypond
An exhaustive list of graphics-specific commands can be found in
Notes and accidentals can be entered using markup commands:
-@lilypond[quote,verbatim,relative=2]
-a2 a^\markup {
+@lilypond[quote,verbatim,fragment]
+a'2 a'^\markup {
\note #"4" #1
=
\note-by-number #1 #1 #1.5
}
-b1_\markup {
+b'1_\markup {
\natural \semiflat \flat
\sesquiflat \doubleflat
}
\glissando
-a1_\markup {
+a'1_\markup {
\natural \semisharp \sharp
\sesquisharp \doublesharp
}
-\glissando b
+\glissando b'
@end lilypond
Other notation objects may also be printed
in markup mode:
-@lilypond[quote,verbatim,relative=1]
-g1 bes
-ees\finger \markup \tied-lyric #"4~1"
-fis_\markup { \dynamic rf }
-bes^\markup {
- \beam #8 #0.1 #0.5
-}
-cis
-d-\markup {
- \markalphabet #8
- \markletter #8
+@lilypond[quote,verbatim]
+\relative {
+ g1 bes
+ ees\finger \markup \tied-lyric #"4~1"
+ fis_\markup { \dynamic rf }
+ bes^\markup {
+ \beam #8 #0.1 #0.5
+ }
+ cis
+ d-\markup {
+ \markalphabet #8
+ \markletter #8
+ }
}
@end lilypond
list of these symbols and their names can be found in
@ref{The Feta font}.
-@lilypond[quote,verbatim,relative=2]
-c2
-c'^\markup { \musicglyph #"eight" }
-c,4
-c,8._\markup { \musicglyph #"clefs.G_change" }
-c16
-c2^\markup { \musicglyph #"timesig.neomensural94" }
+@lilypond[quote,verbatim]
+\relative {
+ c''2
+ c'^\markup { \musicglyph #"eight" }
+ c,4
+ c,8._\markup { \musicglyph #"clefs.G_change" }
+ c16
+ c2^\markup { \musicglyph #"timesig.neomensural94" }
+}
@end lilypond
Another way of printing non-text glyphs is described in
The markup mode also supports diagrams for specific
instruments:
-@lilypond[quote,verbatim,relative=2]
-c1^\markup {
- \fret-diagram-terse #"x;x;o;2;3;2;"
-}
-c^\markup {
- \harp-pedal #"^-v|--ov^"
-}
-c
-c^\markup {
- \combine
- \musicglyph #"accordion.discant"
+@lilypond[quote,verbatim]
+\relative {
+ c''1^\markup {
+ \fret-diagram-terse #"x;x;o;2;3;2;"
+ }
+ c^\markup {
+ \harp-pedal #"^-v|--ov^"
+ }
+ c
+ c^\markup {
\combine
- \raise #0.5 \musicglyph #"accordion.dot"
- \raise #1.5 \musicglyph #"accordion.dot"
+ \musicglyph #"accordion.discant"
+ \combine
+ \raise #0.5 \musicglyph #"accordion.dot"
+ \raise #1.5 \musicglyph #"accordion.dot"
+ }
}
@end lilypond
case, the nested @code{\score} block must contain a @code{\layout}
block, as demonstrated here:
-@lilypond[quote,verbatim,relative=1]
-c4 d^\markup {
- \score {
- \relative { c'4 d e f }
- \layout { }
+@lilypond[quote,verbatim]
+\relative {
+ c'4 d^\markup {
+ \score {
+ \relative { c'4 d e f }
+ \layout { }
+ }
}
+ e f |
+ c d e f
}
-e f |
-c d e f
@end lilypond
An exhaustive list of music notation related commands can be found in
LilyPond @code{feta} non-text fonts to be used directly in markup
mode:
-@lilypond[quote,verbatim,relative=2]
-a1^\markup {
+@lilypond[quote,verbatim,fragment]
+a'1^\markup {
\vcenter {
\override #'(font-encoding . fetaBraces)
\lookup #"brace120"
series and sizes. The value supplied to @code{font-size} is the
required change from the default size.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\override Score.RehearsalMark.font-family = #'typewriter
\mark \markup "Ouverture"
\override Voice.TextScript.font-shape = #'italic
\override Voice.TextScript.font-series = #'bold
-d2.^\markup "Allegro"
+d''2.^\markup "Allegro"
\override Voice.TextScript.font-size = #-3
-c4^smaller
+c''4^smaller
@end lilypond
@noindent
Any font that is installed on the operating system and recognized by
FontConfig may be used in a score, using the following syntax:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\override Staff.TimeSignature.font-name = #"Bitstream Charter"
\override Staff.TimeSignature.font-size = #2
\time 3/4
-a1_\markup {
+a'1_\markup {
\override #'(font-name . "Vera Bold")
{ Vera Bold }
}
The bowing commands, @code{\upbow} and @code{\downbow}, are used
with slurs as follows:
-@lilypond[verbatim,quote,relative=2]
-c4(\downbow d) e(\upbow f)
+@lilypond[verbatim,quote]
+\relative { c''4(\downbow d) e(\upbow f) }
@end lilypond
@noindent
markup commands; articulation scripts may also indicate
open strings.
-@lilypond[verbatim,quote,relative=2]
-a4 \open
+@lilypond[verbatim,quote,fragment]
+a'4 \open
\romanStringNumbers
-a\2
-a2^\markup { \small "sul A" }
+a'\2
+a'2^\markup { \small "sul A" }
@end lilypond
note head generally means to touch the string where you would stop
the note if it were not a diamond.
-@lilypond[verbatim,quote,relative=2]
-d4 e4.
-\harmonicsOn
-d8 e e
-d4 e4.
-\harmonicsOff
-d8 e e
+@lilypond[verbatim,quote]
+\relative d'' {
+ d4 e4.
+ \harmonicsOn
+ d8 e e
+ d4 e4.
+ \harmonicsOff
+ d8 e e
+}
@end lilypond
Alternatively a normal note head is shown at the pitch to be
sounded together with a small circle to indicate it should be
played as a harmonic:
-@lilypond[verbatim,quote,relative=2]
-d2^\flageolet d_\flageolet
+@lilypond[verbatim,quote,fragment]
+d''2^\flageolet d''_\flageolet
@end lilypond
A smaller circle may be created, see the snippet list in
dots. The context property @code{harmonicDots} should be set if
dots are required.
-@lilypond[verbatim,quote,relative=1]
-<e a\harmonic>2. <c g'\harmonic>4
-\set harmonicDots = ##t
-<e a\harmonic>2. <c g'\harmonic>4
+@lilypond[verbatim,quote]
+\relative e' {
+ <e a\harmonic>2. <c g'\harmonic>4
+ \set harmonicDots = ##t
+ <e a\harmonic>2. <c g'\harmonic>4
+}
@end lilypond
@warning{@code{@bs{}harmonic} @strong{must} be placed inside a
type of pizzicato where the string is deliberately plucked upwards
(rather than sideways) such that it hits the fingerboard.
-@lilypond[verbatim,quote,relative=1]
-c4\snappizzicato
-<c' e g>4\snappizzicato
-<c' e g>4^\snappizzicato
-<c, e g>4_\snappizzicato
+@lilypond[verbatim,quote]
+\relative {
+ c'4\snappizzicato
+ <c' e g>4\snappizzicato
+ <c' e g>4^\snappizzicato
+ <c, e g>4_\snappizzicato
+}
@end lilypond
the named Voice context containing the melody with
@code{\lyricsto}:
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
<<
- \new Voice = "melody" {
- a1 a4. a8 a2
+ \new Voice = "melody" \relative {
+ a'1 a4. a8 a2
}
\new Lyrics \lyricsto "melody" {
These are the words
Here are two examples:
-@lilypond[relative=1,verbatim,quote]
+@lilypond[verbatim,quote]
<<
- \new Voice = "melody" {
- c'2 a f f e e
+ \new Voice = "melody" \relative {
+ c''2 a f f e e
}
\new Lyrics \lyricmode {
c4. -- a -- f -- f -- e2. -- e
To change syllable alignment, simply override the @code{self-alignment-X}
property:
-@lilypond[relative=1,verbatim,quote]
+@lilypond[verbatim,quote]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
- c2 e4 g2 f
+ c'2 e4 g2 f
}
\new Lyrics \lyricmode {
\override LyricText.self-alignment-X = #LEFT
quotes or use a @code{_} character. Alternatively, you can use
the tilde symbol (@code{~}) to get a lyric tie.
-@lilypond[quote,ragged-right,verbatim,relative=2]
+@lilypond[quote,ragged-right,verbatim]
{
- { \autoBeamOff
- r8 b c fis, fis c' b e,
+ \relative {
+ \autoBeamOff
+ r8 b' c fis, fis c' b e,
}
\addlyrics
{
Melismata are created automatically over notes which are tied
together:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
- f4 g2 ~ |
+ f''4 g2 ~ |
4 e2 ~ |
8
}
slurs over the notes of each melisma. This is the usual way of
entering lyrics:
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
- f4 g8 ( f e f )
+ f''4 g8 ( f e f )
e8 ( d e2 )
}
\new Lyrics \lyricsto "melody" {
providing automatic beaming is switched off. See
@ref{Setting automatic beam behavior}.
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
\autoBeamOff
- f4 g8[ f e f]
+ f''4 g8[ f e f]
e2.
}
\new Lyrics \lyricsto "melody" {
An unslurred group of notes will be treated as a melisma if they
are bracketed between @code{\melisma} and @code{\melismaEnd}.
-@lilypond[quote,relative=2,verbatim]
+@lilypond[quote,verbatim]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
- f4 g8
+ f''4 g8
\melisma
f e f
\melismaEnd
single underscore character, @code{_}, for every extra note that has
to be added to the melisma.
-@lilypond[verbatim, quote, relative=2]
+@lilypond[verbatim, quote]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
- f4 g8 f e f
+ f''4 g8 f e f
e8 d e2
}
\new Lyrics \lyricsto "melody" {
without their indicating melismata. To do this, set
@code{melismaBusyProperties}:
-@lilypond[relative=1,verbatim,quote]
+@lilypond[verbatim,quote]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
\set melismaBusyProperties = #'()
- c4 d ( e )
+ c'4 d ( e )
g8 [ f ] f4 ~ 4
}
\new Lyrics \lyricsto "melody" {
placing a single underscore in the lyrics for each note which
should be included in the melisma:
-@lilypond[relative=1,verbatim,quote]
+@lilypond[verbatim,quote]
<<
- \new Voice = "melody" {
+ \new Voice = "melody" \relative {
\time 3/4
\set melismaBusyProperties = #'()
- c4 d ( e )
+ c'4 d ( e )
g8 [ f ] ~ 4 ~ f
}
\new Lyrics \lyricsto "melody" {
To increase the spacing between lyrics, set the
@code{minimum-distance} property of @code{LyricSpace}.
-@lilypond[relative=1,verbatim,quote,ragged-right]
-{
+@lilypond[verbatim,quote,ragged-right]
+\relative c' {
c c c c
\override Lyrics.LyricSpace.minimum-distance = #1.0
c c c c
Stanza numbers can be added by setting @code{stanza}, e.g.,
-@lilypond[quote,ragged-right,verbatim,relative=2]
-\new Voice {
- \time 3/4 g2 e4 a2 f4 g2.
+@lilypond[quote,ragged-right,verbatim]
+\new Voice \relative {
+ \time 3/4 g'2 e4 a2 f4 g2.
} \addlyrics {
\set stanza = #"1. "
Hi, my name is Bert.
@code{vocalName}. A short version may be entered as
@code{shortVocalName}.
-@lilypond[ragged-right,quote,verbatim,relative=2]
-\new Voice {
- \time 3/4 g2 e4 a2 f4 g2.
+@lilypond[ragged-right,quote,verbatim]
+\new Voice \relative {
+ \time 3/4 g'2 e4 a2 f4 g2.
} \addlyrics {
\set vocalName = #"Bert "
Hi, my name is Bert.
applying to that character. This can be done with markup. Often a
specific font is used for this purpose.
-@lilypond[quote,verbatim,relative=1]
-\clef "G_8"
-c4^\markup \fontsize #1 \smallCaps Kaspar
-c c c
-\clef "bass"
-a4^\markup \fontsize #1 \smallCaps Melchior
-a a a
-\clef "G_8"
-c4^\markup \fontsize #1 \smallCaps Kaspar
-c c c
+@lilypond[quote,verbatim]
+\relative c' {
+ \clef "G_8"
+ c4^\markup \fontsize #1 \smallCaps Kaspar
+ c c c
+ \clef "bass"
+ a4^\markup \fontsize #1 \smallCaps Melchior
+ a a a
+ \clef "G_8"
+ c4^\markup \fontsize #1 \smallCaps Kaspar
+ c c c
+}
@end lilypond
Alternatively, if there are many character changes, it may be easier
For short interjections a simple markup suffices.
-@lilypond[quote,verbatim,relative=2]
-a4^\markup { \smallCaps { Alex - } \italic { He's gone } } a a a
-a4 a a^\markup { \smallCaps { Bethan - } \italic Where? } a
-a4 a a a
+@lilypond[quote,verbatim]
+\relative {
+ a'4^\markup { \smallCaps { Alex - } \italic { He's gone } } a a a
+ a4 a a^\markup { \smallCaps { Bethan - } \italic Where? } a
+ a4 a a a
+}
@end lilypond
For longer phrases it may be necessary to expand the music to make
cadenza. If the section is long you may need to insert dummy
bar lines with @code{\bar ""} to show where the line should break.
-@lilypond[verbatim,quote,relative=2]
-a4 b c2 |
-\cadenzaOn
-a4 b c2
-a4 b c2
-\bar ""
-a4 b c2
-a4 b c2
-\cadenzaOff
-a4 b c2 |
-a4 b c2 |
+@lilypond[verbatim,quote]
+\relative a' {
+ a4 b c2 |
+ \cadenzaOn
+ a4 b c2
+ a4 b c2
+ \bar ""
+ a4 b c2
+ a4 b c2
+ \cadenzaOff
+ a4 b c2 |
+ a4 b c2 |
+}
@end lilypond
Rests or pauses in chants can be indicated by modified bar lines.
-@lilypond[verbatim, quote,relative=2]
-a4
-\cadenzaOn
-b c2
-a4 b c2
-\bar "'"
-a4 b c2
-a4 b c2
-\bar ";"
-a4 b c2
-\bar "!"
-a4 b c2
-\bar "||"
+@lilypond[verbatim, quote]
+\relative a' {
+ a4
+ \cadenzaOn
+ b c2
+ a4 b c2
+ \bar "'"
+ a4 b c2
+ a4 b c2
+ \bar ";"
+ a4 b c2
+ \bar "!"
+ a4 b c2
+ \bar "||"
+}
@end lilypond
Alternatively, the notation used in Gregorian chant for pauses or
Woodwind diagrams are created as markups:
-@lilypond[verbatim,quote,relative=2]
-c1^\markup {
+@lilypond[verbatim,quote,fragment]
+c''1^\markup {
\woodwind-diagram #'piccolo #'((lh . (gis))
(cc . (one three))
(rh . (ees)))
Keys can be open, partially-covered, ring-depressed, or fully covered:
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote,fragment]
\textLengthOn
-c1^\markup {
+c''1^\markup {
\center-column {
"one quarter"
\woodwind-diagram #'flute #'((cc . (one1q))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"one half"
\woodwind-diagram #'flute #'((cc . (one1h))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"three quarter"
\woodwind-diagram #'flute #'((cc . (one3q))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"ring"
\woodwind-diagram #'flute #'((cc . (oneR))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"full"
\woodwind-diagram #'flute #'((cc . (oneF two))
Trills are indicated as shaded keys:
-@lilypond[verbatim,quote,relative=2]
-c1^\markup {
+@lilypond[verbatim,quote,fragment]
+c''1^\markup {
\woodwind-diagram #'bass-clarinet
#'((cc . (threeT four))
(lh . ())
A variety of trills can be displayed:
-@lilypond[verbatim,quote,relative=2]
+@lilypond[verbatim,quote,fragment]
\textLengthOn
-c1^\markup {
+c''1^\markup {
\center-column {
"one quarter to ring"
\woodwind-diagram #'flute #'((cc . (one1qTR))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"ring to shut"
\woodwind-diagram #'flute #'((cc . (oneTR))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"ring to open"
\woodwind-diagram #'flute #'((cc . (oneRT))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"open to shut"
\woodwind-diagram #'flute #'((cc . (oneT))
}
}
-c1^\markup {
+c''1^\markup {
\center-column {
"one quarter to three quarters"
\woodwind-diagram #'flute #'((cc . (one1qT3q))
colored red, but in fact it results in two staves with the note
heads remaining the default black in the lower staff.
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim,fragment]
\override Staff.NoteHead.color = #red
-\new Staff { a }
+\new Staff { a' }
@end lilypond
This is because a @code{Staff} context does not exist when the
another, separate, staff into which the notes are placed. The
correct code to color all note heads red is
-@lilypond[quote,verbatim,relative=2]
+@lilypond[quote,verbatim]
\new Staff {
\override Staff.NoteHead.color = #red
- a
+ a'
}
@end lilypond