Using markup for a staff's instrumentName

Revision as of 22:43, 26 October 2025 by Jean Abou Samra (talk | contribs) (Import snippet from LSR)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The instrumentName property of a staff or a staff group can take arbitrary markup. For example, rather than writing “Percussion”, you can also print two sticks to indicate percussion.

This example also shows how to combine several text markup objects and properly shift them before overlaying them.

\version "2.24.0"

%% http://lsr.di.unimi.it/LSR/Item?id=515

\new Staff = "Percussion" <<
  %Use a markup as the instrumentName for the staff!
  \set Staff.instrumentName = \markup {
    \combine
      \translate #(cons -1.25 0) \combine
        \draw-circle #0.65 #0 ##t
        \override #'(thickness . 2.5) \draw-line #'(3 . -3)
      \translate #(cons 1.25 0) \combine
        \draw-circle #0.65 #0 ##t
        \override #'(thickness . 2.5) \draw-line #'(-3 . -3)
  }
  \new Voice \relative c' { c1 }
>>