[icon]

GNU LilyPond

Welcome to the home of the GNU Music Typesetter

What is LilyPond
General information
Simple examples
Complex examples
Download
GNU/Linux binaries
Windows
Source code
Documentation
Tutorial
Manual
Glossary
other ...

Support
Mailing lists
Search
WikiWiki
FAQs

External sites
lilypond.org/development
lilypond.org/stable
ftp.lilypond.org
Mutopia
Other music online

Node:Repeat syntax, Next:, Up:Repeats



Repeat syntax

The syntax for repeats is

  \repeat variant repeatcount repeatbody

If you have alternative endings, you may add

 \alternative { alternative1
            alternative2
            alternative3 ... }
where each alternative is a music expression.

Normal notation repeats are used like this:

  c'1
  \repeat volta 2 { c'4 d' e' f' }
  \repeat volta 2 { f' e' d' c' }

[picture of music]

With alternative endings:

  c'1
  \repeat volta 2 {c'4 d' e' f'}
  \alternative { {d'2 d'} {f' f} }

[picture of music]

Folded repeats look like this:

  c'1
  \repeat fold 2 {c'4 d' e' f'}
  \alternative { {d'2 d'} {f' f} }


[picture of music]

If you don't give enough alternatives for all of the repeats, then the first alternative is assumed to be repeated often enough to equal the specified number of repeats.

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

[picture of music]

BUGS

Notice that timing information is not remembered at the start of an alternative, so you have to reset timing information after a repeat, e.g. using a bar-check (See Bar check), setting Score.measurePosition or entering \partial. Slurs or ties are also not repeated.

It is possible to nest \repeats, although this probably is only meaningful for unfolded repeats.

Folded repeats offer little more over simultaneous music. However, it is to be expected that more functionality - especially for the MIDI backend - will be implemented at some point in the future.

Volta repeats are printed over all staffs in a score. You must turn them off explicitly, for example by doing

  \property Staff.VoltaBracket = \turnOff
in all but the top staff.
Go back to index of LilyPond.

Please send GNU LilyPond questions and comments to lilypond-user@gnu.org.

Please send comments on these web pages to lilypond@packages.debian.org

Copyright (c) 1997--2001 Han-Wen Nienhuys and Jan Nieuwenhuizen.

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


This page was built from LilyPond-1.4.12 (stable-branch) by

Anthony Fok <lilypond@packages.debian.org>, Tue Mar 12 01:35:39 2002 HKT.