LilyPond Notation Reference: 1.2.2 Writing rests

### 1.2.2 Writing rests

Rests are entered as part of the music in music expressions.

#### Rests

Rests are entered like notes with the note name `r`. Durations longer than a whole rest use the following predefined commands:

>     \new Staff {
>       % These two lines are just to prettify this example
>       \time 16/1
>       \override Staff.TimeSignature #'stencil = ##f
>       % Print a maxima rest, equal to four breves
>       r\maxima
>       % Print a longa rest, equal to two breves
>       r\longa
>       % Print a breve rest
>       r\breve
>       r1 r2 r4 r8 r16 r32 r64 r128
>     }

Whole measure rests, centered in the middle of the measure, must be entered as multi-measure rests. They can be used for a single measure as well as many measures and are discussed in Full measure rests.

To explicitly specify a rest’s vertical position, write a note followed by `\rest`. A rest of the duration of the note will be placed at the staff position where the note would appear. This allows for precise manual formatting of polyphonic music, since the automatic rest collision formatter will not move these rests.

>     a4\rest d4\rest

#### Selected Snippets

Rest styles

Rests may be used in various styles.

>     \layout {
>       indent = 0
>       \context {
>         \Staff
>         \remove "Time_signature_engraver"
>       }
>     }

>     \new Staff \relative c {
>       \cadenzaOn
>       \override Staff.Rest #'style = #'mensural
>       r\maxima^\markup \typewriter { mensural }
>       r\longa r\breve r1 r2 r4 r8 r16 s32 s64 s128 s128
>       \bar ""

>       \override Staff.Rest #'style = #'neomensural
>       r\maxima^\markup \typewriter { neomensural }
>       r\longa r\breve r1 r2 r4 r8 r16 s32 s64 s128 s128
>       \bar ""

>       \override Staff.Rest #'style = #'classical
>       r\maxima^\markup \typewriter { classical }
>       r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 s128
>       \bar ""

>       \override Staff.Rest  #'style = #'default
>       r\maxima^\markup \typewriter { default }
>       r\longa r\breve r1 r2 r4 r8 r16 r32 r64 r128 s128
>     }

#### See also

Music Glossary: breve, longa, maxima.

Notation Reference: Full measure rests.

Snippets: Rhythms.

Internals Reference: Rest.

#### Known issues and warnings

There is no fundamental limit to rest durations (both in terms of longest and shortest), but the number of glyphs is limited: there are rests from 128th to maxima (8 x whole).

#### Invisible rests

An invisible rest (also called a ‘spacer rest’) can be entered like a note with the note name `s`:

>     c4 c s c
>     s2 c

Spacer rests are available only in note mode and chord mode. In other situations, for example, when entering lyrics, the command `\skip` is used to skip a musical moment. `\skip` requires an explicit duration, but this is ignored if the lyrics derive their durations from the notes in an associated melody through `\addlyrics` or `\lyricsto`.

>     <<
>       {
>         a2 \skip2 a2 a2
>       }
>       \new Lyrics {
>         \lyricmode {
>           foo2 \skip 1 bla2
>         }
>       }
>     >>

Because `\skip` is a command, it does not affect the default durations of following notes, unlike `s`.

>     <<
>       {
>         \repeat unfold 8 { a4 }
>       }
>       {
>         a4 \skip 2 a |
>         s2 a
>       }
>     >>

A spacer rest implicitly causes `Staff` and `Voice` contexts to be created if none exist, just like notes and rests do:

>     s1 s s

`\skip` simply skips musical time; it creates no output of any kind.

>     % This is valid input, but does nothing
>     \skip 1 \skip1 \skip 1

#### See also

Learning Manual: Visibility and color of objects.

Notation Reference: Hidden notes, Visibility of objects.

Snippets: Rhythms.

Internals Reference: SkipMusic.

#### Full measure rests

Rests for one or more full measures are entered like notes with the note name uppercase `R`:

>     % Rest measures contracted to single measure
>     \compressFullBarRests
>     R1*4
>     R1*24
>     R1*4
>     b2^"Tutti" b4 a4

The duration of full-measure rests is identical to the duration notation used for notes. The duration in a multi-measure rest must always be an integral number of measure-lengths, so augmentation dots or fractions must often be used:

>     \compressFullBarRests
>     \time 2/4
>     R1 | R2 |
>     \time 3/4
>     R2. | R2.*2 |
>     \time 13/8
>     R1*13/8 | R1*13/8*12 |
>     \time 10/8
>     R4*5*4 |

A full-measure rest is printed as either a whole or breve rest, centered in the measure, depending on the time signature.

>     \time 4/4
>     R1 |
>     \time 6/4
>     R1*3/2 |
>     \time 8/4
>     R1*2 |

