2016-03-10 17:14 GMT+01:00 tisimst <tisimst.lilyp...@gmail.com>: > > On Thu, Mar 10, 2016 at 9:04 AM, Malte Meyn-3 [via Lilypond] <[hidden > email]> wrote: >> >> >> >> Am 10.03.2016 um 16:56 schrieb tisimst: >> > Submitted to LSR: http://lsr.di.unimi.it/LSR/Item?id=1028 >> > >> >> The header of the third score isn’t correct: Thickness goes from 1.2 to >> 2.7, not 1.4 to 2.7. > > > (facepalm) Thanks. Corrected. > > - Abraham
Hi Abraham, I had a look. Pretty nice one, some nitpicks, though. How about: #(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)) ;; dx/dy is clearer I think (dx (- (car cp3) (car cp0))) (dy (- (cdr cp3) (cdr cp0))) ;; avoids Pythagoras (len (magnitude (make-rectangular dx dy))) ;; avoids nested if (thickness (cond ((< len min-l) min-t) ((> len max-l) max-t) (else (+ min-t (* (- len min-l) (/ (- max-t min-t) (- max-l min-l)))))))) (ly:grob-set-property! grob 'thickness thickness)))) Cheers, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user