lilypond-user
[Top][All Lists]
Advanced

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

Re: Generating music expressions from within \applyContext?


From: David Kastrup
Subject: Re: Generating music expressions from within \applyContext?
Date: Tue, 26 Jul 2016 10:21:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> "H. S. Teoh" <address@hidden> writes:
>
>> I have a Scheme function that returns a music expression. Unfortunately,
>> the expression returned depends on the properties of the context it's
>> evaluated in. I.e., based on the current setting of
>> Staff.dynamicAbsoluteVolumeFunction it will return a different number of
>> events in the music expression.
>>
>> Is this possible?
>
> \applyContext works at the process-music stage.  That's actually a bit
> late to generate stream events.

Sorry, that one is actually nonsense.  I got confused between iterators
(which is what \applyContext uses) and engravers here.  So if you
actually want to generate stream events, that would be possible and
actually, for the sake of quoted music, a reasonably good idea.

So you'd use ly:make-stream-event to create suitable stream events and
broadcast them to the event-source dispatcher of the context...

Weird.  Nobody does that.  Just C++ code.  Now I'm irritated.

-- 
David Kastrup



reply via email to

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