I am trying to randomly crossfade between two Buffers with synced recordings. When switching the Buffer, you can hear a click, because it’s an instant transition without a fade. Is there a possibilty to add an envelope everytime the buffer switches? This is what I’ve got so far:
~a = Buffer.read(s, path1);
~b = Buffer.read(s, path2);
(
SynthDef(\choose, {|out = 0|
var a, sig;
a = [PlayBuf.ar(2, ~a,loop: 1), PlayBuf.ar(2, ~b,loop: 1),];
sig = Select.ar(LFNoise0.ar(5).range(0,1).round(1) * a.size, a) * 0.2;
Out.ar(out, sig);
}).play;
)
hey dietcv! thanks for your answer! SelectX.ar sounds exactly like the thing I am looking for, but somehow I don’t here any difference between using Select.ar, SelectX.ar, or LinSelectX.ar. There are still clicks when switching the buffer. do you have any idea why this is happening? thank you!