Interesting, as it is something that I am also trying to solve. My current approach is to match the start of the voice itself and the end of any notes from existing voices at that moment. Not entirely implemented yet though...
cheers Maurits > Op 8 jul. 2020, om 19:20 heeft Thomas Morley <thomasmorle...@gmail.com> het > volgende geschreven: > > Hi all, > > if temporary Voices occur, then the main Voice may not contain > rhythmic-events for the duration of those temporary Voices. > I'd like to identify where the main Voice "pauses", like in this test-code: > > My_test_engraver = > #(lambda (context) > (let* ((mus-event #f)) > (make-engraver > (listeners > ((rhythmic-event this-engraver event) > (set! mus-event > (cons > (ly:context-current-moment context) > (ly:prob-property event 'length))))) > ((process-music this-engraver) > (if (and mus-event > (equal? (ly:context-current-moment context) (car mus-event))) > (begin > (format #t > "\nEvent seen starting at ~a ending at ~a" > (car mus-event) (ly:moment-add (car mus-event) (cdr > mus-event))) > (set! mus-event #f)) > (format #t > "\nCurrent context has no rhythmic-event starting at ~a" > (ly:context-current-moment context))))))) > \new Voice > \with { \consists \My_test_engraver } > { > b1 > R > \new Voice d'' > s > << e' \\ c' >> > r > } > > ==> > Event seen starting at #<Mom 0> ending at #<Mom 1> > Event seen starting at #<Mom 1> ending at #<Mom 2> > Current context has no rhythmic-event starting at #<Mom 2> > Event seen starting at #<Mom 3> ending at #<Mom 4> > Current context has no rhythmic-event starting at #<Mom 4> > Event seen starting at #<Mom 5> ending at #<Mom 6> > Current context has no rhythmic-event starting at #<Mom 6> > > Questions > (a) Is there a better possibility than calculating, based on > current-moment and 'length of the event? > (b) Are there other possibilities where a Voice-context "pauses"? I.e. > staying alive, but not containing rhythmic-events? > > Thanks, > Harm >