lilypond-user
[Top][All Lists]
Advanced

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

Re: Tie settings question


From: David Nalesnik
Subject: Re: Tie settings question
Date: Sat, 22 Oct 2016 19:19:27 -0500

On Sat, Oct 22, 2016 at 7:11 PM, David Nalesnik
<address@hidden> wrote:
> On Sat, Oct 22, 2016 at 6:55 PM, Karol Majewski <address@hidden> wrote:
>> Hi David, when a chord doesn't have a flag, then your code doesn't work. 
>> Just replace
>>
>> <c e g c e>8~
>>
>> with
>>
>> <c e g c e>4~
>>
>> and it won't compile. Perhaps there should be a condition in your code: "if 
>> a note has a a flag then set Flag.Y-extent to (4 . 0)". Or maybe there is a 
>> better way to fix this?
>
>
> Sure, expand the condition, like so:
>
> (if (and (> (length ties) 1) (ly:grob? flag))
>


It just dawned on me that you'd like the routine to still do something
if there is no flag, so try this:

evenTies =
#(lambda (grob)
   (let* ((ties (ly:grob-array->list (ly:grob-object grob 'ties)))
          (notehead (ly:spanner-bound (car ties) LEFT))
          (stem (ly:grob-object notehead 'stem))
          (flag (ly:grob-object stem 'flag)))
     (if (> (length ties) 1)
         (begin
          (if (ly:grob? flag)
              (ly:grob-set-property! flag 'Y-extent (cons 4 0)))
          (for-each
           (lambda (tie)
             (ly:grob-set-nested-property! tie '(details skyline-padding) 5))
           ties)))))

-DN



reply via email to

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