On Tue, Oct 5, 2010 at 2:33 PM, Tom Lieber <tom@alltom.com> wrote:
2010/10/5 Mat Schaffer <mat@schaffer.me>:
> - The SinOsc seems to click whenever I stop or disconnect it. I've tried
> moving the gain to 0.1, then 0, but it still seems to click. Is there some
> technique for avoiding this?
Typically you'd use an envelope to avoid clicks by slowly ramping the gain.
For example, you could use an Envelope:
SinOsc s => Envelope e => dac;
50::ms => e.duration;
while(1) {
e.keyOn(1);
second => now;
e.keyOff(1);
second => now;
}
Or ADSR, which lets you give it a little kick:
SinOsc s => ADSR e => dac;
e.set(50::ms, 50::ms, .4, 50::ms);
while(1) {
e.keyOn(1);
second => now;
e.keyOff(1);
second => now;
}
Thanks, Tom! Just noticed you also did Ruck which I was looking at. Good luck on the project! I'd love something like ChucK that had a more full-featured language driving it.
Thanks again,
Mat