John Hetland's scores on CPDL have custodes that look like this:

LilyPond supports custodes in several styles, but

  1. None of them are shaped like a half circle (or half notehead).

  2. They are placed after the bar line, like cautionary key and time signatures, instead of flush with it.

  3. If they are off the staff, no (half-)ledger line is printed (issue 6055).

Is there a way to work around any or all of those differences to make custodes in LilyPond more like Hetland's?

1 Answer 1


Here's my solution, which I adapted from Aaron Hill's workaround for the ledger-line issue. His custom engraver adds invisible notes at the location of the custodes. I make the note visible with a custom stencil, replacing the "real" custodes which are only used for positioning.

Hetland_custos_engraver =
     ((custos-interface engraver custos source)
       (let ((nh (ly:engraver-make-grob engraver 'NoteHead custos)))
         (ly:grob-set-parent! nh X custos)
         (ly:grob-set-parent! nh Y custos)
         (ly:grob-set-property! nh 'non-musical #t)
         (ly:grob-set-property! nh 'break-visibility end-of-line-visible)
         (ly:grob-set-property! nh 'stencil
           (grob-interpret-markup nh #{ \markup
             \with-dimension #X #'(-0.8 . -0.3)
             \override #'(filled . #t)
             \path #0 #'((M 0 -0.5) (C -0.8 -0.55 -0.8 0.55 0 0.5)) #} ))))))

\layout {
  \context {
    \consists Custos_engraver
    \consists \Hetland_custos_engraver
    \omit Custos

{ s1*4 s2. e'8 d'8 \break <c'c''>1 }

It's possible to make the standard custodes appear before the bar line by moving custos before staff-bar in BreakAlignment.break-align-orders (see this answer). That plus a custom stencil for Custos might solve the problem without a custom engraver if the ledger-line issue gets fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.