Rehearsal marks

To print a rehearsal mark, use the \mark command.

\relative c'' {
  c1 \mark \default
  c1 \mark \default
  c1 \mark \default
  c1 \mark \default
}

[image of music]

The mark is incremented automatically if you use \mark \default, but you can also use an integer argument to set the mark manually. The value to use is stored in the property rehearsalMark.

\relative c'' {
  c1 \mark \default
  c1 \mark \default
  c1 \mark 8
  c1 \mark \default
  c1 \mark \default
}

[image of music]

The letter ‘I’ is skipped in accordance with engraving traditions. If you wish to include the letter ‘I’, then use one of the following commands, depending on which style of rehearsal mark you want (letters only, letters in a hollow box, or letters in a hollow circle).

\set Score.rehearsalMarkFormatter = #format-mark-alphabet
\set Score.rehearsalMarkFormatter = #format-mark-box-alphabet
\set Score.rehearsalMarkFormatter = #format-mark-circle-alphabet
\relative c'' {
  \set Score.rehearsalMarkFormatter = #format-mark-box-alphabet
  c1 \mark \default
  c1 \mark \default
  c1 \mark 8
  c1 \mark \default
  c1 \mark \default
}

[image of music]

The style is defined by the property rehearsalMarkFormatter. It is a function taking the current mark (an integer) and the current context as argument. It should return a markup object. In the following example, rehearsalMarkFormatter is set to a predefined procedure. After a few measures, it is set to a procedure that produces a boxed number.

\relative c'' {
  \set Score.rehearsalMarkFormatter = #format-mark-numbers
  c1 \mark \default
  c1 \mark \default
  \set Score.rehearsalMarkFormatter = #format-mark-box-numbers
  c1 \mark \default
  \set Score.rehearsalMarkFormatter = #format-mark-circle-numbers
  c1 \mark \default
  \set Score.rehearsalMarkFormatter = #format-mark-circle-letters
  c1
}

[image of music]

The file scm/translation-functions.scm contains the definitions of format-mark-letters (the default format), format-mark-box-letters, format-mark-numbers, and format-mark-box-numbers. These can be used as inspiration for other formatting functions.

You may use format-mark-barnumbers, format-mark-box-barnumbers, and format-mark-circle-barnumbers to get bar numbers instead of incremented numbers or letters.

For common tweaks to the positioning of rehearsal marks, see section Formatting text. For more precise control, consider break-alignable-interface (see section Aligning objects).

The file scm/translation-functions.scm contains the definitions of format-mark-numbers and format-mark-letters. They can be used as inspiration for other formatting functions.

Selected Snippets

Printing marks on every staff

Although rehearsal and text marks are normally only printed above the topmost staff, they may also be printed on every staff.

\score {
  <<
    \new Staff { \mark \default c''1 \textMark "molto" c'' }
    \new Staff { \mark \default c'1 \textMark "molto" c' }
  >>
  \layout {
    \context {
      \Score
      \remove Mark_engraver
      \remove Text_mark_engraver
      \remove Staff_collecting_engraver
    }
    \context {
      \Staff
      \consists Mark_engraver
      \consists Text_mark_engraver
      \consists Staff_collecting_engraver
    }
  }
}

[image of music]

See also

Notation Reference: The Emmentaler font, Formatting text, Aligning objects, Music notation inside markup, Metronome marks, Section labels.

Installed Files: scm/translation-functions.scm.

Snippets: Rhythms.

Internals Reference: AdHocMarkEvent, RehearsalMark, RehearsalMarkEvent.


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