lilypond-user
[Top][All Lists]
Advanced

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

Re: Detection of Voice Number


From: David Kastrup
Subject: Re: Detection of Voice Number
Date: Wed, 02 Oct 2013 17:29:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Hi all,
>
> one more question about processing output:
>
> I would like to test each note and rest for the Voice number it has.

It hasn't.

> Then I would like to set the color of this note/rest and corresponding
> grobs (Stem/Flag/Beam) to a color depending on the voice number.
>
> Unfortunately I'm stumbling quite hopelessly through the IR, thinking
> I could get somewhere with ly:context-property but not knowing what
> the property name of a voice number (or generally the properties of a
> Voice context) could be or where I could look this up.

You can use \applyContext to get a notice of the current context.

But notes and rests are not inherently bound to a context.  Usually the
note-events and rest-events are iterated from inside a Voice context
(and seen by engravers in all parent contexts).  You could add an
engraver of your own into individual Voice contexts that adds
appropriate tweaks to the events in the listener stage.

You could also add an engraver of your own into individual Voice
contexts that acknowledges the respective grobs and adds color to them.

But short of using your own engraver in particular contexts in order to
see either the events or the grobs, neither of them are particularly
tied into a single context.

-- 
David Kastrup




reply via email to

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