[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] fade-efx




Use XOut.

On Apr 28, 2004, at 3:32 PM, jeremy@xxxxxxxxxxx wrote:


i'm trying to introduce an effect subtly by fading it in (to avoid clicks,
of course). i thought that it
would be easy to achieve this by using an xfade2 ugen and an envelope. the
ugen would fade
between the original sound and the treated sound after the efx synth has
been introduced. see
below.

for some reason, the effect is introduced, i get an audio click. but when
it is released, there is no
click. any idea why this might be happening? i'm using an asr envelope with
equal attack and decay
times to control the fade.

(

SynthDef.new("snd", { arg freq=2, width=1, mix= -1, in=0, out=0, gate=1,
mute=0;

			var snd, env, wet;
	
			env = EnvGen.kr(Env.asr(0.15, 1, 0.15), gate, doneAction:2);
	
			snd = SinOsc.ar(400, 0, 0.4 * env);
			
			snd = Pan2.ar(snd, 0);
			
			Out.ar(out, snd);
			
}).send(s);

SynthDef.new("effect", { arg freq=4, width=1, in=0, out=0, gate=1, mute=0;

			var snd, env, wet;
	
			env = EnvGen.kr(Env.asr(0.15, 1, 0.15), gate, doneAction:2);
	
			snd = In.ar(in, 2);
			wet = snd * SinOsc.ar(freq, 0, width);
			wet = XFade2.ar(snd, wet, (env*2) - 1); // xfade in & out
			snd = Select.ar(mute, [wet, snd]);
			ReplaceOut.ar(out, snd);
			
}).send(s);

)

// one at a time

x = Synth.new("snd");

y = Synth.tail(s, "effect"); // click

y.set(\gate, 0); // oh so smooth


--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .


_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users