I don't know if I've gotten at the name of the articulation in the best way, but this works. One drawback is that there can only be one override of 'after-line-breaking at a time.
'before-line-breaking works too (see code below).
Aha -- good to know!
[ . . . ] I'd prefer to store several properties in an alist, but I couldn't figure out how to read-out and call.
p.e.:
#(define ls '(
("staccato" . ((color . (1 0 0))))
("accent" . ((font-size . 4)(color . (1 0 0))))
("tenuto" . ((rotation . (45 0 0))))
("staccatissimo" . ((padding . -10) (color . (1 0 0))))
))
Any idea?
You could change the function to map ly:grob-set-property! onto the alist if a match is found:
\version "2.14.2"
#(define ls '(
("staccato" . ((color . (0 1 0))))
("accent" . ((font-size . 4)(color . (1 0 0))))
("tenuto" . ((rotation . (45 0 0)) (padding . 2)))
("staccatissimo" . ((padding . -10) (color . (0 0 1))))
))
#(define ((custom-script-tweaks type) grob)
(map
(lambda (arg)
(let ((lst (assoc-ref ls arg)))
(if (equal? arg (ly:prob-property (assoc-ref (ly:grob-properties grob) 'cause) 'articulation-type))
(for-each (lambda (x) (ly:grob-set-property! grob (car x) (cdr x))) lst)
'())))
type))
\relative c'' {
f1--
f1--
\override Script #'before-line-breaking =
#(custom-script-tweaks '("staccato" "tenuto" "accent" "staccatissimo"))
f-. f-| f-> f-> f-- f-|
\revert Script #'before-line-breaking
f-> f-.
}
-David