Written-out repeats

The \repeat unfold command repeats music by writing it out a number of times. The syntax is the same as the \repeat volta and \repeat segno commands, which are documented in following sections.

To avoid redundancy, unfolding is not demonstrated in detail here; however, some of the examples in following sections illustrate repeats in multiple forms using the \unfoldRepeats command to convert the volta or segno form to the unfold form. For another important use of the \unfoldRepeats command, see section Using repeats with MIDI.

There are some points of interest specific to the \repeat unfold command.

In some cases, especially in a \relative context, the outcome of unfolding is not the same as of writing the input music expression multiple times, e.g.,

\repeat unfold 2 { a'4 b c d | }

differs from the following by an octave change:

a'4 b c d |
a'4 b c d |

Also, nesting \repeat unfold can be practical in ways that nesting \repeat volta or \repeat segno would not be.

Note: If you include \relative inside a \repeat without explicitly instantiating the Voice context, extra (unwanted) staves will appear. See An extra staff appears.

See also

Snippets: Repeats.

Internals Reference: RepeatedMusic, UnfoldedRepeatedMusic.


LilyPond Notation Reference v2.25.13 (development-branch).