What is the best way to add special text, signs, symbols, and marks for multi-measure rests, rehearsal marks, segno, and coda symbols, in LilyPond code?
1 Answer
For compressed multi-measure rests, use \compressMMRests { ... }
.
However, the default is set to use multiple (archaic) rest symbols for rests that are 10 measures or less. To get a small number of rest to compress (like in your image), you will need an override:
\override MultiMeasureRest.expand-limit = #1
\compressMMRests {R1*4}
see: https://lilypond.org/doc/v2.24/Documentation/notation/writing-parts#compressing-empty-measures
To write rehearsal marks, just use \mark\default
, but to get letters in boxes you will need to set the rehearsal mark format:
\set Score.rehearsalMarkFormatter = #format-mark-box-letters
\mark\default
see: http://lilypond.org/doc/v2.24/Documentation/notation/bars.en.html#rehearsal-marks
The segno and coda (symbols) can simply be entered with \segno
and \coda
.
And to get "D.S. al coda", "To Coda", etc. you can enter them as markups: ...^\markup {\bold "D.S. al Coda"}
.
But in the new versions of LilyPond (v2.23 and later) there is a way to encode these long repeat structures so that the symbols appear automatically:
s1 |
\repeat segno 2 {
s1 |
\alternative {
\volta 1 {
s1 |
}
}
}
\section \sectionLabel "Coda"
s1 |
\bar "|."
see: https://lilypond.org/doc/v2.24/Documentation/notation/long-repeats#segno-repeat-structure