Hello everyone,

I was wondering, is there a way to, given a 'NoteEvent (or 'EventChord, or
whatever other music expression for that matter) find the grob or grobs
that it generates?

Although I don't know how Lilypond actually processes input, I suspect that
this isn't possible. I imagine that if a function is getting passed the
events then they have not been translated into grobs yet, and if they have
then I imagine that functions in the input have already been processed at
this point. But I don't really know, so I'd rather ask.

So, more concretely, say that in the following:

\relative c' {
  c d \something e f
}

Is it possible for `\something`, a music function that is receiving the
note e as its argument (of type `ly:music?`), to get to the grob generated
by that e and store a reference to it in a variable?

So, something among the lines of

something =
#(define-music-function (e-note) (ly:music?)
   (let ((e-notehead-grob (???magic-proc??? e-note)))
     (display e-notehead-grob)
     e-note))

I am curious as to whether this has a solution or not.

Thank you in advance!
Stéfano
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to