lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to catch post-events inside chords in an event listener?


From: Lukas-Fabian Moser
Subject: Re: How to catch post-events inside chords in an event listener?
Date: Sun, 6 Feb 2022 22:52:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

Hi Valentin,

Am 06.02.22 um 20:57 schrieb Valentin Petzel:
one could try something like this.

Yes, thanks, that's what did after David's explanations as well.

In my situation (where I'm using a custom event type not covered by any standard engravers), I can then dispose of the dedicated listener: This is essentially what happens for

\version "2.22"

#(define (test_engraver ctx)
    (make-engraver
     (listeners
;;; NOT NEEDED if Tie_engraver is removed
;      ((tie-event engraver event)
;       (format #t "Tie encountered at ~a.\n" (ly:context-current-moment ctx)))
      ((note-event engraver event)
       (for-each
        (lambda (art)
          (if (memq 'tie-event (ly:event-property art 'class))
              (format #t "Tie encountered at ~a.\n" (ly:context-current-moment ctx))))
        (ly:event-property event 'articulations))))))

\layout {
   \context {
     \Voice
     \consists #test_engraver
     \remove Tie_engraver
   }
}

{
   a4~
   <a~ g'>
   a~
   a
}

(I think it's safe to use memq instead of member.)

I'm just still confused as to the terminology of event "classes" vs. event "types" etc. But that's something for next week...

Lukas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]