Would something like the following help?
Just for ease of use:
\version "2.19.82"
slash-over-note = #(lambda (grob)
(let* ((note (ly:note-head::print grob))
(x-extent (ly:stencil-extent note X))
(y-extent (ly:stencil-extent note Y))
(scaling (magstep (ly:grob-property grob 'font-size 0.0)))
(slash (ly:make-stencil (list 'draw-line 0.15 0 1.5 1.5 0) '(0
. 1.5) '(0 . 1.5)))
(transformed (ly:stencil-translate
(ly:stencil-scale (centered-stencil slash) scaling scaling)
(cons (interval-center x-extent) (interval-center y-extent))))
(combined (ly:stencil-add note transformed)))
(ly:make-stencil (ly:stencil-expr combined) x-extent y-extent)))
slashesOn = \override NoteHead.stencil = #slash-over-note
slashesOff = \revert NoteHead.stencil
withSlash = \once \slashesOn
rhythms = \drummode {
snare 4 \withSlash 8 8 2
\slashesOn 4 8 8 16 16 8 \slashesOff 4
}
\score {
\new DrumStaff \rhythms
}
Best
Lukas
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user