That function seems rather destructive: removes all properties on existing 
articulations (including tweaks, direction, and midi stuff), and doesn't seem 
to handle anything other than ArticulationEvents at all. Dynamics, slurs, ties, 
etc are removed. Also, this version has no way to exclude a note from being 
articulated, unlike the earlier versions (where you can set 'articulations to 
an empty list to exclude it).

On 12/28/17 19:33, David Nalesnik wrote:
> Replying to the list with removal of some redundant code:
> 
> \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'-! }
> }
> 
> HTH,
> David
> 
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to