[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problems with routine to adjust inner points of slur
From: |
Neil Puttock |
Subject: |
Re: problems with routine to adjust inner points of slur |
Date: |
Tue, 20 Oct 2009 21:55:24 +0100 |
2009/10/17 David Nalesnik <address@hidden>:
> Can you tell me why this is happening, and what I can do to fix it? (Also,
> please let me know if there's a more elegant way to structure this...I'm
> sure that's part of the problem!)
You're setting a parser variable (internal-offset) in the music to two
different values, but this process happens before the slurs exist; by
the time they're getting the result of the 'control-points callback,
the value of internal-offset is its last setting (5).
Pass the input value directly to the callback instead:
expandSlur =
#(define-music-function (parser location input) (number?)
#{
\once \override Slur #'control-points = #(more-curve $input)
#}
)
Use currying (or partial application) for the callback:
#(define ((more-curve internal-offset) grob)
(define first-pair (car coords))
If you change let to let*, you won't need to use define.
(define second-pair (car (cdr coords)))
(define third-pair (car (cdr (cdr coords))))
(define fourth-pair (car (cdr (cdr (cdr coords)))))
You could replace these with cadr, caddr and cadddr respectively.
Regards,
Neil
expand-slur.ly
Description: Text Data