@jamshark70
Okay, still using rudimentary examples - this is my straight up test with ProxySubmix:
//Boilerplate code for basic live coding functionality
(
//increase number of buffers the server has access to for loading samples
s.options.numBuffers = 1024 * 16;
//increase the memory available to the server
s.options.memSize = 8192 * 64;
s.options.numOutputBusChannels = 2;
//boot the server
s.reboot;
//display the oscilloscope
// s.scope;
//start proxyspace
p=ProxySpace.push(s);
//start tempo clock
p.makeTempoClock;
//give proxyspace a tempo
p.clock.tempo = 1;
Task({
3.wait;
d = Dictionary.new;
d.add(\foldernames -> PathName("/home/hypostatic/music/samples/808s_by_SHD/Classic").entries);
for (0, d[\foldernames].size-1,
{arg i; d.add(d[\foldernames][i].folderName -> d[\foldernames][i].entries.collect({
arg sf;
Buffer.read(s,sf.fullPath);
});
)});
// ("SynthDefs.scd").loadRelative;
//loads snippets from setup folder
//("Snippets.scd").loadRelative;
//wait, because otherwise it won't work for some reason
3.wait;
//activate StageLimiter - Part of the BatLib quark
// StageLimiter.activate;
"Setup done!".postln;
}).start;
)
(
SynthDef(\bplay,
{arg out = 0, buf = 0, rate = 1, amp = 0.5, pan = 0, pos = 0, rel=15;
var sig,env=1 ;
sig = Mix.ar(PlayBuf.ar(2,buf,BufRateScale.ir(buf) * rate,1,BufDur.kr(buf)*pos*44100,doneAction:2));
env = EnvGen.ar(Env.linen(0.0,rel,0),doneAction:0);
sig = sig * env;
sig = sig * amp;
Out.ar(out,Pan2.ar(sig.dup,pan));
}).add;
)
m = ProxySubmix(\del);
m.ar(2);
p.envir.put(\del, m);
~del = { DelayC.ar(m.ar) };
~del.play;
m.addMix(~h, postVol: true);
m.addMix(~b, postVol: true);
NdefGui(m, 8); // gets these params automagically:
(
~h = Pbind(
\instrument, \bplay,
// \out, ~out,
// \addAction, \addToHead,
\buf, d["Hats"][2],
\dur, Pseq([0.25, 0.5], inf),
)
)
// ~h.play;
// ~h.stop;
// ~h.free;
(
~b = Pbind(
\instrument, \bplay,
// \out, ~out,
\buf, d["Bass Drums"][2],
\dur, Pseq([0.5, 1, 0.5, 1], inf),
\amp, 0.6
).play;
)
Order of execution:
-
Initiate a somewhat commented out version of setup code to initiate proxy space by https://theseanco.github.io/howto_co34pt_liveCode/2-3-Setup-Code---Making-Performance-Easier/ (mainly to load some test samples for kits) - not necessary but as I’m using Pbinds with the samples…
-
create a ProxySubmix (per your help file):
m = ProxySubmix(\del);
m.ar(2);
p.envir.put(\del, m);
-
Start ~h
and ~b
Pbinds (this may be my problem) with definition.play - not ~h.play or ~b.play after defining (based on issues I had in previous tries myself in which the only way routing worked was as in my code).
-
Create an FX channel:
~del = { DelayC.ar(m.ar) };
~del.play;
- Add Pbind sources to ProxySubmix:
m.addMix(~h, postVol: true);
m.addMix(~b, postVol: true);
- Initiate GUI:
NdefGui(m, 8); // gets these params automagically:
This doesn’t seem to work. I assume I’m using ProxySpace with Pbinds incorrectly, as your Help code works just fine.
I’ve also tried this by replacing straight SynthDefs with ProxySpace Functions but then I have the problem with the Pbinds not finding the \instrument, ~bplay
- (I think that syntax is just wrong in general but cannot remember where I saw how to properly assign a proxy (knowing that ~bplay = {...}
is the same as Ndef(\bplay, {...})
between ProxySpace and Ndef.
Again, likely missing some large piece of the puzzle here. Any help would be welcome.
I have to also assume that as the SynthDefs are wired to Out to 0 by default and because I’m not supplying anything that this is also breaking (hence my trying the ProxySpace function method instead).
I haven’t tried to go the entire Ndef in default enivronment route yet either, with either your examples or @droptableuser given examples. But at this point I’m try not to jump rails.