lilypond-user
[Top][All Lists]
Advanced

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

Callback function and applying to all notes in chord


From: Nick Payne
Subject: Callback function and applying to all notes in chord
Date: Wed, 14 Mar 2012 07:40:44 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

I was trying to make a callback function to lengthen LV ties (thanks to David Nalesnik for his help). It works fine when applied to single notes, but on a chord, only one of the two ties is lengthened. Is this due to an error in the code below or some more deep-rooted problem. If I reverse the order of the notes in the chord, the long and short ties swap around:

\version "2.15.33"

#(define ((alter-lv-tie-curve offsets) grob)
   (let ((coords (ly:semi-tie::calc-control-points grob)))

     (define (add-offsets coords offsets)
       (if (null? coords)
       '()
       (cons
(cons (+ (caar coords) (car offsets))
      (+ (cdar coords) (cadr offsets)))
(add-offsets (cdr coords) (cddr offsets)))))

     (add-offsets coords offsets)))

\relative c'' {
   \override LaissezVibrerTie #'control-points = #(lambda (grob)
       (if (= UP (ly:grob-property grob 'direction))
       ((alter-lv-tie-curve '(0 0 0.75 0.7 2.25 0.7 3 0)) grob)
       ((alter-lv-tie-curve '(0 0 0.75 -0.7 2.25 -0.7 3 0)) grob)))
<c f,>1\laissezVibrer
<f, c'>\laissezVibrer
}

Nick

Attachment: lv.png
Description: PNG image


reply via email to

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