Hi Urs,
How about:
\version "2.20.0"
ext =
#(define-music-function (long) (number?)
#{
\once\override NoteHead.stencil =
#(lambda (grob)
(grob-interpret-markup grob
(markup #:concat
(#:musicglyph "noteheads.s2" #:hspace -0.85
(#:override (cons (quote filled) #t)
(#:path 0
`((moveto 0 .543)
(rlineto ,long 0)
(rlineto -.4 -1.086)
(rlineto ,(* long -1) 0)
(closepath))))
#:hspace -0.85 #:musicglyph "noteheads.s2" ))))
#})
%% Test:
\layout {
\context {
\Voice
\omit Stem
}
}
\fixed c' {
\ext #5 ais4 \ext #4 4 \ext #2 4 \ext #2 4
}
HTH, cheers,
Pierre