lilypond-user
[Top][All Lists]
Advanced

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

Re: is shapeSlur broken?


From: David Nalesnik
Subject: Re: is shapeSlur broken?
Date: Fri, 27 Apr 2012 06:51:11 -0500

Hi Urs,

On Fri, Apr 27, 2012 at 4:23 AM, Urs Liska <address@hidden> wrote:
Hello Jan-Peter,

thank you very much.
This seems to solve the problem. Maybe it's not perfectly robust, though.
The function now works when the number of lists exactly matches the number of slur fragments. I'm not sure if this has been the case earlier or if it had been a little bit more 'generous'.
For the project at hand I can live with that anyway.


I've rewritten shape-slur so that you should be able to use lists of offsets which don't match with the number of slur fragments.  I've tested it somewhat, but if you run into a problem, let me know.  Here's the relevant part:

 #(define ((shape-slur offsets) grob)
   (let* (
          ;; have we been split?
          (orig (ly:grob-original grob))
          ;; if yes, get the split pieces (our siblings)
          (siblings (if (ly:grob? orig)
                        (ly:spanner-broken-into orig) '() ))
          (total-found (length siblings)))

     (define (helper sibs offs)
       (if (and (eq? (car sibs) grob)
                (pair? offs))
           ((alter-curve (car offs)) grob)
           (if (pair? offs)
               (helper (cdr sibs) (cdr offs))
               ((alter-curve '()) grob))))

     (if (>= total-found 2)
         (helper siblings offsets)
         ((alter-curve offsets) grob))))

Hope this helps!
David

reply via email to

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