Aligning text marks to notes

Revision as of 05:09, 24 December 2025 by Lemzwerg (talk | contribs) (Add 'snippet' category; indent=0 is the default; minor extensions)

By default, TextMark objects are aligned to so-called NonMusicalPaperColumn grobs, like the left edge of the staff or a bar line. They can be aligned to a note instead by setting the non-musical property to #f.

\version "2.24"

\layout {
  line-length = 80\mm
}

{
  \textMark "mark a" c'1 |
  \textMark "mark b" c'1 |
  \break
  \override Score.TextMark.non-musical = ##f
  \textMark "mark c" c'1 |
  \textMark "mark d" c'1 |
}