On 2019-01-21 6:04 am, Gianmaria Lari wrote:
Using your old code to draw a circle around finger number on the left
of
the note today I found a problem. When I use "\omit Fingering" the
compilation report me the error:
programming error: Infinity or NaN encountered
\omit Fingering <g'
-2 c''-\cFS-4>
Here it is a simple code showing the problem:
[ . . . ]
This is all you need to trigger the error:
%%%%
\version "2.19.82"
{ \set fingeringOrientations = #'(left)
\omit Fingering
<g'-2 c''-4> }
%%%%
Not \setting fingeringOrientations or not \omitting Fingering results in
a clean compile. Also changing \omit to \hide works, although then
there is extra space.
\omit * is basically \override *.stencil = ##f whereas \hide * is
\override *.transparent = ##t.
My guess is the code that handles fingeringOrientations expects the
stencil to be valid and is balking at the false value. Looking at the
code, I see the programming_error comes from grob.cc:318 which is within
Grob::translate_axis. The problem is that translate_axis gets called
from so many different places. Without a stack trace, this will be
harder to track down.
This variation works:
%%%%
\version "2.19.82"
{ \set fingeringOrientations = #'(left)
\override Fingering.stencil = #(lambda (grob)
(ly:make-stencil '() '(0 . 0) '(0 . 0)))
<g'-2 c''-4> }
%%%%
Here we have a valid, albeit empty, stencil. This bypasses the
programming error.
----
Ignoring the programming error, there is another issue with how \omit *
behaves. Consider the following:
%%%%
\version "2.19.82"
circledFingerStil = #(lambda (grob)
(circle-stencil (ly:text-interface::print grob) 0.1 0.1))
cFS = \tweak stencil \circledFingerStil \etc
{ \omit Fingering
<g'-2 c''-\cFS-4> }
%%%%
Using \omit Fingering is supposed to eliminate Fingering grobs until it
is \undone. The problem is that \tweak also modifies the stencil,
cancelling out the effect of the \omit.
-- Aaron Hill
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user