lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

add tenuto


From: Stefan Thomas
Subject: add tenuto
Date: Sun, 1 Jun 2008 22:00:15 +0200

Dear Lilypondusers,
I modified (which was very easy) the addStaccato function to addTenuto, which also works very fine. But I have one question:
Could it be possible to exclude those notes, that follows the one with the tie?
I think, this could be also interesting (even a bit more) for the addStaccato function, because tied notes are normally not to be played staccato, i guess.
Here a lilttle example:

#(define (addTenutoFilterFunction event)
 (let ( (eventname (ly:music-property  event 'name)) )
  (if (eq? eventname 'EventChord)
    (let ( (elements (ly:music-property event 'elements)) )
      ; don't add staccato to rests!
      (if (not (eq? (ly:music-property (car elements) 'name) 'RestEvent))
        (set! (ly:music-property event 'elements)
          (append elements (list (make-music 'ArticulationEvent 'articulation-type "tenuto"))
          ))))))
)

addTenuto = #(define-music-function (parser location music) (ly:music?)
 (music-filter addTenutoFilterFunction music)
)

\new Staff \relative { \addTenuto { c d e f~ f e d c } }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]