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.
24 @subsection Writing repeats
31 * Manual repeat commands::
35 @unnumberedsubsubsec Normal repeats
42 Normal repeats, with or without alternate repeats, may be printed:
44 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
45 \repeat volta 2 { c4 d e f }
46 \repeat volta 2 { g f e d }
54 Repeats with upbeats may be created.
56 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
59 \repeat volta 4 { c2 d2 | e2 f2 | }
60 \alternative { { g4 g g e } { a a a a | b2. } }
67 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
70 \repeat volta 4 { e | c2 d2 | e2 f2 | }
71 \alternative { { \partial 4*3 g4 g g } { a a a a | b2. } }
78 Ties may be added to a second ending,
80 @lilypond[quote,ragged-right,fragment,verbatim,relative=2]
82 \repeat volta 2 {c4 d e f ~ }
83 \alternative { {f2 d} {f\repeatTie f,} }
86 It is possible to shorten volta brackets by setting
87 @code{voltaSpannerDuration}. In the next example, the bracket
88 only lasts one measure, which is a duration of 3/4.
90 @lilypond[verbatim,ragged-right,quote]
94 \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
95 \repeat volta 5 { d d d }
96 \alternative { { e e e f f f }
101 If you want to start a repeat at the beginning of a line and have
102 a double bar at the end of the previous line, use
105 @dots{} \bar "||:" \break
106 \repeat volta 2 @{ @dots{}
109 see @ref{Bar lines} for more information.
113 Snippets: @lsrdir{repeats}
115 Internals Reference: @internalsref{VoltaBracket},
116 @internalsref{RepeatedMusic},
117 @internalsref{VoltaRepeatedMusic}, and
118 @internalsref{UnfoldedRepeatedMusic}.
122 Brackets for the repeat are normally only printed over the topmost
123 staff. This can be adjusted by moving @code{Volta_engraver} to
124 the Staff context where you want the brackets to appear; see
125 @ref{Modifying context plug-ins} and
126 @lsr{repeats,volta@/-multi@/-staff@/.ly}.
131 @cindex repeat, ambiguous
142 is ambiguous, since it is is not clear to which @code{\repeat} the
143 @code{\alternative} belongs. This ambiguity is resolved by always
144 having the @code{\alternative} belong to the inner @code{\repeat}.
145 For clarity, it is advisable to use braces in such situations.
147 Timing information is not remembered at the start of an
148 alternative, so after a repeat timing information must be reset by
149 hand; for example, by setting @code{Score.measurePosition} or
150 entering @code{\partial}. Similarly, slurs or ties are also not
156 @unnumberedsubsubsec Repeat syntax
160 LilyPond has one syntactic construct for specifying different
161 types of repeats. The syntax is
164 \repeat @var{variant} @var{repeatcount} @var{repeatbody}
167 If you have alternative endings, you may add
168 @funindex \alternative
179 where each @var{alternative} is a music expression. If you do not
180 give enough alternatives for all of the repeats, the first
181 alternative is assumed to be played more than once.
183 The following types of repetition are supported
187 Repeated music is fully written (played) out. This is useful when
188 entering repetitious music. This is the only kind of repeat that
189 is included in MIDI output.
192 Repeats are not written out, but alternative endings (volte) are
193 printed, left to right with brackets. This is the standard
194 notation for repeats with alternatives. These are not played in
195 MIDI output by default.
199 Make tremolo beams. These are not played in MIDI output by
203 Make beat or measure repeats. These look like percent signs.
204 These are not played in MIDI output by default. Percent repeats
205 must be declared within a @code{Voice} context.
210 @node Manual repeat commands
211 @unnumberedsubsubsec Manual repeat commands
213 @funindex repeatCommands
215 The property @code{repeatCommands} can be used to control the
216 layout of repeats. Its value is a Scheme list of repeat commands.
219 @item @code{start-repeat}
220 Print a @code{|:} bar line.
222 @item @code{end-repeat}
223 Print a @code{:|} bar line.
225 @item @code{(volta @var{text})}
226 Print a volta bracket saying @var{text}: The text can be specified
227 as a text string or as a markup text, see @ref{Text markup}. Do
228 not forget to change the font, as the default number font does not
229 contain alphabetic characters;
231 @item @code{(volta #f)}
232 Stop a running volta bracket.
235 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
237 \set Score.repeatCommands = #'((volta "93") end-repeat)
239 \set Score.repeatCommands = #'((volta #f))
246 Snippets: @lsrdir{repeats}
248 Internals Reference: @internalsref{VoltaBracket},
249 @internalsref{RepeatedMusic}, @internalsref{VoltaRepeatedMusic},
250 and @internalsref{UnfoldedRepeatedMusic}.
254 @subsection Other repeats
258 * Tremolo subdivisions::
262 @node Tremolo repeats
263 @unnumberedsubsubsec Tremolo repeats
265 @cindex tremolo beams
267 To place tremolo marks between notes, use @code{\repeat} with
270 @lilypond[quote,verbatim,ragged-right]
271 \new Voice \relative c' {
272 \repeat tremolo 8 { c16 d16 }
273 \repeat tremolo 4 { c16 d16 }
274 \repeat tremolo 2 { c16 d16 }
278 Tremolo marks can also be put on a single note. In this case, the
279 note should not be surrounded by braces.
281 @lilypond[quote,verbatim,ragged-right]
282 \repeat tremolo 4 c'16
285 Similar output is obtained using the tremolo subdivision,
286 described in @ref{Tremolo subdivisions}.
291 Notation Reference: @ref{Tremolo subdivisions}, @ref{Repeats}.
293 Snippets: @lsrdir{repeats}
295 Internals Reference: @internalsref{Beam},
296 @internalsref{StemTremolo}.
299 @node Tremolo subdivisions
300 @unnumberedsubsubsec Tremolo subdivisions
302 @cindex tremolo marks
303 @funindex tremoloFlags
305 Tremolo marks can be printed on a single note by adding
306 @q{@code{:}[@var{number}]} after the note. The number indicates
307 the duration of the subdivision, and it must be at least 8. A
308 @var{length} value of 8 gives one line across the note stem. If
309 the length is omitted, the last value (stored in
310 @code{tremoloFlags}) is used
312 @lilypond[quote,ragged-right,verbatim,fragment]
313 c'2:8 c':32 | c': c': |
319 Tremolos entered in this way do not carry over into the MIDI
325 Notation Reference: @ref{Tremolo repeats}.
327 Snippets: @lsrdir{repeats}
329 Elsewhere: @internalsref{StemTremolo}.
332 @node Measure repeats
333 @unnumberedsubsubsec Measure repeats
335 @cindex percent repeats
336 @cindex measure repeats
338 In the @code{percent} style, a note pattern can be repeated. It
339 is printed once, and then the pattern is replaced with a special
340 sign. Patterns of one and two measures are replaced by
341 percent-like signs, patterns that divide the measure length are
342 replaced by slashes. Percent repeats must be declared within a
343 @code{Voice} context.
345 @lilypond[quote,verbatim,ragged-right]
346 \new Voice \relative c' {
347 \repeat percent 4 { c4 }
348 \repeat percent 2 { c2 es2 f4 fis4 g4 c4 }
352 Measure repeats of more than 2 measures get a counter, if you
353 switch on the @code{countPercentRepeats} property,
355 @lilypond[relative=2,fragment,quote,verbatim,ragged-right]
357 \set countPercentRepeats = ##t
358 \repeat percent 4 { c1 }
364 Isolated percents can also be printed. This is done by putting a
365 multi-measure rest with a different print function,
367 @lilypond[fragment,verbatim,quote]
368 \override MultiMeasureRest #'stencil
369 = #ly:multi-measure-rest::percent
378 Snippets: @lsrdir{repeats}
380 Internals Reference: @internalsref{RepeatSlash},
381 @internalsref{PercentRepeat}, @internalsref{DoublePercentRepeat},
382 @internalsref{DoublePercentRepeatCounter},
383 @internalsref{PercentRepeatCounter},
384 @internalsref{PercentRepeatedMusic}.