|
From: | Nick Payne |
Subject: | Re: Systematically Shortening Slurs |
Date: | Sun, 23 Oct 2011 07:32:20 +1100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 |
On 23/10/11 07:07, J Ruiz wrote:
Can't remember where I got this function from, but it does what you want. \version "2.15.14" shapeSlur = #(define-music-function (parser location offsets) (list?) #{ \override Slur #'control-points = #(alter-slur-curve $offsets) #}) #(define ((alter-slur-curve offsets) grob) ;; get default control-points (let ((coords (ly:slur::calc-control-points grob)) (n 0)) ;; add offsets to default coordinates (define loop (lambda (n) (set-car! (list-ref coords n) (+ (list-ref offsets (* 2 n)) (car (list-ref coords n)))) (set-cdr! (list-ref coords n) (+ (list-ref offsets (1+ (* 2 n))) (cdr (list-ref coords n)))) (if (< n 3) (loop (1+ n))))) ;; return altered coordinates (loop n) coords)) \relative c'' { c4( d)( e)( f) \shapeSlur #'(0.2 0 0 0 0 0 0 -0.2) c( d)( e)( f) \revert Slur #'control-points c( d)( e)( f) } |
shapeslur.png
Description: PNG image
[Prev in Thread] | Current Thread | [Next in Thread] |