[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get all Voice-Contexts?
From: |
David Kastrup |
Subject: |
Re: How to get all Voice-Contexts? |
Date: |
Fri, 27 Nov 2015 23:45:55 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Thomas Morley <address@hidden> 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