[chuck-users] control envelopes

Kassen signal.automatique at gmail.com
Fri Nov 24 10:23:30 EST 2006


I still find myself wishing for ADSR's to be able to control stuff, but
> that won't happen, right?

Hmmmm, ADSR doesn't seem to have a .value() output, no. How about this (from
SawOsc s => LPF f => dac;

//this makes envelope output a float between 0 and the vlaue held by the
step module
//clearly the sustain level is the important factor here but that's not hard
to deal with
Step offset => ADSR env => blackhole;

440 => s.freq;

//this defines the maximum amount of modulation
//it would make sense to express it as a multiple of s.freq() but let's keep
it simple
880 => offset.next;

fun void updater()
    env.last() + s.freq() => f.freq;
    10::ms => now;

spork ~ updater();

//insert musical stuff here


Or something along those lines.

Not feeling all that well, there might be a typo or two in there but that's
one trick to do it. In this simple form it's rather static but there's no
reason to not feed the Step some output from mtof (in the purely
hypothetical case that you'd like some conventional tuning to your Moog, not
accusing anyone ;-) )

Another related situation: Supposed I want to modulate both panning,
> volume and filter by different predetermined "curves"s. I can't get my
> head around how that is done nicely. A multi breakpoint envelope that
> could controll stuff (like csounds expseg and linseg) would be really
> great in some situations, since they are so easy to setup and experiment
> with the different timings/levels. But how could something like this be
> solved with chuck?

linseg is great, it's one of the things in Csound that I realy liked. Along
the lines of my example above or by using .value() you can use Envelope as a
linseg. There are some older posts by me on this list where I tried to use
it for exactly this and ran into trouble when Envelope was asked to hold
values in the frequency range. This has since been fixed but I didn't yet
return to that plan so if you come up with any interesting results...

It would need some aditional trickery to go from Envelope's simple ramps to
a real multi stage modulation source but the same holds true for linseg so
you should be fine.

Does that help?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20061124/d84b451b/attachment.htm 

More information about the chuck-users mailing list