lilypond-user
[Top][All Lists]
Advanced

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

extending event-listener.ly to include a (numerical) voice id


From: Maurits Lamers
Subject: extending event-listener.ly to include a (numerical) voice id
Date: Fri, 20 Oct 2017 17:03:41 +0200

Hi all,

I am trying to extend the default event-listener.ly to also include information 
about in which voice a specific note is being played.
When the voice is defined using 

\new Voice = voicename

I can retrieve the retrieve that name through (ly:context-id 
(ly:translator-context engraver)). 
When the voice is defined in an anonymous way context-id is an empty string. 
I have been trying to set the context-id when none is set using a counter, but 
that fails because of an "missing typecheck for property 'context-id'" error.
I tried to use both a normal list as well as an asoc list to keep track of the 
different Voice contexts in order to tell them apart but I haven't been able to 
get that to work.

I know that when lyrics are added, it is possible to refer to those anonymous 
voices by using "1" etc.
Looking through the code which does this 
(lily/lyric-combine-music-iterator.cc), I gather that the lyrics adding process 
searches for the a voice matching a certain id.

I would like to be able to mark a voice in Scheme in such a way that I can 
print to which voice a certain note belongs. Could anyone give a clue on how to 
achieve that?

Thanks in advance!

Maurits


reply via email to

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