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 Repetition is a central concept in music, and multiple notations
13 exist for repetitions.
21 @subsection Writing repeats
28 * Manual repeat commands::
33 @unnumberedsubsubsec Normal repeats
40 Normal repeats, with or without alternate repeats, may be printed:
42 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
43 \repeat volta 2 { c4 d e f }
44 \repeat volta 2 { g f e d }
52 Repeats with upbeats may be created.
54 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
57 \repeat volta 4 { c2 d2 | e2 f2 | }
58 \alternative { { g4 g g e } { a a a a | b2. } }
65 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
68 \repeat volta 4 { e | c2 d2 | e2 f2 | }
69 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
76 Ties may be added to a second ending,
78 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
80 \repeat volta 2 {c4 d e f ~ }
81 \alternative { {f2 d} {f\repeatTie f,} }
84 It is possible to shorten volta brackets by setting
85 @code{voltaSpannerDuration}. In the next example, the bracket
86 only lasts one measure, which is a duration of 3/4.
88 @lilypond[verbatim,ragged-right,quote]
92 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
93 \repeat volta 5 { d d d }
94 \alternative { { e e e f f f }
99 If you want to start a repeat at the beginning of a line and have
100 a double bar at the end of the previous line, use
103 @dots{} \bar "||:" \break
104 \repeat volta 2 @{ @dots{}
107 see @ref{Bar lines} for more information.
111 Program reference: @internalsref{VoltaBracket},
112 @internalsref{RepeatedMusic},
113 @internalsref{VoltaRepeatedMusic}, and
114 @internalsref{UnfoldedRepeatedMusic}.
118 Brackets for the repeat are normally only printed over the topmost
119 staff. This can be adjusted by moving @code{Volta_engraver} to
120 the Staff context where you want the brackets to appear; see
121 @ref{Modifying context plug-ins} and
122 @lsr{repeats,volta@/-multi@/-staff@/.ly}.
127 @cindex repeat, ambiguous
138 is ambiguous, since it is is not clear to which @code{\repeat} the
139 @code{\alternative} belongs. This ambiguity is resolved by always
140 having the @code{\alternative} belong to the inner @code{\repeat}.
141 For clarity, it is advisable to use braces in such situations.
143 Timing information is not remembered at the start of an
144 alternative, so after a repeat timing information must be reset by
145 hand; for example, by setting @code{Score.measurePosition} or
146 entering @code{\partial}. Similarly, slurs or ties are also not
152 @unnumberedsubsubsec Repeat syntax
156 LilyPond has one syntactic construct for specifying different
157 types of repeats. The syntax is
160 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
163 If you have alternative endings, you may add
164 @funindex \alternative
175 where each @var{alternative} is a music expression. If you do not
176 give enough alternatives for all of the repeats, the first
177 alternative is assumed to be played more than once.
179 The following types of repetition are supported
183 Repeated music is fully written (played) out. This is useful when
184 entering repetitious music. This is the only kind of repeat that
185 is included in MIDI output.
188 Repeats are not written out, but alternative endings (volte) are
189 printed, left to right with brackets. This is the standard
190 notation for repeats with alternatives. These are not played in
191 MIDI output by default.
195 Make tremolo beams. These are not played in MIDI output by
199 Make beat or measure repeats. These look like percent signs.
200 These are not played in MIDI output by default. Percent repeats
201 must be declared within a @code{Voice} context.
206 @node Manual repeat commands
207 @unnumberedsubsubsec Manual repeat commands
209 @funindex repeatCommands
211 The property @code{repeatCommands} can be used to control the
212 layout of repeats. Its value is a Scheme list of repeat commands.
215 @item @code{start-repeat}
216 Print a @code{|:} bar line.
218 @item @code{end-repeat}
219 Print a @code{:|} bar line.
221 @item @code{(volta @var{text})}
222 Print a volta bracket saying @var{text}: The text can be specified
223 as a text string or as a markup text, see @ref{Text markup}. Do
224 not forget to change the font, as the default number font does not
225 contain alphabetic characters;
227 @item @code{(volta #f)}
228 Stop a running volta bracket.
231 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
233 \set Score.repeatCommands = #'((volta "93") end-repeat)
235 \set Score.repeatCommands = #'((volta #f))
242 Program reference: @internalsref{VoltaBracket},
243 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
244 and @internalsref{UnfoldedRepeatedMusic}.
246 @node Repeats and MIDI
247 @unnumberedsubsubsec Repeats and MIDI
249 @cindex expanding repeats
250 @funindex \unfoldRepeats
252 With a little bit of tweaking, all types of repeats can be present
253 in the MIDI output. This is achieved by applying the
254 @code{\unfoldRepeats} music function. This function changes all
255 repeats to unfold repeats.
257 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
259 \repeat tremolo 8 {c'32 e' }
260 \repeat percent 2 { c''8 d'' }
261 \repeat volta 2 {c'4 d' e' f'}
270 When creating a score file using @code{\unfoldRepeats} for MIDI,
271 it is necessary to make two @code{\score} blocks: one for MIDI
272 (with unfolded repeats) and one for notation (with volta, tremolo,
273 and percent repeats). For example,
281 \unfoldRepeats @var{..music..}
288 @subsection Other repeats
292 * Tremolo subdivisions::
296 @node Tremolo repeats
297 @unnumberedsubsubsec Tremolo repeats
299 @cindex tremolo beams
301 To place tremolo marks between notes, use @code{\repeat} with
304 @lilypond[quote,verbatim,ragged-right]
305 \new Voice \relative c' {
306 \repeat tremolo 8 { c16 d16 }
307 \repeat tremolo 4 { c16 d16 }
308 \repeat tremolo 2 { c16 d16 }
312 Tremolo marks can also be put on a single note. In this case, the
313 note should not be surrounded by braces.
315 @lilypond[quote,verbatim,ragged-right]
316 \repeat tremolo 4 c'16
319 Similar output is obtained using the tremolo subdivision,
320 described in @ref{Tremolo subdivisions}.
325 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
327 Program reference: @internalsref{Beam},
328 @internalsref{StemTremolo}.
331 @node Tremolo subdivisions
332 @unnumberedsubsubsec Tremolo subdivisions
334 @cindex tremolo marks
335 @funindex tremoloFlags
337 Tremolo marks can be printed on a single note by adding
338 @q{@code{:}[@var{number}]} after the note. The number indicates
339 the duration of the subdivision, and it must be at least 8. A
340 @var{length} value of 8 gives one line across the note stem. If
341 the length is omitted, the last value (stored in
342 @code{tremoloFlags}) is used
344 @lilypond[quote,ragged-right,verbatim,fragment]
345 c'2:8 c':32 | c': c': |
351 Tremolos entered in this way do not carry over into the MIDI
357 In this manual: @ref{Tremolo repeats}.
359 Elsewhere: @internalsref{StemTremolo}.
362 @node Measure repeats
363 @unnumberedsubsubsec Measure repeats
365 @cindex percent repeats
366 @cindex measure repeats
368 In the @code{percent} style, a note pattern can be repeated. It
369 is printed once, and then the pattern is replaced with a special
370 sign. Patterns of one and two measures are replaced by
371 percent-like signs, patterns that divide the measure length are
372 replaced by slashes. Percent repeats must be declared within a
373 @code{Voice} context.
375 @lilypond[quote,verbatim,ragged-right]
376 \new Voice \relative c' {
377 \repeat percent 4 { c4 }
378 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
382 Measure repeats of more than 2 measures get a counter, if you
383 switch on the @code{countPercentRepeats} property,
385 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
387 \set countPercentRepeats = ##t
388 \repeat percent 4 { c1 }
394 Isolated percents can also be printed. This is done by putting a
395 multi-measure rest with a different print function,
397 @lilypond[fragment,verbatim,quote]
398 \override MultiMeasureRest #'stencil
399 = #ly:multi-measure-rest::percent
408 Program reference: @internalsref{RepeatSlash},
409 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
410 @internalsref{DoublePercentRepeatCounter},
411 @internalsref{PercentRepeatCounter},
412 @internalsref{PercentRepeatedMusic}.