[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Remove all occurrencies of "0" fingerings
From: |
David Kastrup |
Subject: |
Re: Remove all occurrencies of "0" fingerings |
Date: |
Tue, 08 Aug 2017 12:47:41 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Marc Hohl <address@hidden> writes:
> I wanted to write a little callback to remove all occurrencies
> of "0" fingerings. This is what I got so far:
>
>
> \version "2.19.63"
>
> music = {
> c'4-3 d'-0 e'-2 f'-3 | g'1-0
> }
>
> \score {
> \new Staff \with {
> \override Fingering.stencil =
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> #(lambda (grob)
[...]
> (ly:grob-property grob 'stencil))))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Compiling this nearly MWE, I get:
>
> Warning: Fingering has empty extent and non-empty stencil.
> Warning: Fingering has empty extent and non-empty stencil.
>
> And *no* fingering at all is shown in the resulting score.
> What am I doing wrong?
Recursion: see Recursion.
You can do this by using
\version "2.19.63"
music = {
c'4-3 d'-0 e'-2 f'-3 | g'1-0
}
\score {
\new Staff \with {
\override Fingering.text =
#(grob-transformer 'text
(lambda (grob default)
(if (string= "0" default)
""
default)))
{ \music }
}
assuming that text is indeed just a string. The warning actually still
occurs. However, that is a rather glaring bug (the stencil _is_ empty
and the respective code checks for _existence_ of a stencil (which is
guaranteed at that code point) rather than its non-emptiness). I'll be
providing a patch presently.
--
David Kastrup
Re: Remove all occurrencies of "0" fingerings,
David Kastrup <=
Re: Remove all occurrencies of "0" fingerings, Marc Hohl, 2017/08/08