\version "2.19.65"
addArticulation =
#(define-music-function (scripts music) (list? ly:music?)
(define (add mus)
(let* ((art (ly:music-property mus 'articulations))
(types (map (lambda (a) (ly:music-property a 'articulation-type))
art))
(types (lset-union string=? types scripts)))
(ly:music-set-property!
mus 'articulations (map make-articulation types))))
(for-some-music
(lambda (mus)
(cond
((music-is-of-type? mus 'event-chord) (add mus))
((music-is-of-type? mus 'note-event) (add mus))
(else #f)))
music)
music)
{
\addArticulation #'("staccato" "accent") { c <c e g>-> d c'-! }
}
%%%%%%%%%%%
A+