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 @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))
267 Snippets: @lsrdir{repeats}
269 Internals Reference: @internalsref{VoltaBracket},
270 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
271 and @internalsref{UnfoldedRepeatedMusic}.
275 @subsection Other repeats
282 @node Tremolo repeats
283 @unnumberedsubsubsec Tremolo repeats
285 @cindex tremolo beams
287 To place tremolo marks between notes, use @code{\repeat} with
290 @lilypond[quote,verbatim,ragged-right]
291 \new Voice \relative c' {
292 \repeat tremolo 8 { c16 d16 }
293 \repeat tremolo 4 { c16 d16 }
294 \repeat tremolo 2 { c16 d16 }
298 The @code{\repeat tremolo} syntax expects exactly two notes within
299 the braces, and the number of repetitions must correspond to a
300 note value that can be expressed with plain or dotted notes. Thus,
301 @code{\repeat tremolo 7} is valid and produces a double dotted
302 note, but @code{\repeat tremolo 9} is not.
304 The duration of the tremolo equals the duration of the
305 braced expression multiplied by the number of repeats:
306 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
307 notated as two whole notes joined by tremolo beams.
309 There are two ways to put tremolo marks on a single note. The
310 @code{\repeat tremolo} syntax can be used even here, in which case
311 the note should not be surrounded by braces:
313 @lilypond[quote,verbatim,ragged-right]
314 \repeat tremolo 4 c'16
317 @cindex tremolo marks
318 @funindex tremoloFlags
320 The same output can be obtained by adding
321 @q{@code{:}[@var{number}]} after the note. The number indicates
322 the duration of the subdivision, and it must be at least 8. A
323 @var{number} value of 8 gives one line across the note stem. If
324 the length is omitted, the last value (stored in
325 @code{tremoloFlags}) is used
327 @lilypond[quote,ragged-right,verbatim,fragment]
328 c'2:8 c':32 | c': c': |
335 Tremolos entered with @q{@code{:}[@var{number}]} do not carry over
336 into the MIDI output.
341 Notation Reference: @ref{Tremolo repeats}.
343 Internals Reference: @internalsref{Beam},
344 @internalsref{StemTremolo}.
346 Snippets: @lsrdir{repeats}
348 Elsewhere: @internalsref{StemTremolo}.
351 @node Measure repeats
352 @unnumberedsubsubsec Measure repeats
354 @cindex percent repeats
355 @cindex measure repeats
357 A note pattern can be repeated with the @code{\repeat percent
358 @var{number}} syntax. The music is printed once, and the pattern
359 is replaced with a special sign. Patterns of one and two measures
360 are replaced by percent-like signs, patterns that divide the
361 measure length are replaced by slashes. Percent repeats must be
362 declared within a @code{Voice} context.
364 @lilypond[quote,verbatim,ragged-right]
365 \new Voice \relative c' {
366 \repeat percent 4 { c4 }
367 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
371 Measure repeats of more than two measures get a counter if you
372 switch on the @code{countPercentRepeats} property:
374 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
376 \set countPercentRepeats = ##t
377 \repeat percent 4 { c1 }
382 Isolated percents can also be printed. This is done by entering a
383 multi-measure rest with a different print function:
385 @lilypond[fragment,verbatim,quote]
386 \override MultiMeasureRest #'stencil
387 = #ly:multi-measure-rest::percent
396 Snippets: @lsrdir{repeats}
398 Internals Reference: @internalsref{RepeatSlash},
399 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
400 @internalsref{DoublePercentRepeatCounter},
401 @internalsref{PercentRepeatCounter},
402 @internalsref{PercentRepeatedMusic}.