Hi there!
I have a setup that is configured in this way:
Two groups, a source group and an fx group placed after the source group.
In the fx group I run a bunch of fx synths (for comb filter, flanger, reverb etc.). Those synth are always running on my server.
Here is a simplified version of it.
(
s.newBusAllocators;
~comBus = Bus.audio(s, 2);
~revBus = Bus.audio(s, 2);
s.waitForBoot({
SynthDef.new(\rev,{
arg in = 0, out=0, room= 0.3,mix= 0.3, damp = 0.5;
var sig;
sig = In.ar(in, 2);
sig = FreeVerb2.ar(sig[0],sig[1], Lag.kr(mix, 2), Lag.kr(room, 2),damp);
Out.ar(out, sig)
}).add;
SynthDef.new(\comb, {
arg in= 0, out= 0;
var sig, comb;
sig = In.ar(in, 2);
comb = CombC.ar(sig, \maxDelTime.kr(1), Lag.kr(\delTime.kr(0.2), 0.2), \decTime.kr(6));
sig = sig.blend(comb, \wet.kr(0.3));
sig = Pan2.ar(sig,0);
Out.ar(out, sig)
}).add;
SynthDef.new(\saw, {
arg freq = 60, amp = 0.2, ffreq = 1200, pos = 0, atk = 0.1, dec = 0.3, sus = 0.5, rel = 1, gate = 1, rq = 1;
var sig, env;
sig = Saw.ar(freq);
sig = MoogFF.ar(sig, freq * 2); //MouseY controlla la frequeza di taglio del filtro
env = EnvGen.ar(Env.adsr(atk, dec, sus, rel), gate, doneAction:2);
sig = sig * env * amp;
sig = Pan2.ar(sig, pos);
Out.ar(0, sig)
}).add;
~makeNodes = {
// Groups
~fxGroup = Group.new(s.defaultGroup, \addAfter);
//Effects
~comb = Synth(\comb, [\in, ~comBus, \out, ~revBus]);
~reverb = Synth(\rev, [\in, ~revBus, \out, 0], ~comb, \addAfter);
};
s.sync;
~makeNodes.();
s.sync
})
)
The problem is that if i try to use Ndef, the output of the that process is written to one of the busses that I reserved for the fx synths.
If I run
Ndef(\x, {SinOsc.ar(mul: 0.2) * Env.perc(0.01, 0.01).ar(0, Impulse.ar(0.5))});
I can hear the output of that Ndef running into my effects, (comb + reverb) even if I did not run
Ndef(\x).play;
Apparently the output of Ndef(\x) is written to the first bus available, since 0 and 1 are usually hardware outputs and 2,3 are hardware input, so it goes to number 4, which is the one that I’m using for comb filter(which is connected to reverb by ~revBus, then reverb goes into hardware output).
evaluating this
~comBus
post window says : → Bus(audio, 4, 2, localhost)
This is not what I want!
I would like to have the option of using Ndef and if needed to route the output to and fx synth.
My question is:
Is there a way to prevent Ndefs, (and Proxy Space or NodeProxy) to use busses that I already reserved for other processes, like fx synths etc.
Thank you, any help is very much appreciated!