lilypond-user
[Top][All Lists]
Advanced

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

Re: Variable slur thickness


From: Sharon Rosner
Subject: Re: Variable slur thickness
Date: Thu, 10 Mar 2016 07:08:54 -0700 (MST)

> I was thinking about this just yesterday. Here's a reasonable solution:

Fantastic! I refactored the code to make it easier to change the parameters:


#(define (variable-slur-thickness min-l max-l min-t max-t) (lambda (grob)
  (let* ((cpt (ly:grob-property grob 'control-points))
         (cp0 (car cpt)) (cp3 (cadddr cpt))
         (x0 (car cp0)) (y0 (cdr cp0))
         (x1 (car cp3)) (y1 (cdr cp3))
         (len (sqrt (+ (expt (- x1 x0)  2) (expt (- y1 y0)  2))))
         (thickness
           (if (<= len max-l)
             (if (< len min-l)
                min-t
                (+ min-t
                  (* (- len min-l)
                    (/ (- max-t min-t) (- max-l min-l)))))
             max-t)))
         (ly:grob-set-property! grob 'thickness thickness)
  )
))

\layout {
  \override Slur.after-line-breaking = #(variable-slur-thickness 3 10 1.4
2.7)
}


> P.S. Some of the power users on this list filter inline images, so if you
> wouldn't mind making the image an attachment next time, I know they'll
> appreciate it. :-)

Thanks, will do!

Thanks,
Sharon



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Variable-slur-thickness-tp188374p188378.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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