Thomas Morley <thomasmorle...@gmail.com> writes: > Hi, > > for some engraver I need to look at all Voices, comparing them in some regard. > > If I put the engraver in every Voice, then every Voice is processed, > yes, but I can't find a method to compare them. > So I thought the way might be to put the engraver in Score, get the > Voices and do nasty things ... > > Though, I can't find a method to select all Voices. > > Consider this tiny and boiled down example: > > %%%%%%%%%%%%%%% > \version "2.19.32" > > get-Voices = > \context Score \applyContext #(lambda (ctx) (display ctx)) > > \score { > \new Staff > << > \new Voice = "1" { \get-Voices c''1 } > \new Voice = "2" { e'1 } > >> > } > %%%%%%%%%%%%%%%% > > How to get all Voices looking down from Score?
You could have an engraver listen for AnnounceNewContext and RemoveContext events and keep tally of the Voice contexts among them in a hash table or something like that. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user