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 Snippets: @lsrdir{repeats}
113 Internals Reference: @internalsref{VoltaBracket},
114 @internalsref{RepeatedMusic},
115 @internalsref{VoltaRepeatedMusic}, and
116 @internalsref{UnfoldedRepeatedMusic}.
120 Brackets for the repeat are normally only printed over the topmost
121 staff. This can be adjusted by moving @code{Volta_engraver} to
122 the Staff context where you want the brackets to appear; see
123 @ref{Modifying context plug-ins} and
124 @lsr{repeats,volta@/-multi@/-staff@/.ly}.
129 @cindex repeat, ambiguous
140 is ambiguous, since it is is not clear to which @code{\repeat} the
141 @code{\alternative} belongs. This ambiguity is resolved by always
142 having the @code{\alternative} belong to the inner @code{\repeat}.
143 For clarity, it is advisable to use braces in such situations.
145 Timing information is not remembered at the start of an
146 alternative, so after a repeat timing information must be reset by
147 hand; for example, by setting @code{Score.measurePosition} or
148 entering @code{\partial}. Similarly, slurs or ties are also not
154 @unnumberedsubsubsec Repeat syntax
158 LilyPond has one syntactic construct for specifying different
159 types of repeats. The syntax is
162 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
165 If you have alternative endings, you may add
166 @funindex \alternative
177 where each @var{alternative} is a music expression. If you do not
178 give enough alternatives for all of the repeats, the first
179 alternative is assumed to be played more than once.
181 The following types of repetition are supported
185 Repeated music is fully written (played) out. This is useful when
186 entering repetitious music. This is the only kind of repeat that
187 is included in MIDI output.
190 Repeats are not written out, but alternative endings (volte) are
191 printed, left to right with brackets. This is the standard
192 notation for repeats with alternatives. These are not played in
193 MIDI output by default.
197 Make tremolo beams. These are not played in MIDI output by
201 Make beat or measure repeats. These look like percent signs.
202 These are not played in MIDI output by default. Percent repeats
203 must be declared within a @code{Voice} context.
208 @node Manual repeat commands
209 @unnumberedsubsubsec Manual repeat commands
211 @funindex repeatCommands
213 The property @code{repeatCommands} can be used to control the
214 layout of repeats. Its value is a Scheme list of repeat commands.
217 @item @code{start-repeat}
218 Print a @code{|:} bar line.
220 @item @code{end-repeat}
221 Print a @code{:|} bar line.
223 @item @code{(volta @var{text})}
224 Print a volta bracket saying @var{text}: The text can be specified
225 as a text string or as a markup text, see @ref{Text markup}. Do
226 not forget to change the font, as the default number font does not
227 contain alphabetic characters;
229 @item @code{(volta #f)}
230 Stop a running volta bracket.
233 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
235 \set Score.repeatCommands = #'((volta "93") end-repeat)
237 \set Score.repeatCommands = #'((volta #f))
244 Snippets: @lsrdir{repeats}
246 Internals Reference: @internalsref{VoltaBracket},
247 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
248 and @internalsref{UnfoldedRepeatedMusic}.
250 @node Repeats and MIDI
251 @unnumberedsubsubsec Repeats and MIDI
253 @cindex expanding repeats
254 @funindex \unfoldRepeats
256 With a little bit of tweaking, all types of repeats can be present
257 in the MIDI output. This is achieved by applying the
258 @code{\unfoldRepeats} music function. This function changes all
259 repeats to unfold repeats.
261 @lilypond[quote,verbatim,fragment,line-width=8.0\cm]
263 \repeat tremolo 8 {c'32 e' }
264 \repeat percent 2 { c''8 d'' }
265 \repeat volta 2 {c'4 d' e' f'}
274 When creating a score file using @code{\unfoldRepeats} for MIDI,
275 it is necessary to make two @code{\score} blocks: one for MIDI
276 (with unfolded repeats) and one for notation (with volta, tremolo,
277 and percent repeats). For example,
285 \unfoldRepeats @var{..music..}
292 @subsection Other repeats
296 * Tremolo subdivisions::
300 @node Tremolo repeats
301 @unnumberedsubsubsec Tremolo repeats
303 @cindex tremolo beams
305 To place tremolo marks between notes, use @code{\repeat} with
308 @lilypond[quote,verbatim,ragged-right]
309 \new Voice \relative c' {
310 \repeat tremolo 8 { c16 d16 }
311 \repeat tremolo 4 { c16 d16 }
312 \repeat tremolo 2 { c16 d16 }
316 Tremolo marks can also be put on a single note. In this case, the
317 note should not be surrounded by braces.
319 @lilypond[quote,verbatim,ragged-right]
320 \repeat tremolo 4 c'16
323 Similar output is obtained using the tremolo subdivision,
324 described in @ref{Tremolo subdivisions}.
329 Notation Reference: @ref{Tremolo subdivisions}, @ref{Repeats}.
331 Snippets: @lsrdir{repeats}
333 Internals Reference: @internalsref{Beam},
334 @internalsref{StemTremolo}.
337 @node Tremolo subdivisions
338 @unnumberedsubsubsec Tremolo subdivisions
340 @cindex tremolo marks
341 @funindex tremoloFlags
343 Tremolo marks can be printed on a single note by adding
344 @q{@code{:}[@var{number}]} after the note. The number indicates
345 the duration of the subdivision, and it must be at least 8. A
346 @var{length} value of 8 gives one line across the note stem. If
347 the length is omitted, the last value (stored in
348 @code{tremoloFlags}) is used
350 @lilypond[quote,ragged-right,verbatim,fragment]
351 c'2:8 c':32 | c': c': |
357 Tremolos entered in this way do not carry over into the MIDI
363 Notation Reference: @ref{Tremolo repeats}.
365 Snippets: @lsrdir{repeats}
367 Elsewhere: @internalsref{StemTremolo}.
370 @node Measure repeats
371 @unnumberedsubsubsec Measure repeats
373 @cindex percent repeats
374 @cindex measure repeats
376 In the @code{percent} style, a note pattern can be repeated. It
377 is printed once, and then the pattern is replaced with a special
378 sign. Patterns of one and two measures are replaced by
379 percent-like signs, patterns that divide the measure length are
380 replaced by slashes. Percent repeats must be declared within a
381 @code{Voice} context.
383 @lilypond[quote,verbatim,ragged-right]
384 \new Voice \relative c' {
385 \repeat percent 4 { c4 }
386 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
390 Measure repeats of more than 2 measures get a counter, if you
391 switch on the @code{countPercentRepeats} property,
393 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
395 \set countPercentRepeats = ##t
396 \repeat percent 4 { c1 }
402 Isolated percents can also be printed. This is done by putting a
403 multi-measure rest with a different print function,
405 @lilypond[fragment,verbatim,quote]
406 \override MultiMeasureRest #'stencil
407 = #ly:multi-measure-rest::percent
416 Snippets: @lsrdir{repeats}
418 Internals Reference: @internalsref{RepeatSlash},
419 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
420 @internalsref{DoublePercentRepeatCounter},
421 @internalsref{PercentRepeatCounter},
422 @internalsref{PercentRepeatedMusic}.