Segno or coda on top of rehearsal mark

Revision as of 09:29, 29 November 2025 by Lemzwerg (talk | contribs) (Some rewording and cleanups; revised categories)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Starting with LilyPond 2.24 the \textMark command and the normal \mark command happily coexist.

Furthermore the sophisticated \repeat segno command is available, see here. (Be sure to look at the English version, since translations of the Notation Reference might not be up to date.)

Consequently, this snippet is much shorter in comparison to previous versions in the LSR.

\version "2.24"

markDefault = \mark \default

markDefaultSegno = {
  \textMark \markup \musicglyph "scripts.segno"
  \mark \default
}

markDefaultCoda = {
  \textMark \markup \musicglyph "scripts.coda"
  \mark \default
}

\score {
  \relative c' {
    c4 d e f
    \markDefault
    g a b c
    \markDefaultSegno
    c b a g
    \markDefault
    f e d c
    \markDefaultCoda
    c d e f
    \markDefault
    \bar "|."
  }
  \layout {
    indent = 0\cm
    \context {
      \Score
      rehearsalMarkFormatter = #format-mark-box-letters
      \override TextMark.self-alignment-X = #CENTER
      \override TextMark.outside-staff-priority = 1600
    }
  }
}