Hi
I would like to be able to crossfade back and forth between two pbinds like one would crossfade between two signals with the XFade2 UGen.
As a starting point…
(
SynthDef(\sine, {
arg freq = 300, out = 0;
var snd, env;
env = EnvGen.ar(Env([0, 1, 0], [0.2, 0.3]), doneAction: 2);
snd = SinOsc.ar(freq, mul: 0.3) * env;
Out.ar(out, snd);
}).add
)
(
SynthDef(\saw, {
arg freq = 200, out = 0;
var snd, env;
env = EnvGen.ar(Env([0, 0.5, 0], [0.3, 0.4]), doneAction: 2);
snd = LFSaw.ar(freq, mul: 0.2) * env;
Out.ar(out, snd);
}).add
)
(
u = Pbind (
\instrument, \sine,
\dur, 0.5,
)
)
(
v = Pbind (
\instrument, \saw,
\dur, 0.8,
)
)
u.play
v.play
Thanks!