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::
86 @cindex volta, seconda
90 @subsubsection Normal repeats
92 FIXME: this example needs to go by itself.
94 \repeat volta 2 { c4 d e f }
97 Normal repeats, with or without alternate repeats:
99 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
100 \repeat volta 2 { g f e d }
107 Repeats with upbeats:
109 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
112 \repeat volta 4 { c2 d2 | e2 f2 | }
113 \alternative { { g4 g g e } { a a a a | b2. } }
120 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
123 \repeat volta 4 { e | c2 d2 | e2 f2 | }
124 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
131 Ties may be added to a second ending:
133 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
135 \repeat volta 2 {c4 d e f ~ }
136 \alternative { {f2 d} {f\repeatTie f,} }
139 By default, the volta brackets will be drawn over all of the
140 alternative music, but it is possible to shorten them by
141 setting @code{voltaSpannerDuration}. In the next example, the
142 bracket only lasts one measure, which is a duration of 3/4.
144 @lilypond[verbatim,ragged-right,quote]
148 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
149 \repeat volta 5 { d d d }
150 \alternative { { e e e f f f }
155 The @code{Volta_engraver} by default resides in the Score context,
156 and brackets for the repeat are thus normally only printed over
157 the topmost staff. This can be adjusted by adding
158 @code{Volta_engraver} to the Staff context where you want the
159 brackets to appear; see @ref{Modifying context plug-ins} and
160 @c @lsr{repeats,volta@/-multi@/-staff@/.ly}.
162 @lilypond[verbatim,ragged-right,quote]
164 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
165 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
166 \new Staff \with { \consists Volta_engraver } { c'2 g' e' a' }
167 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
171 @c Is there a way to have a final bar ("|.") at the end of the
172 @c previous line? Doesn't seem to be.
173 If you want to start a repeat at the beginning of a line and have
174 a double bar at the end of the previous line, use
177 @dots{} \bar "||:" \break
178 \repeat volta 2 @{ @dots{}
181 see @ref{Bar lines} for more information.
185 Snippets: @lsrdir{Repeats,Repeats}
187 Internals Reference: @internalsref{VoltaBracket},
188 @internalsref{RepeatedMusic},
189 @internalsref{VoltaRepeatedMusic}, and
190 @internalsref{UnfoldedRepeatedMusic}.
197 @cindex repeat, ambiguous
208 is ambiguous, since it is is not clear to which @code{\repeat} the
209 @code{\alternative} belongs. This ambiguity is resolved by always
210 having the @code{\alternative} belong to the inner @code{\repeat}.
211 For clarity, it is advisable to use braces in such situations.
213 Timing information is not remembered at the start of an
214 alternative, so after a repeat timing information must be reset by
215 hand; for example, by setting @code{Score.measurePosition} or
216 entering @code{\partial}. Similarly, slurs or ties are also not
221 @node Manual repeat marks
222 @subsubsection Manual repeat marks
224 @funindex repeatCommands
226 @c FIXME: Markup does not work in the "text" field
227 @c And how does one change the font?
228 @c On the whole, this section needs better documentation (why the
229 @c double parentheses around the volta expressions?)
231 The property @code{repeatCommands} can be used to control the
232 layout of repeats. Its value is a Scheme list of repeat commands.
235 @item @code{start-repeat}
236 Print a @code{|:} bar line.
238 @item @code{end-repeat}
239 Print a @code{:|} bar line.
241 @item @code{(volta @var{text})}
242 Print a volta bracket saying @var{text}. The text can be
243 specified as a text string or as a markup text, see @ref{Text
244 markup}. Do not forget to change the font, as the default number
245 font does not contain alphabetic characters;
248 @item @code{(volta #f)}
249 Stop a running volta bracket.
252 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
254 \set Score.repeatCommands = #'((volta "93") end-repeat)
256 \set Score.repeatCommands = #'((volta #f))
260 @c FIXME: improve visibility of bar lines link?
264 Notation Reference: @ref{Bar lines}.
266 Snippets: @lsrdir{Repeats,Repeats}
268 Internals Reference: @internalsref{VoltaBracket},
269 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
270 and @internalsref{UnfoldedRepeatedMusic}.
274 @subsection Short repeats
281 @node Percent repeats
282 @subsubsection Percent repeats
284 @cindex percent repeats
285 @cindex measure repeats
287 A note pattern can be repeated with the @code{\repeat percent
288 @var{number}} syntax. The music is printed once, and the pattern
289 is replaced with a special sign. Patterns of one and two measures
290 are replaced by percent-like signs, patterns that divide the
291 measure length are replaced by slashes. Percent repeats must be
292 declared within a @code{Voice} context.
294 @lilypond[quote,verbatim,ragged-right]
295 \new Voice \relative c' {
296 \repeat percent 4 { c4 }
297 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
301 Measure repeats of more than two measures get a counter if you
302 switch on the @code{countPercentRepeats} property:
304 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
306 \set countPercentRepeats = ##t
307 \repeat percent 4 { c1 }
312 Isolated percents can also be printed. This is done by entering a
313 multi-measure rest with a different print function:
315 @lilypond[fragment,verbatim,quote]
316 \override MultiMeasureRest #'stencil
317 = #ly:multi-measure-rest::percent
324 Snippets: @lsrdir{Repeats,Repeats}
326 Internals Reference: @internalsref{RepeatSlash},
327 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
328 @internalsref{DoublePercentRepeatCounter},
329 @internalsref{PercentRepeatCounter},
330 @internalsref{PercentRepeatedMusic}.
332 @node Tremolo repeats
333 @subsubsection Tremolo repeats
335 @cindex tremolo beams
337 To place tremolo marks between notes, use @code{\repeat} with
340 @lilypond[quote,verbatim,ragged-right]
341 \new Voice \relative c' {
342 \repeat tremolo 8 { c16 d16 }
343 \repeat tremolo 4 { c16 d16 }
344 \repeat tremolo 2 { c16 d16 }
348 The @code{\repeat tremolo} syntax expects exactly two notes within
349 the braces, and the number of repetitions must correspond to a
350 note value that can be expressed with plain or dotted notes. Thus,
351 @code{\repeat tremolo 7} is valid and produces a double dotted
352 note, but @code{\repeat tremolo 9} is not.
354 The duration of the tremolo equals the duration of the
355 braced expression multiplied by the number of repeats:
356 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
357 notated as two whole notes joined by tremolo beams.
359 There are two ways to put tremolo marks on a single note. The
360 @code{\repeat tremolo} syntax can be used even here, in which case
361 the note should not be surrounded by braces:
363 @lilypond[quote,verbatim,ragged-right]
364 \repeat tremolo 4 c'16
367 @cindex tremolo marks
368 @funindex tremoloFlags
370 The same output can be obtained by adding
371 @q{@code{:}[@var{number}]} after the note. The number indicates
372 the duration of the subdivision, and it must be at least 8. A
373 @var{number} value of 8 gives one line across the note stem. If
374 the length is omitted, the last value (stored in
375 @code{tremoloFlags}) is used
377 @lilypond[quote,ragged-right,verbatim,fragment]
378 c'2:8 c':32 | c': c': |
385 Tremolos entered with @q{@code{:}[@var{number}]} do not carry over
386 into the MIDI output.
391 Notation Reference: @ref{Tremolo repeats}.
393 Internals Reference: @internalsref{Beam},
394 @internalsref{StemTremolo}.
396 Snippets: @lsrdir{Repeats,Repeats}
398 Elsewhere: @internalsref{StemTremolo}.