One could wrap this into a music function - as long as it's ok to only handle single notes (NoteEvent, monophonic) or entire chords (ChordEvent), <e d> e.g.:

%%% SNIPPET

\version "2.24"

hideFromAmbitus =
#(define-music-function
     (note)
     (ly:music?)
   #{
     \override NoteHead.ignore-ambitus = ##t
     #note
       \revert NoteHead.ignore-ambitus
   #})

\layout {
  \context {
    \Staff
    \remove Ambitus_engraver
  }
  \context {
    \Voice
    \consists Ambitus_engraver
  }
}

\score {
  \new Staff {
    \new Voice {
      \relative c' {
        c e g
        \hideFromAmbitus { c d }
        a
        \hideFromAmbitus <c,, f> g''
      }
    }
  }
}
%%% SNIPPET


Am 28.12.2025 um 22:29 schrieb Timothy Lanfear:
\version "2.24.0"

\layout {
  \context {
    \Voice
    \consists "Ambitus_engraver"
  }
}

{
  c'4 d' e' f'
  \override NoteHead.ignore-ambitus = ##t
  c''4 d'' e'' f''
  \revert NoteHead.ignore-ambitus
  g4 a b c'
  \once \override NoteHead.ignore-ambitus = ##t g'' g' a' b'
}



Reply via email to