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. For details, see the Contributors'
7 Guide, node Updating translation committishes..
15 @lilypondfile[quote]{repeats-headword.ly}
17 Repetition is a central concept in music, and multiple notations
18 exist for repetitions. LilyPond supports the following kinds of
24 The repeated music is not written out but enclosed between repeat bar
25 lines. If the repeat is at the beginning of a piece, a repeat bar
26 line is only printed at the end of the repeat. Alternative endings
27 (volte) are printed left to right with brackets. This is the standard
28 notation for repeats with alternatives.
31 The repeated music is fully written out, as many times as
32 specified by @var{repeatcount}. This is useful when
33 entering repetitious music.
36 These are beat or measure repeats. They look like single slashes or
40 This is used to write tremolo beams.
51 @subsection Long repeats
53 This section discusses how to input long (usually multi-measure)
54 repeats. The repeats can take two forms: repeats enclosed between
55 repeat signs; or written out repeats, used to input repetitious music.
56 Repeat signs can also be controlled manually.
60 * Manual repeat marks::
61 * Written-out repeats::
68 @cindex volta, seconda
69 @cindex repeat, normal
71 @cindex repeat with alternate endings
72 @cindex alternate endings
74 @funindex \alternative
78 @unnumberedsubsubsec Normal repeats
80 The syntax for a normal repeat is
83 \repeat volta @var{repeatcount} @var{musicexpr}
87 where @var{musicexpr} is a music expression.
89 A single repeat without an alternate ending:
91 @lilypond[verbatim,quote,relative=2]
92 \repeat volta 2 { c4 d e f }
94 \repeat volta 2 { d4 e f g }
97 Alternative endings can be produced using @code{\alternative}. Each
98 group of alternatives must be themselves, enclosed in a set of braces.
101 \repeat volta @var{repeatcount} @var{musicexpr}
103 @{ @var{musicexpr} @}
108 where @var{musicexpr} is a music expression.
110 If there are more repeats than there are alternate endings, the earliest
111 repeats are given the first alternative.
113 A single repeat with one alternate ending:
115 @lilypond[verbatim,quote,relative=2]
116 \repeat volta 2 { c4 d e f }
124 A single repeat with more than one alternate ending:
126 @lilypond[verbatim,quote,relative=2]
127 \repeat volta 4 { c4 d e f }
135 Multiple repeats with more than one alternate ending:
137 @lilypond[verbatim,quote,relative=2]
138 \repeat volta 3 { c4 d e f }
147 @warning{If you include @code{@bs{}relative} inside a
148 @code{@bs{}repeat} without explicitly instantiating the
149 @code{Voice} context, extra (unwanted) staves will appear. See
150 @rprogram{An extra staff appears}.}
152 @cindex repeat with upbeat
153 @cindex upbeat in a repeat
154 @cindex anacrucis in a repeat
155 @cindex repeat with anacrucis
156 @cindex repeat with pickup
157 @cindex pickup in a repeat
161 If a repeat starts in the middle of a measure and has no alternate
162 endings, normally the end of the repeat will also fall in the
163 middle of a measure, so that the two ends add up to one complete
164 measure. In such cases, the repeat signs do not constitute true
165 bar lines. Do not use @code{\partial} commands or bar checks
166 where these repeat signs are printed:
168 @lilypond[verbatim,quote,relative=1]
170 c4 e g % no bar check here
176 g4 g g % no bar check here
184 Similarly, if a repeat begins with the initial partial measure of
185 a score and has no alternate endings, the same conditions apply as
186 in the above example, except that in this case the @code{\partial}
187 command is required at the beginning of the score:
189 @lilypond[verbatim,quote,relative=1]
190 \partial 4 % required
195 g4 g g % no bar check here
203 When alternate endings are added to a repeat that begins with an
204 incomplete measure, it becomes necessary to set the
205 @code{Timing.measureLength} context property manually, in the
206 following specific places:
210 at the start of any incomplete measures in the @code{\alternative}
211 block, which normally occur at the end of each alternative, except
212 (in most cases) the last.
215 at the start of each alternative, except the first.
218 @lilypond[verbatim,quote,relative=1]
220 \repeat volta 2 { e4 | c2 e | }
224 \set Timing.measureLength = #(ly:make-moment 3 4)
225 g4 g g % optional bar check is allowed here
228 \set Timing.measureLength = #(ly:make-moment 4 4)
235 The @code{measureLength} property is described in @ref{Time
238 @cindex repeats with ties
239 @cindex alternative endings with ties
240 @cindex ties in repeats
241 @cindex ties in alternative endings
244 Ties may be added to a second ending:
246 @lilypond[verbatim,quote,relative=2]
248 \repeat volta 2 { c4 d e f~ }
257 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
258 {shortening-volta-brackets.ly}
260 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
261 {adding-volta-brackets-to-additional-staves.ly}
263 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
264 {setting-the-double-repeat-default-for-volte.ly}
273 @ref{Modifying context plug-ins},
274 @ref{Time administration}.
280 @rinternals{VoltaBracket},
281 @rinternals{RepeatedMusic},
282 @rinternals{VoltaRepeatedMusic},
283 @rinternals{UnfoldedRepeatedMusic}.
288 @cindex repeat, ambiguous
289 @cindex nested repeat
290 @cindex repeat, nested
291 @cindex repeat timing information
292 @cindex repeat and measure number
293 @cindex timing information and repeats
294 @cindex measure number and repeats
295 @cindex repeat and slur
296 @cindex slur and repeat
298 Slurs that span from a @code{\repeat} block into an
299 @code{\alternative} block will only work for the first alternate
300 ending. Also, slurs cannot wrap around from the end of one
301 alternative back to the beginning of the repeat.
303 If a repeat that begins with an incomplete measure has an
304 @code{\alternative} block that contains modifications to the
305 @code{measureLength} property, using @code{\unfoldRepeats} will
306 result in wrongly-placed bar lines and bar check warnings.
317 is ambiguous, since it is not clear to which @code{\repeat} the
318 @code{\alternative} belongs. This ambiguity is resolved by always
319 having the @code{\alternative} belong to the inner @code{\repeat}.
320 For clarity, it is advisable to use braces in such situations.
323 @node Manual repeat marks
324 @unnumberedsubsubsec Manual repeat marks
326 @cindex manual repeat mark
327 @cindex repeat, manual
329 @cindex repeat, start
332 @cindex repeat number, changing
333 @cindex repeat volta, changing
334 @cindex volta bracket
335 @cindex bracket, volta
336 @funindex repeatCommands
337 @funindex start-repeat
339 @warning{These methods are only used for displaying unusual repeat
340 constructs, and may produce unexpected behavior. In most cases,
341 repeats should be created using the standard @code{@bs{}repeat} command
342 or by printing the relevant bar lines. For more information, see
345 The property @code{repeatCommands} can be used to control the
346 layout of repeats. Its value is a Scheme list of repeat commands.
350 Print a @code{|:} bar line.
352 @lilypond[verbatim,quote,relative=2]
354 \set Score.repeatCommands = #'(start-repeat)
359 As per standard engraving practice, repeat signs are not printed
360 at the beginning of a piece.
363 Print a @code{:|} bar line:
365 @lilypond[verbatim,quote,relative=2]
368 \set Score.repeatCommands = #'(end-repeat)
372 @item (volta @var{number}) ... (volta #f)
373 Create a new volta with the specified number. The volta bracket must
374 be explicitly terminated, or it will not be printed.
376 @lilypond[verbatim,quote,relative=2]
378 \set Score.repeatCommands = #'((volta "2"))
380 \set Score.repeatCommands = #'((volta #f))
386 Multiple repeat commands may occur at the same point:
388 @lilypond[verbatim,quote,relative=2]
390 \set Score.repeatCommands = #'((volta "2, 5") end-repeat)
393 \set Score.repeatCommands = #'((volta #f) (volta "95") end-repeat)
395 \set Score.repeatCommands = #'((volta #f))
398 @cindex volta bracket with text
399 @cindex text in volta bracket
401 Text can be included with the volta bracket. The text can be a
402 number or numbers or markup text, see @ref{Formatting text}. The
403 simplest way to use markup text is to define the markup first,
404 then include the markup in a Scheme list.
406 @lilypond[verbatim,quote]
407 voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }
410 \set Score.repeatCommands = #(list(list 'volta voltaAdLib) 'start-repeat)
412 \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
414 \set Score.repeatCommands = #'((volta #f))
421 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
422 {printing-a-repeat-sign-at-the-beginning-of-a-piece.ly}
428 @ref{Formatting text}.
434 @rinternals{VoltaBracket},
435 @rinternals{RepeatedMusic},
436 @rinternals{VoltaRepeatedMusic}.
439 @node Written-out repeats
440 @unnumberedsubsubsec Written-out repeats
442 @cindex written-out repeats
443 @cindex repetitious music
444 @cindex repeats, written-out
445 @cindex repeat, unfold
447 @cindex unfold repeat
448 @cindex unfold repeat with alternate endings
449 @cindex unfold music with alternate endings
450 @cindex alternate ending in written-out repeats
453 By using the @code{unfold} command, repeats can be used to simplify
454 the writing out of repetitious music. The syntax is
457 \repeat unfold @var{repeatcount} @var{musicexpr}
461 where @var{musicexpr} is a music expression and @var{repeatcount} is
462 the number of times @var{musicexpr} is repeated.
464 @lilypond[verbatim,quote,relative=2]
465 \repeat unfold 2 { c4 d e f }
469 Unfold repeats can be made with alternate endings.
471 @lilypond[verbatim,quote,relative=2]
472 \repeat unfold 2 { c4 d e f }
480 If there are more repeats than there are alternate endings, the first
481 alternative is applied multiple times until the remaining alternatives
482 make up the total number of repeats.
484 @lilypond[verbatim,quote,relative=2]
485 \repeat unfold 4 { c4 d e f }
494 If there are more alternate endings than repeats then the first
495 alternatives are applied, LilyPond will ignore the remaining
496 alternatives which will not be printed.
498 @lilypond[verbatim,quote,relative=2]
499 \repeat unfold 2 { c4 d e f }
508 It is also possible to nest multiple @code{unfold} functions (with or
509 without alternate endings).
511 @lilypond[verbatim,quote,relative=2]
513 \repeat unfold 2 { c4 d e f }
523 @warning{If you include @code{@bs{}relative} inside a
524 @code{@bs{}repeat} without explicitly instantiating the
525 @code{Voice} context, extra (unwanted) staves will appear. See
526 @rprogram{An extra staff appears}.}
534 @rinternals{RepeatedMusic},
535 @rinternals{UnfoldedRepeatedMusic}.
539 @subsection Short repeats
541 This section discusses how to input short repeats. Short repeats can
542 take two forms: slashes or percent signs to represent repeats of a
543 single note, a single measure or two measures, and tremolos otherwise.
550 @node Percent repeats
551 @unnumberedsubsubsec Percent repeats
553 @cindex percent repeats
554 @cindex measure repeats
555 @cindex repeat, percent
556 @cindex repeat, measure
557 @cindex repeat, short
558 @funindex \repeat percent
561 Repeated short patterns are printed once, and the repeated pattern
562 is replaced with a special sign.
567 @code{\repeat percent @var{number} @var{musicexpr}}
571 where @var{musicexpr} is a music expression.
573 Patterns that are shorter than one measure are replaced by slashes.
575 @lilypond[verbatim,quote,relative=2]
576 \repeat percent 4 { c8 d }
577 \repeat percent 4 { c4 }
578 \repeat percent 2 { c2 }
581 Patterns of one or two measures are replaced by percent-like signs.
583 @lilypond[verbatim,quote,relative=2]
584 \repeat percent 3 { c4 d e f }
585 \repeat percent 4 { c2 d }
588 @lilypond[verbatim,quote,relative=2]
589 \repeat percent 3 { c4 d e f | c2 g' }
594 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
595 {percent-repeat-counter.ly}
597 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
598 {percent-repeat-count-visibility.ly}
600 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
601 {isolated-percent-repeats.ly}
606 @rglos{percent repeat},
613 @rinternals{RepeatSlash},
614 @rinternals{PercentRepeat},
615 @rinternals{DoublePercentRepeat},
616 @rinternals{DoublePercentRepeatCounter},
617 @rinternals{PercentRepeatCounter},
618 @rinternals{PercentRepeatedMusic}.
623 Only three kinds of percent repeats are supported: a single slash
624 representing a single beat (regardless of the duration of the repeated
625 notes); a single slash with dots representing one full measure; and
626 two slashes with dots crossing a bar line representing two full
627 measures. Neither multiple slashes representing single beat repeats
628 consisting of sixteenth or shorter notes, nor two slashes with dots
629 representing single beat repeats consisting of notes of varying
630 durations, are supported.
633 @node Tremolo repeats
634 @unnumberedsubsubsec Tremolo repeats
636 @cindex tremolo beams
638 @cindex repeat, tremolo
639 @funindex \repeat tremolo
642 Tremolos can take two forms: alternation between two chords or two
643 notes, and rapid repetition of a single note or chord. Tremolos
644 consisting of an alternation are indicated by adding beams between the
645 notes or chords being alternated, while tremolos consisting of the
646 rapid repetition of a single note are indicated by adding beams or
647 slashes to a single note.
649 To place tremolo marks between notes, use @code{\repeat} with
652 @lilypond[quote,verbatim,relative=2]
653 \repeat tremolo 8 { c16 d }
654 \repeat tremolo 6 { c16 d }
655 \repeat tremolo 2 { c16 d }
658 The @code{\repeat tremolo} syntax expects exactly two notes within
659 the braces, and the number of repetitions must correspond to a
660 note value that can be expressed with plain or dotted notes. Thus,
661 @code{\repeat tremolo 7} is valid and produces a double dotted
662 note, but @code{\repeat tremolo 9} is not.
664 The duration of the tremolo equals the duration of the
665 braced expression multiplied by the number of repeats:
666 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
667 notated as two whole notes joined by tremolo beams.
669 There are two ways to put tremolo marks on a single note. The
670 @code{\repeat tremolo} syntax is also used here, in which case
671 the note should not be surrounded by braces:
673 @lilypond[quote,verbatim,ragged-right]
674 \repeat tremolo 4 c'16
677 @cindex tremolo marks
678 @funindex tremoloFlags
681 The same output can be obtained by adding
682 @q{@code{:}[@var{number}]} after the note. The number indicates
683 the duration of the subdivision, and it must be at least 8. A
684 @var{number} value of 8 gives one line across the note stem. If
685 the length is omitted, the last value (stored in
686 @code{tremoloFlags}) is used:
688 @lilypond[quote,verbatim,relative=2]
695 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
696 {cross-staff-tremolos.ly}
703 @cindex tremolo, cross-staff
704 @cindex cross-staff tremolo