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: Jan-Peter Voigt
Subject: Re: Generating music expressions from within \applyContext?
Date: Tue, 26 Jul 2016 07:28:39 +0200
User-agent: K-9 Mail for Android

Hi,

I haven't a working solution, but some thoughts:
The \applyContext is one event in time, so you can set context-properties *once*.
This might be a case for a midi-performer. This is an engraver inside the midi-block, so it should be possible to create a scheme-performer to set the midiExpression property inside the Staff context.
--- this is not an easier way! And I don't have a computer nearby right now, to test, if moving the dynamic performer into another context helps.
Another approach might be a music-function, that produces SimultaneousMusic with the note(s) and the dynamic midi events in separate streams. ( e.g. << { \music } { \dynamicevents } >> )

Just some thoughts right now.
I am quite busy right now, so if there are no helpful answers within two weeks, you can ask me again and I can provide some code.

Jan-Peter

Am 26. Juli 2016 00:51:49 MESZ, schrieb "H. S. Teoh" <address@hidden>:
Hi,

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?

The background of this is that I'm writing a Scheme function that
generates single-note crescendos by emitting a series of \set
Staff.midiExpression = ... events. Currently I've written a Scheme
function that's able to generate these events; however, it requires me
to specify numerical starting / ending values for midiExpression. I'd
like to be able to specify dynamics instead of numerical values, and
have the Scheme function automatically look up the numerical values
based on the current volume function defined for the Staff.

However, so far I haven't been able to figure out how to read the Staff
properties except using \applyContext with a lambda, and AFAICT it's not
possible to return a music _expression_ from this lambda?

Or is there another (hopefully simpler?) way to achieve what I want?


--T



lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
reply via email to

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