lilypond-user
[Top][All Lists]
Advanced

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

Re: is shapeSlur broken?


From: Urs Liska
Subject: Re: is shapeSlur broken?
Date: Fri, 27 Apr 2012 18:46:04 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Hi David,

thank you for now. I'll look into it.
But isn't it very likely that I have to reshape a slur anyway when it changes from  broken to unbroken?
In that case I'd even say the errors are a 'feature' so you notice it ...
Provided it is documented enough not to drive you crazy ...

Best
Urs

Am 27.04.2012 15:22, schrieb David Nalesnik:
Hi Urs,

On Fri, Apr 27, 2012 at 6:51 AM, David Nalesnik <address@hidden> wrote:
Hi Urs,

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.

I noticed that you'll produce an error if you apply a list of lists to a slur which isn't broken (i.e., if a layout change results in a once-broken slur appearing on a single line).  Here is a fix for that:

 #(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)
         (if (list? (car offsets))
             ((alter-curve (car offsets)) grob)
             ((alter-curve offsets) grob)))))


reply via email to

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