Hey Dan, You're on the right track with that code. Envelope needs a source to work on, though--if there isn't a ugen inputting samples to it, it just envelopes a zero signal. The Step ugen works nicely for this, as you can feed it an arbitrary sample value, and it will continuously feed this value through a patch. SinOsc s => dac; 220 => s.freq; Step stp => Envelope e => blackhole; // set step value s.freq() => stp.next; // set the current value of the envelope 1 => e.value; // set the target value of envelope 2 => e.target; // set time to reach target 10 => e.time; // activate e.keyOn(); while (20::ms => now){ e.last() => s.freq; } A functionally equivalent but potentially clearer way of writing this would be: SinOsc s => dac; 220 => s.freq; Step stp => Envelope e => blackhole; // set step value 1 => stp.next; // set the current value of the envelope s.freq() => e.value; // set the target value of envelope s.freq() * 2 => e.target; // set time to reach target 10 => e.time; // activate e.keyOn(); while (20::ms => now){ e.last() => s.freq; } spencer On Jan 13, 2007, at 12:27 AM, dan trueman wrote:
can Envelope work like SinOsc to control ugen parameters? meaning, something like this, hacked from the lovely ChucK manual blackhole example:
SinOsc s => dac; Envelope e => blackhole; 10. => lfo.time; s.freq = 220.; e.target(440.);
while (20::ms => now){ e.last() => s.freq; }
?
it doesn't work, and it seems that e.last() doesn't actually give you anything. obviously there are other ways to do this, but i'm trying to *learn* here!
takk, dan _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users