\version "2.23.1" #(define-macro (prepend! thing lst) `(set! ,lst (cons ,thing ,lst))) addStaccato = #(define-music-function (music) (ly:music?) (map-some-music (lambda (m) (if (music-is-of-type? m 'note-event) (prepend! (make-music 'ArticulationEvent 'articulation-type "staccato") (ly:music-property m 'articulations))) #f) music)) \addStaccato { c'4 d' e'8 f' g' a' }