On Tue, Jul 26, 2016 at 09:48:36AM +0200, David Kastrup wrote:
> "H. S. Teoh" <hst...@quickfur.ath.cx> writes:
[...]
> > 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.
> 
> Oh, but that's perfectly manageable with \applyContext.  Don't
> generate any events, just call ly:context-set-property! directly.  If
> you don't want to find Staff yourself, you can just write
> 
> \context Staff \applyContext (lambda ...
> 
> and then the context passed to the applyContext function will already
> be a Staff context.

Sound good, but how do I set the property at evenly-spaced time
intervals from inside the lambda?

The main problem I'm having is that the number of intervals will differ
depending on the volume levels of the given dynamics. Since the MIDI
expression controller only has 127 discrete volume levels, if I'm going
from 0 to 127 then I'd need 127 property changes, but if I'm going from
64 to 96 I only need 32 property changes.  But I wouldn't know this
until the \applyContext lambda is called. How do I insert property
changes at regularly-spaced intervals from inside the lambda?


[...]
> So far it does not sound like you want anything returned rather than
> setting some properties.
[...]

True, so perhaps there is a way after all.  It's just that so far I've
only really worked with music expressions and grobs when it comes to
Scheme, and haven't quite figured out what happens to these objects
afterwards. :-P


T

-- 
If Java had true garbage collection, most programs would delete themselves upon 
execution. -- Robert Sewell

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

Reply via email to