On Sat, Oct 22, 2016 at 7:11 PM, David Nalesnik
<[email protected]> wrote:
> On Sat, Oct 22, 2016 at 6:55 PM, Karol Majewski <[email protected]> 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
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user