Hi,
in order to understand busses and groups mechanism, I’m trying to setup a simple synth and an fx and would like to choose wether the synth is going through the fx or directy to the output 0 (aka dry signal)
here is the code, but i can’t hear anything through the speakers
I’m missing something but i can’t see what’s wrong with this code
(s.waitForBoot {
//busses
s.newBusAllocators;
~delayBus = Bus.audio(s, 2);
~dryBus = Bus.audio(s, 2);
s.sync;
//groups
~synthGroup = Group(s);
~fxGroup = Group.after(~synthGroup);
~dryGroup = Group.after(~synthGroup);
s.sync;
// declare synths
SynthDef.new(\source, {
arg freq = 400, amp=0.5, env_rate=0.7,
out=0;
var sig, env;
sig = SinOsc.ar(freq)!2;
env = EnvGen.kr(
Env.perc(releaseTime:0.2),
LFSaw.kr(env_rate)
);
sig = sig * env * amp;
Out.ar(out, sig);
}).add;
//declare dry synth
SynthDef(\drysignal, {
arg in= 0, out= 0, amp= 0.9;
var snd;
snd = In.ar(out, 2);
snd = snd * amp;
Out.ar(out, snd);
}).add;
//declare fx
//allpass delay
SynthDef(\allpass_delay, {
arg maxdelaytime = 0.3, delaytime = 0.25, decaytime = 6;
var sig;
sig = In.ar(\out.kr(0), 2);
sig = AllpassN.ar(sig, maxdelaytime, delaytime, decaytime);
Out.ar(0, sig);
}).add;
s.sync;
//delay
~delay = Synth.new(\allpass_delay,[\in, ~delayBus],~fxGroup);
// dry signal
~dry = Synth.new(\dry,[\in, ~dryBus, \out, 0],~dryGroup);
s.sync;
s.plotTree;
});
//synth
(
//can run this multiple times
~synth = Synth.new(\source, [
\out, ~delayBus,
\env_rate, 0.5,
\freq, exprand(200,2000),
\amp, 0.25
], ~synthGroup);
)
thanks for your help