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: David Kastrup
Subject: Re: How to catch post-events inside chords in an event listener?
Date: Sun, 06 Feb 2022 18:25:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lukas-Fabian Moser <lfm@gmx.de> writes:

> Folks,
>
> probably I'm being stupid:
>
> \version "2.22"
>
> #(define (test_engraver ctx)
>    (make-engraver
>     (listeners
>      ((tie-event engraver event)
>       (format #t "Tie encountered at ~a.\n" (ly:context-current-moment
> ctx))))))
>
> \layout {
>   \context {
>     \Voice
>     \consists #test_engraver
>   }
> }
>
> {
>   a4~
>   <a~ g'> % this one is not seen by the engraver
>   a~
>   a
> }
>
> What do I have to do to make my custom engraver also see post-events
> (here, a tie, but in my context it's a custom event type) used inside
> chords?

There is no such thing as an event inside chords.  Events are broadcast
specific to a timestep and have no association with individual notes.

You'll find the tie event in the 'articulations property of the a~ in
the chord.

Members of 'articulations are broadcast from non-chord notes
(from which they are then removed) iff there is a listener for them,
otherwise they just stay put on the broadcast notes.

Members of 'articulations from chord notes are never broadcast.  They
always stay on the notes.

-- 
David Kastrup



reply via email to

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