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 exist
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
85 by setting @code{voltaSpannerDuration}. In the next example, the
86 bracket 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 a
100 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 alternative,
144 so after a repeat timing information must be reset by hand; for
145 example, by setting @code{Score.measurePosition} or entering
146 @code{\partial}. Similarly, slurs or ties are also not repeated.
151 @unnumberedsubsubsec Repeat syntax
155 LilyPond has one syntactic construct for specifying different types of
156 repeats. The syntax is
159 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
162 If you have alternative endings, you may add
163 @funindex \alternative
174 where each @var{alternative} is a music expression. If you do not
175 give enough alternatives for all of the repeats, the first alternative
176 is assumed to be played more than once.
178 The following types of repetition are supported
182 Repeated music is fully written (played) out. This is useful when
183 entering repetitious music. This is the only kind of repeat that
184 is included in MIDI output.
187 Repeats are not written out, but alternative endings (volte) are
188 printed, left to right with brackets. This is the standard notation
189 for repeats with alternatives. These are not played in MIDI output by
194 Make tremolo beams. These are not played in MIDI output by default.
197 Make beat or measure repeats. These look like percent signs. These
198 are not played in MIDI output by default. Percent repeats must be
199 declared within a @code{Voice} context.
204 @node Manual repeat commands
205 @unnumberedsubsubsec Manual repeat commands
207 @funindex repeatCommands
209 The property @code{repeatCommands} can be used to control the layout of
210 repeats. Its value is a Scheme list of repeat commands.
213 @item @code{start-repeat}
214 Print a @code{|:} bar line.
216 @item @code{end-repeat}
217 Print a @code{:|} bar line.
219 @item @code{(volta @var{text})}
220 Print a volta bracket saying @var{text}: The text can be specified as
221 a text string or as a markup text, see @ref{Text markup}. Do not
222 forget to change the font, as the default number font does not contain
223 alphabetic characters;
225 @item @code{(volta #f)}
226 Stop a running volta bracket.
229 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
231 \set Score.repeatCommands = #'((volta "93") end-repeat)
233 \set Score.repeatCommands = #'((volta #f))
240 Program reference: @internalsref{VoltaBracket},
241 @internalsref{RepeatedMusic},
242 @internalsref{VoltaRepeatedMusic}, and
243 @internalsref{UnfoldedRepeatedMusic}.
245 @node Repeats and MIDI
246 @unnumberedsubsubsec Repeats and MIDI
248 @cindex expanding repeats
249 @funindex \unfoldRepeats
251 With a little bit of tweaking, all types of repeats can be present
252 in the MIDI output. This is achieved by applying the
253 @code{\unfoldRepeats} music function. This function changes all
254 repeats to unfold repeats.
256 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
258 \repeat tremolo 8 {c'32 e' }
259 \repeat percent 2 { c''8 d'' }
260 \repeat volta 2 {c'4 d' e' f'}
269 When creating a score file using @code{\unfoldRepeats} for MIDI,
270 it is necessary to make two @code{\score} blocks: one for MIDI (with
271 unfolded repeats) and one for notation (with volta, tremolo, and
272 percent repeats). For example,
280 \unfoldRepeats @var{..music..}
287 @subsection Other repeats
291 * Tremolo subdivisions::
295 @node Tremolo repeats
296 @unnumberedsubsubsec Tremolo repeats
298 @cindex tremolo beams
300 To place tremolo marks between notes, use @code{\repeat} with tremolo
302 @lilypond[quote,verbatim,ragged-right]
303 \new Voice \relative c' {
304 \repeat tremolo 8 { c16 d16 }
305 \repeat tremolo 4 { c16 d16 }
306 \repeat tremolo 2 { c16 d16 }
310 Tremolo marks can also be put on a single note. In this case, the
311 note should not be surrounded by braces.
312 @lilypond[quote,verbatim,ragged-right]
313 \repeat tremolo 4 c'16
316 Similar output is obtained using the tremolo subdivision, described in
317 @ref{Tremolo subdivisions}.
322 In this manual: @ref{Tremolo subdivisions}, @ref{Repeats}.
324 Program reference: @internalsref{Beam}, @internalsref{StemTremolo}.
327 @node Tremolo subdivisions
328 @unnumberedsubsubsec Tremolo subdivisions
330 @cindex tremolo marks
331 @funindex tremoloFlags
333 Tremolo marks can be printed on a single note by adding
334 @q{@code{:}[@var{number}]} after the note. The number indicates the
335 duration of the subdivision, and it must be at least 8. A
336 @var{length} value of 8 gives one line across the note stem. If the
337 length is omitted, the last value (stored in @code{tremoloFlags}) is
340 @lilypond[quote,ragged-right,verbatim,fragment]
341 c'2:8 c':32 | c': c': |
347 Tremolos entered in this way do not carry over into the MIDI output.
352 In this manual: @ref{Tremolo repeats}.
354 Elsewhere: @internalsref{StemTremolo}.
357 @node Measure repeats
358 @unnumberedsubsubsec Measure repeats
360 @cindex percent repeats
361 @cindex measure repeats
363 In the @code{percent} style, a note pattern can be repeated. It is
364 printed once, and then the pattern is replaced with a special sign.
365 Patterns of one and two measures are replaced by percent-like signs,
366 patterns that divide the measure length are replaced by slashes.
367 Percent repeats must be declared within a @code{Voice} context.
369 @lilypond[quote,verbatim,ragged-right]
370 \new Voice \relative c' {
371 \repeat percent 4 { c4 }
372 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
376 Measure repeats of more than 2 measures get a counter, if you switch
377 on the @code{countPercentRepeats} property,
379 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
381 \set countPercentRepeats = ##t
382 \repeat percent 4 { c1 }
388 Isolated percents can also be printed. This is done by putting a
389 multi-measure rest with a different print function,
391 @lilypond[fragment,verbatim,quote]
392 \override MultiMeasureRest #'stencil
393 = #ly:multi-measure-rest::percent
402 Program reference: @internalsref{RepeatSlash},
403 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
404 @internalsref{DoublePercentRepeatCounter},
405 @internalsref{PercentRepeatCounter},
406 @internalsref{PercentRepeatedMusic}.