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 @code{@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 @code{@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 @code{@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 there are two or more alternatives, nothing should appear
148 between the closing brace of one and the opening brace of the next
149 in an @code{@bs{}alternative} block, otherwise you will not get the
150 expected number of endings.}
152 @warning{If you include @code{@bs{}relative} inside a
153 @code{@bs{}repeat} without explicitly instantiating the
154 @code{Voice} context, extra (unwanted) staves will appear. See
155 @rprogram{An extra staff appears}.}
157 @cindex repeat with upbeat
158 @cindex upbeat in a repeat
159 @cindex anacrucis in a repeat
160 @cindex repeat with anacrucis
161 @cindex repeat with pickup
162 @cindex pickup in a repeat
165 If a repeat starts in the middle of a measure and has no alternate
166 endings, normally the end of the repeat will also fall in the
167 middle of a measure, so that the two ends add up to one complete
168 measure. In such cases, the repeat signs do not constitute true
169 bar lines. Do not use @code{\partial} commands or bar checks
170 where these repeat signs are printed:
172 @lilypond[verbatim,quote,relative=1]
174 c4 e g % no bar check here
180 g4 g g % no bar check here
188 Similarly, if a repeat begins with the initial partial measure of
189 a score and has no alternate endings, the same conditions apply as
190 in the above example, except that in this case the @code{\partial}
191 command is required at the beginning of the score:
193 @lilypond[verbatim,quote,relative=1]
194 \partial 4 % required
199 g4 g g % no bar check here
207 When alternate endings are added to a repeat that begins with an
208 incomplete measure, it becomes necessary to set the
209 @code{Timing.measureLength} context property manually, in the
210 following specific places:
214 at the start of any incomplete measures in the @code{\alternative}
215 block, which normally occur at the end of each alternative, except
216 (in most cases) the last.
219 at the start of each alternative, except the first.
222 @lilypond[verbatim,quote,relative=1]
224 \repeat volta 2 { e4 | c2 e | }
228 \set Timing.measureLength = #(ly:make-moment 3 4)
229 g4 g g % optional bar check is allowed here
232 \set Timing.measureLength = #(ly:make-moment 4 4)
239 The @code{measureLength} property is described in @ref{Time
242 @cindex repeats with ties
243 @cindex alternative endings with ties
244 @cindex ties in repeats
245 @cindex ties in alternative endings
248 Ties may be added to a second ending:
250 @lilypond[verbatim,quote,relative=2]
252 \repeat volta 2 { c4 d e f~ }
261 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
262 {shortening-volta-brackets.ly}
264 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
265 {adding-volta-brackets-to-additional-staves.ly}
267 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
268 {setting-the-double-repeat-default-for-volte.ly}
277 @ref{Modifying context plug-ins},
278 @ref{Time administration}.
284 @rinternals{VoltaBracket},
285 @rinternals{RepeatedMusic},
286 @rinternals{VoltaRepeatedMusic},
287 @rinternals{UnfoldedRepeatedMusic}.
292 @cindex repeat, ambiguous
293 @cindex nested repeat
294 @cindex repeat, nested
295 @cindex repeat timing information
296 @cindex repeat and measure number
297 @cindex timing information and repeats
298 @cindex measure number and repeats
299 @cindex repeat and slur
300 @cindex slur and repeat
302 Slurs that span from a @code{\repeat} block into an
303 @code{\alternative} block will only work for the first alternate
304 ending. Also, slurs cannot wrap around from the end of one
305 alternative back to the beginning of the repeat.
307 If a repeat that begins with an incomplete measure has an
308 @code{\alternative} block that contains modifications to the
309 @code{measureLength} property, using @code{\unfoldRepeats} will
310 result in wrongly-placed bar lines and bar check warnings.
321 is ambiguous, since it is not clear to which @code{\repeat} the
322 @code{\alternative} belongs. This ambiguity is resolved by always
323 having the @code{\alternative} belong to the inner @code{\repeat}.
324 For clarity, it is advisable to use braces in such situations.
327 @node Manual repeat marks
328 @unnumberedsubsubsec Manual repeat marks
330 @cindex manual repeat mark
331 @cindex repeat, manual
333 @cindex repeat, start
336 @cindex repeat number, changing
337 @cindex repeat volta, changing
338 @cindex volta bracket
339 @cindex bracket, volta
340 @funindex repeatCommands
341 @funindex start-repeat
343 @warning{These methods are only used for displaying unusual repeat
344 constructs, and may produce unexpected behavior. In most cases,
345 repeats should be created using the standard @code{@bs{}repeat} command
346 or by printing the relevant bar lines. For more information, see
349 The property @code{repeatCommands} can be used to control the
350 layout of repeats. Its value is a Scheme list of repeat commands.
354 Print a @code{|:} bar line.
356 @lilypond[verbatim,quote,relative=2]
358 \set Score.repeatCommands = #'(start-repeat)
363 As per standard engraving practice, repeat signs are not printed
364 at the beginning of a piece.
367 Print a @code{:|} bar line:
369 @lilypond[verbatim,quote,relative=2]
372 \set Score.repeatCommands = #'(end-repeat)
376 @item (volta @var{number}) ... (volta #f)
377 Create a new volta with the specified number. The volta bracket must
378 be explicitly terminated, or it will not be printed.
380 @lilypond[verbatim,quote,relative=2]
382 \set Score.repeatCommands = #'((volta "2"))
384 \set Score.repeatCommands = #'((volta #f))
390 Multiple repeat commands may occur at the same point:
392 @lilypond[verbatim,quote,relative=2]
394 \set Score.repeatCommands = #'((volta "2, 5") end-repeat)
397 \set Score.repeatCommands = #'((volta #f) (volta "95") end-repeat)
399 \set Score.repeatCommands = #'((volta #f))
402 @cindex volta bracket with text
403 @cindex text in volta bracket
405 Text can be included with the volta bracket. The text can be a
406 number or numbers or markup text, see @ref{Formatting text}. The
407 simplest way to use markup text is to define the markup first,
408 then include the markup in a Scheme list.
410 @lilypond[verbatim,quote]
411 voltaAdLib = \markup { 1. 2. 3... \text \italic { ad lib. } }
414 \set Score.repeatCommands = #(list(list 'volta voltaAdLib) 'start-repeat)
416 \set Score.repeatCommands = #'((volta #f) (volta "4.") end-repeat)
418 \set Score.repeatCommands = #'((volta #f))
425 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
426 {printing-a-repeat-sign-at-the-beginning-of-a-piece.ly}
432 @ref{Formatting text}.
438 @rinternals{VoltaBracket},
439 @rinternals{RepeatedMusic},
440 @rinternals{VoltaRepeatedMusic}.
443 @node Written-out repeats
444 @unnumberedsubsubsec Written-out repeats
446 @cindex written-out repeats
447 @cindex repetitious music
448 @cindex repeats, written-out
449 @cindex repeat, unfold
451 @cindex unfold repeat
452 @cindex unfold repeat with alternate endings
453 @cindex unfold music with alternate endings
454 @cindex alternate ending in written-out repeats
457 By using the @code{unfold} command, repeats can be used to simplify
458 the writing out of repetitious music. The syntax is
461 \repeat unfold @var{repeatcount} @var{musicexpr}
465 where @code{@var{musicexpr}} is a music expression and
466 @code{@var{repeatcount}} is the number of times
467 @code{@var{musicexpr}} is repeated.
469 @lilypond[verbatim,quote,relative=2]
470 \repeat unfold 2 { c4 d e f }
474 Unfold repeats can be made with alternate endings.
476 @lilypond[verbatim,quote,relative=2]
477 \repeat unfold 2 { c4 d e f }
485 If there are more repeats than there are alternate endings, the first
486 alternative is applied multiple times until the remaining alternatives
487 make up the total number of repeats.
489 @lilypond[verbatim,quote,relative=2]
490 \repeat unfold 4 { c4 d e f }
499 If there are more alternate endings than repeats then the first
500 alternatives are applied, LilyPond will ignore the remaining
501 alternatives which will not be printed.
503 @lilypond[verbatim,quote,relative=2]
504 \repeat unfold 2 { c4 d e f }
513 It is also possible to nest multiple @code{unfold} functions (with or
514 without alternate endings).
516 @lilypond[verbatim,quote,relative=2]
518 \repeat unfold 2 { c4 d e f }
528 @warning{If you include @code{@bs{}relative} inside a
529 @code{@bs{}repeat} without explicitly instantiating the
530 @code{Voice} context, extra (unwanted) staves will appear. See
531 @rprogram{An extra staff appears}.}
539 @rinternals{RepeatedMusic},
540 @rinternals{UnfoldedRepeatedMusic}.
544 @subsection Short repeats
546 This section discusses how to input short repeats. Short repeats can
547 take two forms: slashes or percent signs to represent repeats of a
548 single note, a single measure or two measures, and tremolos otherwise.
555 @node Percent repeats
556 @unnumberedsubsubsec Percent repeats
558 @cindex percent repeats
559 @cindex measure repeats
560 @cindex repeat, percent
561 @cindex repeat, measure
562 @cindex repeat, short
563 @funindex \repeat percent
566 Repeated short patterns are printed once, and the repeated pattern
567 is replaced with a special sign.
572 \repeat percent @var{number} @var{musicexpr}
576 where @code{@var{musicexpr}} is a music expression.
578 Patterns that are shorter than one measure are replaced by slashes.
580 @lilypond[verbatim,quote,relative=2]
581 \repeat percent 4 { c128 d e f }
582 \repeat percent 4 { c64 d e f }
583 \repeat percent 5 { c32 d e f }
584 \repeat percent 4 { c16 d e f }
585 \repeat percent 4 { c8 d }
586 \repeat percent 4 { c4 }
587 \repeat percent 2 { c2 }
590 Patterns of one or two measures are replaced by percent-like symbols.
592 @lilypond[verbatim,quote,relative=2]
593 \repeat percent 2 { c4 d e f }
594 \repeat percent 2 { c2 d }
595 \repeat percent 2 { c1 }
598 @lilypond[verbatim,quote,relative=2]
599 \repeat percent 3 { c4 d e f | c2 g' }
602 Patterns that are shorter than one measure but contain mixed durations
603 use a double-percent symbol.
605 @lilypond[verbatim,quote,relative=2]
606 \repeat percent 4 { c8. <d f>16 }
607 \repeat percent 2 { \times 2/3 { r8 c d } e4 }
612 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
613 {percent-repeat-counter.ly}
615 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
616 {percent-repeat-count-visibility.ly}
618 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
619 {isolated-percent-repeats.ly}
623 @rglos{percent repeat},
630 @rinternals{RepeatSlash},
631 @rinternals{RepeatSlashEvent},
632 @rinternals{DoubleRepeatSlash},
633 @rinternals{PercentRepeat},
634 @rinternals{PercentRepeatCounter},
635 @rinternals{PercentRepeatedMusic},
636 @rinternals{Percent_repeat_engraver},
637 @rinternals{DoublePercentEvent},
638 @rinternals{DoublePercentRepeat},
639 @rinternals{DoublePercentRepeatCounter},
640 @rinternals{Double_percent_repeat_engraver},
641 @rinternals{Slash_repeat_engraver}.
644 @node Tremolo repeats
645 @unnumberedsubsubsec Tremolo repeats
647 @cindex tremolo beams
649 @cindex repeat, tremolo
650 @funindex \repeat tremolo
653 Tremolos can take two forms: alternation between two chords or two
654 notes, and rapid repetition of a single note or chord. Tremolos
655 consisting of an alternation are indicated by adding beams between the
656 notes or chords being alternated, while tremolos consisting of the
657 rapid repetition of a single note are indicated by adding beams or
658 slashes to a single note.
660 To place tremolo marks between notes, use @code{\repeat} with
663 @lilypond[quote,verbatim,relative=2]
664 \repeat tremolo 8 { c16 d }
665 \repeat tremolo 6 { c16 d }
666 \repeat tremolo 2 { c16 d }
669 The @code{\repeat tremolo} syntax expects exactly two notes within
670 the braces, and the number of repetitions must correspond to a
671 note value that can be expressed with plain or dotted notes. Thus,
672 @code{\repeat tremolo 7} is valid and produces a double dotted
673 note, but @code{\repeat tremolo 9} is not.
675 The duration of the tremolo equals the duration of the
676 braced expression multiplied by the number of repeats:
677 @code{\repeat tremolo 8 @{ c16 d16 @}} gives a whole note tremolo,
678 notated as two whole notes joined by tremolo beams.
680 There are two ways to put tremolo marks on a single note. The
681 @code{\repeat tremolo} syntax is also used here, in which case
682 the note should not be surrounded by braces:
684 @lilypond[quote,verbatim,ragged-right]
685 \repeat tremolo 4 c'16
688 @cindex tremolo marks
689 @funindex tremoloFlags
692 The same output can be obtained by adding @code{:@var{N}} after
693 the note, where @code{@var{N}} indicates the duration of the
694 subdivision (it must be at least 8). If @code{@var{N}} is 8, one
695 beam is added to the note's stem. If @code{@var{N}} is omitted,
696 the last value (stored in @code{tremoloFlags}) is used:
698 @lilypond[quote,verbatim,relative=2]
705 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
706 {cross-staff-tremolos.ly}
713 @cindex tremolo, cross-staff
714 @cindex cross-staff tremolo