Hi,
I'm trying to understand a problem I'm seeing.
I have this engraver that acknowledges stems and fingerings,
this is meant to work with a before-line-breaking callback that repositions
the fingerings.
So I thought that I could just sit there, listen for the fingerings as they
got to me,
and put them into a list attached to the stem.
Except that I only ever get only the fingering for the last note in a chord,
and no evidence of the others.
The display statements below print this:
fl () - fingering (#<Grob Fingering >)4
fl () - fingering (#<Grob Fingering >)2
I don't understand why the fl list stays empty and what happens to all the
other fingerings.
Any help/pointers appreciated,
Luca
#(define (Guitar_fingering_engraver context)
(let ((stem #f)
(fingering #f)
(fl '())
(old-fingering '()))
(make-engraver
(acknowledgers
((finger-interface engraver grob source-engraver)
(begin
(set! fingering grob)
(append! fl (list grob))
)
)
((stem-interface engraver grob source-engraver)
(set! stem grob)))
((process-music engraver)
(if (and fingering stem)
(begin
(set! old-fingering (assoc-get 'fingering (ly:grob-property
stem 'details) '()))
(ly:grob-set-property! stem 'details
`((fingering . ,(append old-fingering
(list fingering)))
. ,(ly:grob-property stem 'details))))
)
(if stem
(begin
(display "fl ") (display fl) (display " - fingering ")
(display (assoc-get 'fingering (ly:grob-property stem
'details)))
(if fingering
(display (ly:grob-property fingering 'text))
)
(display "\n")))
(set! stem #f)
(set! fingering #f)
(set! fl '())))))
\layout {
\context {
\Voice
% this makes use of the New_fingering_engraver, which attaches
fingering in the way we want
\remove Fingering_engraver
\consists #Guitar_fingering_engraver
}
}
guitar = {
\key c \major
\time 2/4
\clef "violin_8"
<g-1 b-2 e'-4>4
<ges-1 bis-2 e'-4>4
}
\score {
\new Staff = "guitar" {
\key c \major
\time 2/4
\clef "violin_8"
<g-1 b-2 e'-4>4
<ges-1 e'-4 bis-2>4
}
\layout { }
}
--
Luca Fascione