#(define mydrums '((bassdrum () #f -5) (snare () #f 0) (lowtom cross #f -2) (hihat () #f 3))) #(define parallelogram (ly:make-stencil (list 'embedded-ps "gsave currentpoint translate newpath 0 0.25 moveto 1.3125 0.75 lineto 1.3125 -0.25 lineto 0 -0.75 lineto closepath fill grestore" ) (cons 0 1.3125) (cons 0 0))) #(define (make-drum-note dt dur st) (make-music 'SequentialMusic 'elements (list (make-music 'ContextSpeccedMusic 'context-type 'Bottom 'element (make-music 'OverrideProperty 'pop-first #t 'grob-property-path (list (quote stencil)) 'grob-value st 'once #t 'symbol 'NoteHead)) (make-music 'EventChord 'elements (list (make-music 'NoteEvent 'drum-type dt 'duration dur)))))) #(define (custom-notehead mus) (if (eq? (ly:music-property mus 'name) 'EventChord) (let* ((e (car (ly:music-property mus 'elements))) (dur (ly:music-property e 'duration)) (dt (ly:music-property e 'drum-type))) (case dt ((bassdrum) (set! mus (make-drum-note dt dur parallelogram))) ((hihat) (set! mus (make-drum-note dt dur parallelogram)))))) mus) customHeads = #(define-music-function (parser location music) (ly:music?) (music-map (lambda (x) (custom-notehead x)) music)) << \new DrumStaff \with { drumStyleTable = #(alist->hash-table mydrums) } \new DrumVoice \drummode { \customHeads { bd8 sn toml hh } } >>