lilypond-devel
[Top][All Lists]
Advanced

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

Scheme function to print out active Voice context during interpretation?


From: Trevor Bača
Subject: Scheme function to print out active Voice context during interpretation?
Date: Sun, 14 Dec 2008 12:42:14 -0600

Hi,

Is there a way to print out the name (or other identity) of the currently active voice just before any given note or rest in an input file?

I'm thinking something like this (please pardon the faux-Scheme) ...


\new Staff <<
   \context Voice = "foo" {
       c'4
       #(print (something->string (ly:get-active-voice)))
       c'4
   }
   \context Voice = "bar" {
       d'4
       #(print (something->string (ly:get-active-voice)))
       d'4
   }
>>


... where the first print would emit the string "foo" and the second print would emit the string "bar" as LilyPond interprets the input.

Does something like this exist?

[The motivation is that I'm researching the way that LilyPond determines which voice music events are assigned to ... from a user's perspective based solely on looking at input files. Voice-resolution in the example above is of course quite clear; voice-resolution when there are multiple anonymous voices, possibly in parallel, has become extremely tricky as I've written more and more test files, all of which I'll be happy to post if anyone else is interested in that sort of thing.]


Trevor.


--
Trevor Bača
address@hidden

reply via email to

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