> On Apr 26, 2015, at 11:16 AM, Paul Morris <p...@paulwmorris.com> wrote:
> 
> In short, “listeners” respond to particular stream events:
> http://lilypond.org/doc/v2.18/Documentation/internals/music-classes
> while “acknowledgers” respond to particular grobs that have been “announced” 
> by other engravers (that created the grobs based on the stream events that 
> they “listened” to).  This process of acknowledging grobs happens through 
> grob interfaces:
> http://lilypond.org/doc/v2.18/Documentation/internals/graphical-object-interfaces

Something else I thought I’d add to this thread.  You can access the stream 
event that is the cause of a grob using "(event-cause grob)".  So in many cases 
that can be used instead of listeners.  An example is below.

Cheers,
-Paul

\version "2.18.2"

#(define Some_custom_engraver
   (make-engraver
    (acknowledgers
     ((key-signature-interface engraver grob source-engraver)
      (display grob) (newline)
      (display (event-cause grob)) (newline)
      ;; do something with key-signature grobs
      )
     ((note-head-interface engraver grob source-engraver)
      (display grob)(newline)
      (display (event-cause grob)) (newline)
      ;; do something with note-head grobs
      ))))

\new Staff \with {
  \consists \Some_custom_engraver
}{
  \key c \major
  c'1
}


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to