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 Write beat or measure repeats. These look like percent signs.
34 Percent repeats must be declared within a @code{Voice} context.
42 LilyPond has one syntactic construct for specifying different
43 types of repeats. The syntax is
46 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
49 where @var{repeatbody} is a music expression.
52 Alternative endings are entered with
53 @funindex \alternative
64 after a @code{\repeat volta} or @code{unfold} block, where each
65 @var{alternative} is a music expression. If you give fewer
66 alternatives than @var{repeatcount}, the first alternative is assumed
67 to be played more than once.
72 * Writing long repeats::
76 @node Writing long repeats
77 @subsection Writing long repeats
81 * Manual repeat marks::
82 * Written-out repeats::
89 @cindex volta, seconda
93 @subsubsection Normal repeats
95 The syntax for a simple repeat is
98 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
101 where @var{repeatbody} is a music expression.
103 Normal repeats without alternate endings:
105 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
106 \repeat volta 2 { c4 d e f }
108 \repeat volta 2 { d4 e f g }
111 Normal repeats with alternate endings:
113 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
114 \repeat volta 2 { g f e d }
123 Repeats with upbeats:
125 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
129 \repeat volta 4 { c2 d2 | e2 f2 | }
130 \alternative { { g4 g g e } { a a a a | b2. } }
137 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
140 \repeat volta 4 { e | c2 d2 | e2 f2 | }
141 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
148 Ties may be added to a second ending:
150 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
152 \repeat volta 2 {c4 d e f ~ }
153 \alternative { {f2 d} {f\repeatTie f,} }
156 By default, the volta brackets will be drawn over all of the
157 alternative music, but it is possible to shorten them by setting
158 @code{voltaSpannerDuration}. In the next example, the bracket only
159 lasts one measure, which is a duration of 3/4.
161 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
164 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
165 \repeat volta 5 { d d d }
166 \alternative { { e e e f f f }
170 The @code{Volta_engraver} by default resides in the Score context, and
171 brackets for the repeat are thus normally only printed over the
172 topmost staff. This can be adjusted by adding @code{Volta_engraver}
173 to the Staff context where you want the brackets to appear; see
174 @ref{Modifying context plug-ins} and
175 @c @lsr{repeats,volta@/-multi@/-staff@/.ly}.
177 @lilypond[verbatim,ragged-right,quote]
179 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
180 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
181 \new Staff \with { \consists Volta_engraver } { c'2 g' e' a' }
182 \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
186 @c Is there a way to have a final bar ("|.") at the end of the
187 @c previous line? Doesn't seem to be.
188 If you want to start a repeat at the beginning of a line and have a
189 double bar at the end of the previous line, use
191 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
194 \repeat volta 2 { c4 d e f }
197 see @ref{Bar lines} for more information.
201 Music Glossary: @rglos{repeat}.
202 @c FIXME : add @rglos{volta} after glossary addition
204 Notation Reference: @ref{Bar lines}, @ref{Modifying context plug-ins}.
206 Snippets: @lsrdir{Repeats,Repeats}
208 Internals Reference: @internalsref{VoltaBracket},
209 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
210 @internalsref{UnfoldedRepeatedMusic}.
217 @cindex repeat, ambiguous
228 is ambiguous, since it is is not clear to which @code{\repeat} the
229 @code{\alternative} belongs. This ambiguity is resolved by always
230 having the @code{\alternative} belong to the inner @code{\repeat}.
231 For clarity, it is advisable to use braces in such situations.
233 Timing information is not remembered at the start of an alternative,
234 so after a repeat timing information must be reset by hand; for
235 example, by setting @code{Score.measurePosition} or entering
236 @code{\partial}. Similarly, slurs or ties are also not repeated.
240 @node Manual repeat marks
241 @subsubsection Manual repeat marks
243 @funindex repeatCommands
245 @c FIXME: Markup does not work in the "text" field
246 @c And how does one change the font?
247 @c On the whole, this section needs better documentation (why the
248 @c double parentheses around the volta expressions?)
250 The property @code{repeatCommands} can be used to control the
251 layout of repeats. Its value is a Scheme list of repeat commands.
254 @item @code{start-repeat}
255 Print a @code{|:} bar line.
257 @item @code{end-repeat}
258 Print a @code{:|} bar line.
260 @item @code{(volta @var{text})}
261 Print a volta bracket saying @var{text}. The text can be
262 specified as a text string or as a markup text, see @ref{Text
263 markup}. Do not forget to change the font, as the default number
264 font does not contain alphabetic characters;
267 @item @code{(volta #f)}
268 Stop a running volta bracket.
271 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
273 \set Score.repeatCommands = #'((volta "93") end-repeat)
275 \set Score.repeatCommands = #'((volta #f))
279 @c FIXME: improve visibility of bar lines link?
283 Notation Reference: @ref{Bar lines}.
285 Snippets: @lsrdir{Repeats,Repeats}
287 Internals Reference: @internalsref{VoltaBracket},
288 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
289 and @internalsref{UnfoldedRepeatedMusic}.
292 @node Written-out repeats
293 @subsubsection Written-out repeats
301 @subsection Short repeats
308 @node Percent repeats
309 @subsubsection Percent repeats
311 @cindex percent repeats
312 @cindex measure repeats
314 A note pattern can be repeated with the @code{\repeat percent
315 @var{number}} syntax. The music is printed once, and the pattern
316 is replaced with a special sign. Patterns of one and two measures
317 are replaced by percent-like signs, patterns that divide the
318 measure length are replaced by slashes. Percent repeats must be
319 declared within a @code{Voice} context.
321 @lilypond[quote,verbatim,ragged-right]
322 \new Voice \relative c' {
323 \repeat percent 4 { c4 }
324 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
328 Measure repeats of more than two measures get a counter if you
329 switch on the @code{countPercentRepeats} property:
331 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
333 \set countPercentRepeats = ##t
334 \repeat percent 4 { c1 }
339 Isolated percents can also be printed. This is done by entering a
340 multi-measure rest with a different print function:
342 @lilypond[fragment,verbatim,quote]
343 \override MultiMeasureRest #'stencil
344 = #ly:multi-measure-rest::percent
351 Snippets: @lsrdir{Repeats,Repeats}
353 Internals Reference: @internalsref{RepeatSlash},
354 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
355 @internalsref{DoublePercentRepeatCounter},
356 @internalsref{PercentRepeatCounter},
357 @internalsref{PercentRepeatedMusic}.
359 @node Tremolo repeats
360 @subsubsection Tremolo repeats
362 @cindex tremolo beams
364 To place tremolo marks between notes, use @code{\repeat} with
367 @lilypond[quote,verbatim,ragged-right]
368 \new Voice \relative c' {
369 \repeat tremolo 8 { c16 d16 }
370 \repeat tremolo 4 { c16 d16 }
371 \repeat tremolo 2 { c16 d16 }
375 The @code{\repeat tremolo} syntax expects exactly two notes within
376 the braces, and the number of repetitions must correspond to a
377 note value that can be expressed with plain or dotted notes. Thus,
378 @code{\repeat tremolo 7} is valid and produces a double dotted
379 note, but @code{\repeat tremolo 9} is not.
381 The duration of the tremolo equals the duration of the
382 braced expression multiplied by the number of repeats:
383 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
384 notated as two whole notes joined by tremolo beams.
386 There are two ways to put tremolo marks on a single note. The
387 @code{\repeat tremolo} syntax can be used even here, in which case
388 the note should not be surrounded by braces:
390 @lilypond[quote,verbatim,ragged-right]
391 \repeat tremolo 4 c'16
394 @cindex tremolo marks
395 @funindex tremoloFlags
397 The same output can be obtained by adding
398 @q{@code{:}[@var{number}]} after the note. The number indicates
399 the duration of the subdivision, and it must be at least 8. A
400 @var{number} value of 8 gives one line across the note stem. If
401 the length is omitted, the last value (stored in
402 @code{tremoloFlags}) is used
404 @lilypond[quote,ragged-right,verbatim,fragment]
405 c'2:8 c':32 | c': c': |
412 Tremolos entered with @q{@code{:}[@var{number}]} do not carry over
413 into the MIDI output.
418 Notation Reference: @ref{Tremolo repeats}.
420 Internals Reference: @internalsref{Beam},
421 @internalsref{StemTremolo}.
423 Snippets: @lsrdir{Repeats,Repeats}
425 Elsewhere: @internalsref{StemTremolo}.