I have a problem with bus and samples:
// I create a 3-channel audio bus to record each of the 3 sound collections (\bouchon, \glou, \rireSynth) in a separate channel:
~recDisc = Bus.audio(s, 3);
// I create Dictionary "d" with three collections: \bouchon, \glou, \rireSynth:
(
d = Dictionary.new;
d.add(\bouchon ->
"~/son/Sons/cuisine/boisson/bouchon01/bouchon*".pathMatch.collect({
arg sf;
Buffer.read(s, sf);
});
);
d.add(\glou ->
"~/son/Sons/cuisine/boisson/glou01/glou*".pathMatch.collect({
arg sf;
Buffer.read(s, sf);
});
);
d.add(\rireSynth ->
"~/son/Sons/humain01/rire/rireSynthetique01/rireSynthetique01*".pathMatch.collect({
arg sf;
Buffer.read(s, sf);
});
);
)
// I create the SynthDef to play the sounds:
(SynthDef(\bufplay, {
|buf=0, rate=1, amp=1, pos|
var sig;
sig = PlayBuf.ar(numChannels:1,
bufnum: buf,
rate: BufRateScale.ir(buf)*rate,
doneAction:2);
sig = Pan2.ar(sig, pos)*amp;
Out.ar(~recDisc, sig); // record
Out.ar(0, sig); // monitor
}).add;
)
// I create a Synth that chooses a sound randomly in the three collections:
(
Synth(\bufplay,
[\buf, [
d[\glou].choose.bufnum,
d[\bouchon].choose.bufnum,
d[\rireSynth].choose.bufnum]
.choose]);
)
// the problem is: how to make the sounds of the collection \glou go out to the bus ~recDisc.subBus(0), those of the collection \bouchon to ~recDisc.subBus(1), and those of \rireSynth to ~recDisc.subBus(2).
I can not find a solution. Someone would have any idea?