1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. See TRANSLATION for details.
12 @lilypondfile[quote]{repeats-headword.ly}
14 Repetition is a central concept in music, and multiple notations
15 exist for repetitions.
23 @subsection Writing repeats
25 This section discusses how to write repeats, including repeated
26 sections of music enclosed within repeat bars, alternate repeat
27 endings, tremolos, and beat or measure repeats.
32 * Manual repeat commands::
37 @subsubsection Repeat syntax
41 @cindex syntax, repeat
43 LilyPond has one syntactic construct for specifying different
44 types of repeats. The syntax is
47 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
50 where @var{repeabody} is a music expression.
52 The following types of repetition are supported
59 The repeated music is not written out but enclosed in repeat bar
60 lines. If the repeat is at the beginning of a piece, a repeat bar
61 line is only printed at the end. Alternative endings (volte) are
62 printed, left to right with brackets. This is the standard
63 notation for repeats with alternatives.
65 @cindex repetitious music
68 The repeated music is fully written out, as many times as
69 specified by @var{repeatcount}. This is useful when
70 entering repetitious music.
74 @cindex beams, tremolo
80 @cindex measure repeat
81 @cindex percent sign, for repeat
84 Make beat or measure repeats. These look like percent signs.
85 Percent repeats must be declared within a @code{Voice} context.
89 Alternative endings are entered with
90 @funindex \alternative
101 after a @code{\repeat volta} or @code{unfold} block, where each
102 @var{alternative} is a music expression. If you give
103 less alternatives than @var{repeatcount}, the first alternative
104 is assumed to be played more than once.
108 @subsubsection Normal repeats
112 @cindex seconda volta
114 @cindex volta, seconda
117 Normal repeats, with or without alternate repeats:
119 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
120 \repeat volta 2 { c4 d e f }
121 \repeat volta 2 { g f e d }
128 Repeats with upbeats:
130 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
133 \repeat volta 4 { c2 d2 | e2 f2 | }
134 \alternative { { g4 g g e } { a a a a | b2. } }
141 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
144 \repeat volta 4 { e | c2 d2 | e2 f2 | }
145 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
152 Ties may be added to a second ending:
154 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
156 \repeat volta 2 {c4 d e f ~ }
157 \alternative { {f2 d} {f\repeatTie f,} }
160 By default, the volta brackets will be drawn over all of the
161 alternative music, but it is possible to shorten them by
162 setting @code{voltaSpannerDuration}. In the next example, the
163 bracket only lasts one measure, which is a duration of 3/4.
165 @lilypond[verbatim,ragged-right,quote]
169 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
170 \repeat volta 5 { d d d }
171 \alternative { { e e e f f f }
176 The @code{Volta_engraver} by default resides in the Score context,
177 and brackets for the repeat are thus normally only printed over
178 the topmost staff. This can be adjusted by adding
179 @code{Volta_engraver} to the Staff context where you want the
180 brackets to appear; see @ref{Modifying context plug-ins} and
181 @c @lsr{repeats,volta@/-multi@/-staff@/.ly}.
183 @lilypond[verbatim,ragged-right,quote]
185 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
186 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
187 \new Staff \with { \consists Volta_engraver } { c'2 g' e' a' }
188 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
192 @c Is there a way to have a final bar ("|.") at the end of the
193 @c previous line? Doesn't seem to be.
194 If you want to start a repeat at the beginning of a line and have
195 a double bar at the end of the previous line, use
198 @dots{} \bar "||:" \break
199 \repeat volta 2 @{ @dots{}
202 see @ref{Bar lines} for more information.
206 Snippets: @lsrdir{Repeats,Repeats}
208 Internals Reference: @internalsref{VoltaBracket},
209 @internalsref{RepeatedMusic},
210 @internalsref{VoltaRepeatedMusic}, and
211 @internalsref{UnfoldedRepeatedMusic}.
218 @cindex repeat, ambiguous
229 is ambiguous, since it is is not clear to which @code{\repeat} the
230 @code{\alternative} belongs. This ambiguity is resolved by always
231 having the @code{\alternative} belong to the inner @code{\repeat}.
232 For clarity, it is advisable to use braces in such situations.
234 Timing information is not remembered at the start of an
235 alternative, so after a repeat timing information must be reset by
236 hand; for example, by setting @code{Score.measurePosition} or
237 entering @code{\partial}. Similarly, slurs or ties are also not
242 @node Manual repeat commands
243 @subsubsection Manual repeat commands
245 @funindex repeatCommands
247 @c FIXME: Markup does not work in the "text" field
248 @c And how does one change the font?
249 @c On the whole, this section needs better documentation (why the
250 @c double parentheses around the volta expressions?)
252 The property @code{repeatCommands} can be used to control the
253 layout of repeats. Its value is a Scheme list of repeat commands.
256 @item @code{start-repeat}
257 Print a @code{|:} bar line.
259 @item @code{end-repeat}
260 Print a @code{:|} bar line.
262 @item @code{(volta @var{text})}
263 Print a volta bracket saying @var{text}. The text can be
264 specified as a text string or as a markup text, see @ref{Text
265 markup}. Do not forget to change the font, as the default number
266 font does not contain alphabetic characters;
269 @item @code{(volta #f)}
270 Stop a running volta bracket.
273 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
275 \set Score.repeatCommands = #'((volta "93") end-repeat)
277 \set Score.repeatCommands = #'((volta #f))
281 @c FIXME: improve visibility of bar lines link?
285 Notation Reference: @ref{Bar lines}.
287 Snippets: @lsrdir{Repeats,Repeats}
289 Internals Reference: @internalsref{VoltaBracket},
290 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
291 and @internalsref{UnfoldedRepeatedMusic}.
295 @subsection Other repeats
302 @node Tremolo repeats
303 @subsubsection Tremolo repeats
305 @cindex tremolo beams
307 To place tremolo marks between notes, use @code{\repeat} with
310 @lilypond[quote,verbatim,ragged-right]
311 \new Voice \relative c' {
312 \repeat tremolo 8 { c16 d16 }
313 \repeat tremolo 4 { c16 d16 }
314 \repeat tremolo 2 { c16 d16 }
318 The @code{\repeat tremolo} syntax expects exactly two notes within
319 the braces, and the number of repetitions must correspond to a
320 note value that can be expressed with plain or dotted notes. Thus,
321 @code{\repeat tremolo 7} is valid and produces a double dotted
322 note, but @code{\repeat tremolo 9} is not.
324 The duration of the tremolo equals the duration of the
325 braced expression multiplied by the number of repeats:
326 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
327 notated as two whole notes joined by tremolo beams.
329 There are two ways to put tremolo marks on a single note. The
330 @code{\repeat tremolo} syntax can be used even here, in which case
331 the note should not be surrounded by braces:
333 @lilypond[quote,verbatim,ragged-right]
334 \repeat tremolo 4 c'16
337 @cindex tremolo marks
338 @funindex tremoloFlags
340 The same output can be obtained by adding
341 @q{@code{:}[@var{number}]} after the note. The number indicates
342 the duration of the subdivision, and it must be at least 8. A
343 @var{number} value of 8 gives one line across the note stem. If
344 the length is omitted, the last value (stored in
345 @code{tremoloFlags}) is used
347 @lilypond[quote,ragged-right,verbatim,fragment]
348 c'2:8 c':32 | c': c': |
355 Tremolos entered with @q{@code{:}[@var{number}]} do not carry over
356 into the MIDI output.
361 Notation Reference: @ref{Tremolo repeats}.
363 Internals Reference: @internalsref{Beam},
364 @internalsref{StemTremolo}.
366 Snippets: @lsrdir{Repeats,Repeats}
368 Elsewhere: @internalsref{StemTremolo}.
371 @node Measure repeats
372 @subsubsection Measure repeats
374 @cindex percent repeats
375 @cindex measure repeats
377 A note pattern can be repeated with the @code{\repeat percent
378 @var{number}} syntax. The music is printed once, and the pattern
379 is replaced with a special sign. Patterns of one and two measures
380 are replaced by percent-like signs, patterns that divide the
381 measure length are replaced by slashes. Percent repeats must be
382 declared within a @code{Voice} context.
384 @lilypond[quote,verbatim,ragged-right]
385 \new Voice \relative c' {
386 \repeat percent 4 { c4 }
387 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
391 Measure repeats of more than two measures get a counter if you
392 switch on the @code{countPercentRepeats} property:
394 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
396 \set countPercentRepeats = ##t
397 \repeat percent 4 { c1 }
402 Isolated percents can also be printed. This is done by entering a
403 multi-measure rest with a different print function:
405 @lilypond[fragment,verbatim,quote]
406 \override MultiMeasureRest #'stencil
407 = #ly:multi-measure-rest::percent
416 Snippets: @lsrdir{Repeats,Repeats}
418 Internals Reference: @internalsref{RepeatSlash},
419 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
420 @internalsref{DoublePercentRepeatCounter},
421 @internalsref{PercentRepeatCounter},
422 @internalsref{PercentRepeatedMusic}.