Node: Repeat syntax, Next: , Up: Repeats



Repeat syntax

Syntax

LilyPond has one syntactic construct for specifying different types of repeats. The syntax is

       \repeat variant repeatcount repeatbody
     

If you have alternative endings, you may add

      \alternative { alternative1
                 alternative2
                 alternative3 ... }
     
where each alternative is a music expression. If you do not give enough alternatives for all of the repeats, then the first alternative is assumed to be played more than once.

Normal notation repeats are used like this:

       c1
       \repeat volta 2 { c4 d e f }
       \repeat volta 2 { f e d c }
     

[picture of music]

With alternative endings:

       c1
       \repeat volta 2 {c4 d e f}
       \alternative { {d2 d} {f f,} }
     

[picture of music]

     \context Staff {
         \partial 4
         \repeat volta 4 { e | c2 d2 | e2 f2 | }
         \alternative { { g4 g g } { a | a a a a | b2. } }
     }
     

[picture of music]

Bugs

If you do a nested repeat like

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

then it is ambiguous 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.


This page is for LilyPond-2.0.1 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.