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. LilyPond supports the following kinds of repeats:
21 The repeated music is not written out but enclosed in repeat bar
22 lines. If the repeat is at the beginning of a piece, a repeat bar
23 line is only printed at the end. Alternative endings (volte) are
24 printed, left to right with brackets. This is the standard
25 notation for repeats with alternatives.
28 The repeated music is fully written out, as many times as
29 specified by @var{repeatcount}. This is useful when
30 entering repetitious music.
33 Make beat or measure repeats. These look like percent signs.
34 Percent repeats must be declared within a @code{Voice} context.
41 LilyPond has one syntactic construct for specifying different
42 types of repeats. The syntax is
45 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
48 where @var{repeabody} is a music expression.
51 Alternative endings are entered with
52 @funindex \alternative
63 after a @code{\repeat volta} or @code{unfold} block, where each
64 @var{alternative} is a music expression. If you give fewer
65 alternatives than @var{repeatcount}, the first alternative is assumed
66 to be played more than once.
70 * Writing long repeats::
74 @node Writing long repeats
75 @subsection Writing long repeats
79 * Manual repeat marks::
80 * Written-out repeats::
87 @cindex volta, seconda
91 @subsubsection Normal repeats
93 FIXME: this example needs to go by itself.
95 \repeat volta 2 { c4 d e f }
98 Normal repeats, with or without alternate repeats:
100 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
101 \repeat volta 2 { g f e d }
108 Repeats with upbeats:
110 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
113 \repeat volta 4 { c2 d2 | e2 f2 | }
114 \alternative { { g4 g g e } { a a a a | b2. } }
121 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
124 \repeat volta 4 { e | c2 d2 | e2 f2 | }
125 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
132 Ties may be added to a second ending:
134 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
136 \repeat volta 2 {c4 d e f ~ }
137 \alternative { {f2 d} {f\repeatTie f,} }
140 By default, the volta brackets will be drawn over all of the
141 alternative music, but it is possible to shorten them by
142 setting @code{voltaSpannerDuration}. In the next example, the
143 bracket only lasts one measure, which is a duration of 3/4.
145 @lilypond[verbatim,ragged-right,quote]
149 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
150 \repeat volta 5 { d d d }
151 \alternative { { e e e f f f }
156 The @code{Volta_engraver} by default resides in the Score context,
157 and brackets for the repeat are thus normally only printed over
158 the topmost staff. This can be adjusted by adding
159 @code{Volta_engraver} to the Staff context where you want the
160 brackets to appear; see @ref{Modifying context plug-ins} and
161 @c @lsr{repeats,volta@/-multi@/-staff@/.ly}.
163 @lilypond[verbatim,ragged-right,quote]
165 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
166 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
167 \new Staff \with { \consists Volta_engraver } { c'2 g' e' a' }
168 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
172 @c Is there a way to have a final bar ("|.") at the end of the
173 @c previous line? Doesn't seem to be.
174 If you want to start a repeat at the beginning of a line and have
175 a double bar at the end of the previous line, use
178 @dots{} \bar "||:" \break
179 \repeat volta 2 @{ @dots{}
182 see @ref{Bar lines} for more information.
186 Snippets: @lsrdir{Repeats,Repeats}
188 Internals Reference: @internalsref{VoltaBracket},
189 @internalsref{RepeatedMusic},
190 @internalsref{VoltaRepeatedMusic}, and
191 @internalsref{UnfoldedRepeatedMusic}.
198 @cindex repeat, ambiguous
209 is ambiguous, since it is is not clear to which @code{\repeat} the
210 @code{\alternative} belongs. This ambiguity is resolved by always
211 having the @code{\alternative} belong to the inner @code{\repeat}.
212 For clarity, it is advisable to use braces in such situations.
214 Timing information is not remembered at the start of an
215 alternative, so after a repeat timing information must be reset by
216 hand; for example, by setting @code{Score.measurePosition} or
217 entering @code{\partial}. Similarly, slurs or ties are also not
222 @node Manual repeat marks
223 @subsubsection Manual repeat marks
225 @funindex repeatCommands
227 @c FIXME: Markup does not work in the "text" field
228 @c And how does one change the font?
229 @c On the whole, this section needs better documentation (why the
230 @c double parentheses around the volta expressions?)
232 The property @code{repeatCommands} can be used to control the
233 layout of repeats. Its value is a Scheme list of repeat commands.
236 @item @code{start-repeat}
237 Print a @code{|:} bar line.
239 @item @code{end-repeat}
240 Print a @code{:|} bar line.
242 @item @code{(volta @var{text})}
243 Print a volta bracket saying @var{text}. The text can be
244 specified as a text string or as a markup text, see @ref{Text
245 markup}. Do not forget to change the font, as the default number
246 font does not contain alphabetic characters;
249 @item @code{(volta #f)}
250 Stop a running volta bracket.
253 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
255 \set Score.repeatCommands = #'((volta "93") end-repeat)
257 \set Score.repeatCommands = #'((volta #f))
261 @c FIXME: improve visibility of bar lines link?
265 Notation Reference: @ref{Bar lines}.
267 Snippets: @lsrdir{Repeats,Repeats}
269 Internals Reference: @internalsref{VoltaBracket},
270 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
271 and @internalsref{UnfoldedRepeatedMusic}.
274 @node Written-out repeats
275 @subsubsection Written-out repeats
283 @subsection Short repeats
290 @node Percent repeats
291 @subsubsection Percent repeats
293 @cindex percent repeats
294 @cindex measure repeats
296 A note pattern can be repeated with the @code{\repeat percent
297 @var{number}} syntax. The music is printed once, and the pattern
298 is replaced with a special sign. Patterns of one and two measures
299 are replaced by percent-like signs, patterns that divide the
300 measure length are replaced by slashes. Percent repeats must be
301 declared within a @code{Voice} context.
303 @lilypond[quote,verbatim,ragged-right]
304 \new Voice \relative c' {
305 \repeat percent 4 { c4 }
306 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
310 Measure repeats of more than two measures get a counter if you
311 switch on the @code{countPercentRepeats} property:
313 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
315 \set countPercentRepeats = ##t
316 \repeat percent 4 { c1 }
321 Isolated percents can also be printed. This is done by entering a
322 multi-measure rest with a different print function:
324 @lilypond[fragment,verbatim,quote]
325 \override MultiMeasureRest #'stencil
326 = #ly:multi-measure-rest::percent
333 Snippets: @lsrdir{Repeats,Repeats}
335 Internals Reference: @internalsref{RepeatSlash},
336 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
337 @internalsref{DoublePercentRepeatCounter},
338 @internalsref{PercentRepeatCounter},
339 @internalsref{PercentRepeatedMusic}.
341 @node Tremolo repeats
342 @subsubsection Tremolo repeats
344 @cindex tremolo beams
346 To place tremolo marks between notes, use @code{\repeat} with
349 @lilypond[quote,verbatim,ragged-right]
350 \new Voice \relative c' {
351 \repeat tremolo 8 { c16 d16 }
352 \repeat tremolo 4 { c16 d16 }
353 \repeat tremolo 2 { c16 d16 }
357 The @code{\repeat tremolo} syntax expects exactly two notes within
358 the braces, and the number of repetitions must correspond to a
359 note value that can be expressed with plain or dotted notes. Thus,
360 @code{\repeat tremolo 7} is valid and produces a double dotted
361 note, but @code{\repeat tremolo 9} is not.
363 The duration of the tremolo equals the duration of the
364 braced expression multiplied by the number of repeats:
365 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
366 notated as two whole notes joined by tremolo beams.
368 There are two ways to put tremolo marks on a single note. The
369 @code{\repeat tremolo} syntax can be used even here, in which case
370 the note should not be surrounded by braces:
372 @lilypond[quote,verbatim,ragged-right]
373 \repeat tremolo 4 c'16
376 @cindex tremolo marks
377 @funindex tremoloFlags
379 The same output can be obtained by adding
380 @q{@code{:}[@var{number}]} after the note. The number indicates
381 the duration of the subdivision, and it must be at least 8. A
382 @var{number} value of 8 gives one line across the note stem. If
383 the length is omitted, the last value (stored in
384 @code{tremoloFlags}) is used
386 @lilypond[quote,ragged-right,verbatim,fragment]
387 c'2:8 c':32 | c': c': |
394 Tremolos entered with @q{@code{:}[@var{number}]} do not carry over
395 into the MIDI output.
400 Notation Reference: @ref{Tremolo repeats}.
402 Internals Reference: @internalsref{Beam},
403 @internalsref{StemTremolo}.
405 Snippets: @lsrdir{Repeats,Repeats}
407 Elsewhere: @internalsref{StemTremolo}.