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[ragged-right,line-width=16\cm,staffsize=16,quote]
15 Repetition is a central concept in music, and multiple notations
16 exist for repetitions.
24 @subsection Writing repeats
31 * Manual repeat commands::
36 @unnumberedsubsubsec Repeat syntax
40 LilyPond has one syntactic construct for specifying different
41 types of repeats. The syntax is
44 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
47 where @var{repeabody} is a music expression.
49 The following types of repetition are supported
53 The repeated music is not written out but enclosed in repeat bar
54 lines. If the repeat is at the beginning of a piece, a repeat bar
55 line is only printed at the end. Alternative endings (volte) are
56 printed, left to right with brackets. This is the standard
57 notation for repeats with alternatives.
60 The repeated music is fully written out, as many times as
61 specified by @var{repeatcount}. This is useful when
62 entering repetitious music.
68 Make beat or measure repeats. These look like percent signs.
69 Percent repeats must be declared within a @code{Voice} context.
73 Alternative endings are entered with
74 @funindex \alternative
85 after a @code{\repeat volta} or @code{unfold} block, where each
86 @var{alternative} is a music expression. If you give
87 less alternatives than @var{repeatcount}, the first alternative
88 is assumed to be played more than once.
92 @unnumberedsubsubsec Normal repeats
99 Normal repeats, with or without alternate repeats:
101 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
102 \repeat volta 2 { c4 d e f }
103 \repeat volta 2 { g f e d }
111 Repeats with upbeats:
113 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
116 \repeat volta 4 { c2 d2 | e2 f2 | }
117 \alternative { { g4 g g e } { a a a a | b2. } }
124 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
127 \repeat volta 4 { e | c2 d2 | e2 f2 | }
128 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
135 Ties may be added to a second ending:
137 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
139 \repeat volta 2 {c4 d e f ~ }
140 \alternative { {f2 d} {f\repeatTie f,} }
143 By default, the volta brackets will be drawn over all of the
144 alternative music, but it is possible to shorten them by
145 setting @code{voltaSpannerDuration}. In the next example, the
146 bracket only lasts one measure, which is a duration of 3/4.
148 @lilypond[verbatim,ragged-right,quote]
152 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
153 \repeat volta 5 { d d d }
154 \alternative { { e e e f f f }
159 The @code{Volta_engraver} by default resides in the Score context,
160 and brackets for the repeat are thus normally only printed over
161 the topmost staff. This can be adjusted by adding
162 @code{Volta_engraver} to the Staff context where you want the
163 brackets to appear; see @ref{Modifying context plug-ins} and
164 @c @lsr{repeats,volta@/-multi@/-staff@/.ly}.
166 @lilypond[verbatim,ragged-right,quote]
168 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
169 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
170 \new Staff \with { \consists Volta_engraver } { c'2 g' e' a' }
171 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
175 @c Is there a way to have a final bar ("|.") at the end of the
176 @c previous line? Doesn't seem to be.
177 If you want to start a repeat at the beginning of a line and have
178 a double bar at the end of the previous line, use
181 @dots{} \bar "||:" \break
182 \repeat volta 2 @{ @dots{}
185 see @ref{Bar lines} for more information.
189 Snippets: @lsrdir{repeats}
191 Internals Reference: @internalsref{VoltaBracket},
192 @internalsref{RepeatedMusic},
193 @internalsref{VoltaRepeatedMusic}, and
194 @internalsref{UnfoldedRepeatedMusic}.
201 @cindex repeat, ambiguous
212 is ambiguous, since it is is not clear to which @code{\repeat} the
213 @code{\alternative} belongs. This ambiguity is resolved by always
214 having the @code{\alternative} belong to the inner @code{\repeat}.
215 For clarity, it is advisable to use braces in such situations.
217 Timing information is not remembered at the start of an
218 alternative, so after a repeat timing information must be reset by
219 hand; for example, by setting @code{Score.measurePosition} or
220 entering @code{\partial}. Similarly, slurs or ties are also not
225 @node Manual repeat commands
226 @unnumberedsubsubsec Manual repeat commands
228 @funindex repeatCommands
230 @c FIXME: Markup does not work in the "text" field
231 @c And how does one change the font?
232 @c On the whole, this section needs better documentation (why the
233 @c double parentheses around the volta expressions?)
235 The property @code{repeatCommands} can be used to control the
236 layout of repeats. Its value is a Scheme list of repeat commands.
239 @item @code{start-repeat}
240 Print a @code{|:} bar line.
242 @item @code{end-repeat}
243 Print a @code{:|} bar line.
245 @item @code{(volta @var{text})}
246 Print a volta bracket saying @var{text}. The text can be
247 specified as a text string or as a markup text, see @ref{Text
248 markup}. Do not forget to change the font, as the default number
249 font does not contain alphabetic characters;
252 @item @code{(volta #f)}
253 Stop a running volta bracket.
256 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
258 \set Score.repeatCommands = #'((volta "93") end-repeat)
260 \set Score.repeatCommands = #'((volta #f))
264 @c FIXME: improve visibility of bar lines link?
268 Notation Reference: @ref{Bar lines}.
270 Snippets: @lsrdir{repeats}
272 Internals Reference: @internalsref{VoltaBracket},
273 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
274 and @internalsref{UnfoldedRepeatedMusic}.
278 @subsection Other repeats
285 @node Tremolo repeats
286 @unnumberedsubsubsec Tremolo repeats
288 @cindex tremolo beams
290 To place tremolo marks between notes, use @code{\repeat} with
293 @lilypond[quote,verbatim,ragged-right]
294 \new Voice \relative c' {
295 \repeat tremolo 8 { c16 d16 }
296 \repeat tremolo 4 { c16 d16 }
297 \repeat tremolo 2 { c16 d16 }
301 The @code{\repeat tremolo} syntax expects exactly two notes within
302 the braces, and the number of repetitions must correspond to a
303 note value that can be expressed with plain or dotted notes. Thus,
304 @code{\repeat tremolo 7} is valid and produces a double dotted
305 note, but @code{\repeat tremolo 9} is not.
307 The duration of the tremolo equals the duration of the
308 braced expression multiplied by the number of repeats:
309 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
310 notated as two whole notes joined by tremolo beams.
312 There are two ways to put tremolo marks on a single note. The
313 @code{\repeat tremolo} syntax can be used even here, in which case
314 the note should not be surrounded by braces:
316 @lilypond[quote,verbatim,ragged-right]
317 \repeat tremolo 4 c'16
320 @cindex tremolo marks
321 @funindex tremoloFlags
323 The same output can be obtained by adding
324 @q{@code{:}[@var{number}]} after the note. The number indicates
325 the duration of the subdivision, and it must be at least 8. A
326 @var{number} value of 8 gives one line across the note stem. If
327 the length is omitted, the last value (stored in
328 @code{tremoloFlags}) is used
330 @lilypond[quote,ragged-right,verbatim,fragment]
331 c'2:8 c':32 | c': c': |
338 Tremolos entered with @q{@code{:}[@var{number}]} do not carry over
339 into the MIDI output.
344 Notation Reference: @ref{Tremolo repeats}.
346 Internals Reference: @internalsref{Beam},
347 @internalsref{StemTremolo}.
349 Snippets: @lsrdir{repeats}
351 Elsewhere: @internalsref{StemTremolo}.
354 @node Measure repeats
355 @unnumberedsubsubsec Measure repeats
357 @cindex percent repeats
358 @cindex measure repeats
360 A note pattern can be repeated with the @code{\repeat percent
361 @var{number}} syntax. The music is printed once, and the pattern
362 is replaced with a special sign. Patterns of one and two measures
363 are replaced by percent-like signs, patterns that divide the
364 measure length are replaced by slashes. Percent repeats must be
365 declared within a @code{Voice} context.
367 @lilypond[quote,verbatim,ragged-right]
368 \new Voice \relative c' {
369 \repeat percent 4 { c4 }
370 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
374 Measure repeats of more than two measures get a counter if you
375 switch on the @code{countPercentRepeats} property:
377 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
379 \set countPercentRepeats = ##t
380 \repeat percent 4 { c1 }
385 Isolated percents can also be printed. This is done by entering a
386 multi-measure rest with a different print function:
388 @lilypond[fragment,verbatim,quote]
389 \override MultiMeasureRest #'stencil
390 = #ly:multi-measure-rest::percent
399 Snippets: @lsrdir{repeats}
401 Internals Reference: @internalsref{RepeatSlash},
402 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
403 @internalsref{DoublePercentRepeatCounter},
404 @internalsref{PercentRepeatCounter},
405 @internalsref{PercentRepeatedMusic}.