Next: , Up: Long repeats


Normal repeats

The syntax for a normal repeat is

\repeat volta repeatcount musicexpr

where musicexpr is a music expression. Alternate endings can be produced using \alternative. In order to delimit the alternate endings, the group of alternatives must be enclosed in a set of braces. If there are more repeats than there are alternate endings, the earliest repeats are given the first alternative.

Normal repeats without alternate endings:

     
     \repeat volta 2 { c4 d e f }
     c2 d
     \repeat volta 2 { d4 e f g }

[image of music]

Normal repeats with alternate endings:

     
     \repeat volta 4 { c4 d e f }
     \alternative {
       { d2 e }
       { f2 g }
     }
     c1

[image of music]

Repeats with upbeats can be entered in two ways:

     
     \partial 4
     e |
     \repeat volta 4 { c2 d | e2 f | }
     \alternative {
       { g4 g g e }
       { a4 a a a | b2. }
     }

[image of music]

or

     
     \partial 4 
     \repeat volta 4 { e4 | c2 d | e2 f | }
     \alternative {
       { \partial 4*3 g4 g g }
       { a4 a a a | b2. }
     }

[image of music]

Ties may be added to a second ending:

     
     c1
     \repeat volta 2 { c4 d e f ~ }
     \alternative {
       { f2 d }
       { f2\repeatTie f, }
     }

[image of music]

Selected Snippets

Shortening volta brackets

By default, the volta brackets will be drawn over all of the alternative music, but it is possible to shorten them by setting voltaSpannerDuration. In the next example, the bracket only lasts one measure, which is a duration of 3/4.

     
     \relative c'' {
       \time 3/4
       c4 c c
       \set Score.voltaSpannerDuration = #(ly:make-moment 3 4)
       \repeat volta 5 { d4 d d }
       \alternative {
         {
           e4 e e
           f4 f f
         }
         { g4 g g }
       }
     }

[image of music]

Adding volta brackets to additional staves

The Volta_engraver by default resides in the Score context, and brackets for the repeat are thus normally only printed over the topmost staff. This can be adjusted by adding the Volta_engraver to the Staff context where the brackets should appear; see also the "Volta multi staff" snippet.

     
     <<
       \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
       \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
       \new Staff \with { \consists "Volta_engraver" } { c'2 g' e' a' }
       \new Staff { \repeat volta 2 { c'1 } \alternative { c' } }
     >>

[image of music]

See also

Music Glossary: repeat, volta.

Notation Reference: Bar lines, Modifying context plug-ins.

Snippets: Repeats.

Internals Reference: VoltaBracket, RepeatedMusic, VoltaRepeatedMusic, UnfoldedRepeatedMusic.

Known issues and warnings

A nested repeat like

\repeat ...
\repeat ...
\alternative

is ambiguous, since it is is not clear to which \repeat the \alternative belongs. This ambiguity is resolved by always having the \alternative belong to the inner \repeat. For clarity, it is advisable to use braces in such situations.

Timing information is not remembered at the start of an alternative, so after a repeat timing information must be reset by hand; for example, by setting Score.measurePosition or entering \partial. Similarly, slurs are also not repeated.

Cette page documente LilyPond-2.11.58 (branche de développement).

Rapportez toute anomalie en français à lilypond-user-fr@gnu.org ou en anglais à http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs

Vos suggestions à propos de la documentation sont les bienvenues.

Autres langues : español.