|
From: | Gianmaria Lari |
Subject: | Re: fingering |
Date: | Mon, 21 Jan 2019 15:04:15 +0100 |
On 23 February 2018 at 00:53, Thomas Morley <address@hidden> wrote:Likely safer to check whether a stencil is present before trying to2018-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
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
programming error: Infinity or NaN encountered
\omit Fingering <g'
-2 c''-\cFS-4>
Do you know how to fix it?\version "2.19.82"%% returns a stencil (created by `ly:text-interface::print') within a circlecircledFingerStil =#(lambda (grob)(circle-stencil (ly:text-interface::print grob) 0.1 0.1))%% tweak-short-cutcFS =\tweak stencil \circledFingerStil\etcadjustFC =\override Staff.FingeringColumn.before-line-breaking =#(lambda (grob)"Sets @code{snap-radius} of @code{FingeringColumn} to @code{3} andapplies @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)))\score{{ \set fingeringOrientations = #'(left) \adjustFC\omit Fingering <g'-2 c''-\cFS-4>\undo \omit Fingering}\layout {}}
[Prev in Thread] | Current Thread | [Next in Thread] |