[chuck-users] exponential envelope

Kassen signal.automatique at gmail.com
Fri Jun 3 04:09:58 EDT 2011


Hmm. The documentation agrees with you: "Lookup can either be done
> using the lookup() function, or by driving the table with an input
> UGen, typically a Phasor."

That's what I thought I remembered, yes. So; barring bugs let's assume that
for now.

> I tried to drive the Gen5 ugen with an envelope, but that didn't seem
> to work (or do anything at all).

Yes, that's right. This is because Envelope internally multiplies its shape
with it's input. To get the behaviour you expect you'd write;

Step unity => Envelope e;
1 => unity.next;

This is a pattern I use fairly often. "unity" stands for "unity gain". Once
you have a Step of that name you can re-use it elsewhere in your code. I
find that quite handy.
It's been discussed that perhaps this should be the default behaviour for
Envelopes (including ADSR) that don't get a input, I'd be in favour of that
and I seem to remember Perry also felt that way.

> I tried a few other variations on
> this idea with no result. Maybe this is not what you meant, and what I
> am doing is completely silly.

No, it's close. What you are doing is wave-shaping the enveloped signal and
instead you we'd like to wave-shape the envelope, then apply it to the
signal. In this case we need a additional vca (Voltage Controlled Amplifier)


Step unity => Envelope e => Gen5 curve => Gain vca; //waveshaped envelope as
a control voltage
Noise my_signal => vca => dac; //signal to be enveloped
1 => unity.next; //unity gain to make the envelope behave
3 => vca.op; //set the vca to multiply

//set up your Gen5 here, your envelope, write music, etc.

Aside from the trick with the Step it's all quite standard and
straightforward stuff that you'd see in any kind of modular synth, but I can
understand that this is a bit tricky if see it for the first time. It should
be easier with a updated Envelope and ADSR, I think.

I hope that helps and I hope there aren't too many bugs in it; I didn't try
to run any of this ;-)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20110603/f6d0b5db/attachment.htm>

More information about the chuck-users mailing list