By default a multi-measure rest is expanded in the printed score to show all the rest measures explicitly. Alternatively, a multi-measure rest can be shown as a single measure containing a multi-measure rest symbol, with the number of measures of rest printed above the measure:

>     % Default behavior
>     \time 3/4 r2. | R2.*2 |
>     \time 2/4 R2 |
>     \time 4/4
>     % Rest measures contracted to single measure
>     \compressFullBarRests
>     r1 | R1*17 | R1*4 |
>     % Rest measures expanded
>     \expandFullBarRests
>     \time 3/4
>     R2.*2 |

Markups can be added to multi-measure rests. The predefined command `\fermataMarkup` is provided for adding fermatas.

>     \compressFullBarRests
>     \time 3/4
>     R2.*10^\markup { \italic "ad lib." }
>     R2.^\fermataMarkup

Note: Markups attached to a multi-measure rest are objects of type `MultiMeasureRestText`, not `TextScript`. Overrides must be directed to the correct object, or they will be ignored. See the following example:

>     % This fails, as the wrong object name is specified
>     \override TextScript #'padding = #5
>     R1^"wrong"
>     % This is the correct object name to be specified
>     \override MultiMeasureRestText #'padding = #5
>     R1^"right"

When a multi-measure rest immediately follows a `\partial` setting, resulting bar-check warnings may not be displayed.

#### Predefined commands

`\textLengthOn`, `\textLengthOff`, `\fermataMarkup`, `\compressFullBarRests`, `\expandFullBarRests`.

#### Selected Snippets

Changing form of multi-measure rests

If there are ten or fewer measures of rests, a series of longa and breve rests (called in German “Kirchenpausen” - church rests) is printed within the staff; otherwise a simple line is shown. This default number of ten may be changed by overriding the `expand-limit` property.

>     \relative c'' {
>       \compressFullBarRests
>       R1*2 | R1*5 | R1*9
>       \override MultiMeasureRest #'expand-limit = #3
>       R1*2 | R1*5 | R1*9
>     }

Positioning multi-measure rests

Unlike ordinary rests, there is no predefined command to change the staff position of a multi-measure rest symbol of either form by attaching it to a note. However, in polyphonic music multi-measure rests in odd-numbered and even-numbered voices are vertically separated. The positioning of multi-measure rests can be controlled as follows:

>     \relative c'' {
>       % MMR - Multi-Measure Rest
>       % MMRs by default are set under the fourth line
>       R1
>       % They can be moved with an override
>       \override MultiMeasureRest #'staff-position = #-2
>       R1
>       % A value of 0 is the default position;
>       % the following trick moves the rest to the center line
>       \override MultiMeasureRest #'staff-position = #-0.01
>       R1
>       % MMRs in odd-numbered voices are under the top line
>       << { R1 } \\ { a1 } >>
>       % MMRs in even-numbered voices are under the bottom line
>       << { c1 } \\ { R1 } >>
>       % They remain separated even in empty measures
>       << { R1 } \\ { R1 } >>
>       % This brings them together even though there are two voices
>       \compressFullBarRests
>       <<
>         \revert MultiMeasureRest #'staff-position
>         { R1*3 }
>         \\
>         \revert MultiMeasureRest #'staff-position
>         { R1*3 }
>       >>
>     }

Multi-measure rest markup

Markups attached to a multi-measure rest will be centered above or below it. Long markups attached to multi-measure rests do not cause the measure to expand. To expand a multi-measure rest to fit the markup, use a spacer rest with an attached markup before the multi-measure rest.

Note that the spacer rest causes a bar line to be inserted. Text attached to a spacer rest in this way is left-aligned to the position where the note would be placed in the measure, but if the measure length is determined by the length of the text, the text will appear to be centered.

>     \relative c' {
>       \compressFullBarRests
>       \textLengthOn
>       s1*0^\markup { [MAJOR GENERAL] }
>       R1*19
>       s1*0_\markup { \italic { Cue: ... it is yours } }
>       s1*0^\markup { A }
>       R1*30^\markup { [MABEL] }
>       \textLengthOff
>       c4^\markup { CHORUS } d f c
>     }

#### See also

Music Glossary: multi-measure rest.

Notation Reference: Durations, Text, Formatting text, Text scripts.

Snippets: Rhythms.

Internals Reference: MultiMeasureRest, MultiMeasureRestNumber, MultiMeasureRestText.

#### Known issues and warnings

Fingerings over multi-measure rests (e.g. `R1*10-4`) may result in the fingering numeral colliding with the bar counter numeral.

There is no way to automatically condense multiple ordinary rests into a single multi-measure rest.

Multi-measure rests do not take part in rest collisions.

Other languages: deutsch, español, français, 日本語.

#### LilyPond — Notation Reference