Hi Luca,
Am 13.02.25 um 17:52 schrieb Luca Fascione:
for my fingering engraver I'd like to position the fingering mark
differently based on whether the note/chord has a flag or a beam (I
push it out in X a little when there is a flag)
So I thought I could use
(flag (ly:grob-object stem 'flag))
Where stem is a normal stem grob (I think `stem` itself is fine, because
for example this works: (duration-log (ly:grob-property stem
'duration-log)) )
I tried both ly:grob-object as well as ly:grob-property, but neither
gives me back much
My test is
(display (ly:grob? flag))
And this prints #f
What's the right way to do this?
I just need to be able to tell apart beam vs flag, I don't think I
need a more refined test
It's difficult to assess the situation without more detailed information.
Basically, the grob-object's you're referring to do exist. Maybe you are
checking for them too early?
\version "2.25.23"
{
\override Stem.after-line-breaking =
#(lambda (stem)
(let
((note-heads (ly:grob-object stem 'note-heads)))
(if (ly:grob-array? note-heads)
(format #t "Notes at stem: ~a\n"
(map (lambda (note-head)
(ly:event-property (ly:grob-property note-head
'cause)
'pitch))
(ly:grob-array->list note-heads)))))
(format #t "This stem's flag: ~a\n" (ly:grob-object stem 'flag))
(format #t "This stem's beam: ~a\n\n" (ly:grob-object stem 'beam)))
c'8 d' e' f' g' r r4
}
Lukas