lilypond-user
[Top][All Lists]
Advanced

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

Re: fingering


From: Gianmaria Lari
Subject: Re: fingering
Date: Fri, 23 Feb 2018 08:43:40 +0100


On 23 February 2018 at 00:53, Thomas Morley <address@hidden> wrote:
2018-02-22 11:03 GMT+01:00 Thomas Morley <address@hidden>:
> 2018-02-22 10:58 GMT+01:00 Gianmaria Lari <address@hidden>:
>> Dear Harm,
>>
>> thank you for your really nice help. Your fix worked well and now your
>> example is perfect!
>>
>> I hope others will take advantage of it.
>>
>> I copy here the final working code with a screenshot.
>
> Glad you like it :)
>
> This morning I observed a certain weakness in the code, a missing
> safety net to be more precise.
> I'll have a deeper look this evening. Now I have to run for my regular job ...
>
> Cheers,
>   Harm

Likely safer to check whether a stencil is present before trying to
change it. At least it calms down my paranoia ...

adjustFC =
  \override Staff.FingeringColumn.before-line-breaking =
    #(lambda (grob)
       "Sets @code{snap-radius} of @code{FingeringColumn} to @code{3} and
        applies @code{centered-stencil} to every fingering-stencil"
       (let*  ((fingerings (ly:grob-object grob 'fingerings))
               (fingering-ls
                 (if (ly:grob-array? fingerings)
                     (ly:grob-array->list fingerings)
                     '())))
         (ly:grob-set-property! grob 'snap-radius 3)
         (for-each
           (lambda (f)
             (let ((f-stil (ly:grob-property f 'stencil)))
               (if (ly:stencil? f-stil)
                   (ly:grob-set-property! f 'stencil
                     (centered-stencil f-stil)))))
           fingering-ls)))

Cheers,
  Harm

Ciao Harm,

tried your new safer code: it works perfectly like the previous :)
I update my snippet database :))

Thanks a lot, Gianmaria

reply via email to

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