So, my recent tests were sticking with one paradigm for now - JITlib but not proxyspace (using Ndef) with the examples given.
(
s.reboot;
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;
)
Ndef(\fx).play;
Ndef(\fx)[0] = \mix -> { Ndef(\synth1).ar };
Ndef(\fx)[1] = \mix -> { Ndef(\synth2).ar };
Ndef(\fx)[1] = \mix -> { Ndef(\bplay).ar };
Ndef(\fx).filter(10, {|in| DelayC.ar(in) });
// you can control the wet and dry levels like this
Ndef(\fx).set(\mix0, 0.5, \mix1, 0.9, \wet10, 0.5);
Ndef(\synth1, { LFPulse.ar(110, 0, 1, 0.5).dup }).play;
Ndef(\synth2, { LFSaw.ar(5).dup }).play;
Ndef(\synth2).stop;
Ndef(\synth1).stop;
Ndef(\fx).stop;
(
Ndef(\bplay,
{ | 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;
});
)
(
~b = Pbind(
\type, \set,
\id, Pfunc({ Ndef(\bplay).nodeID}),
\args, #[\buf, \amp],
\buf, d["Bass Drums"][2],
\dur, Pseq([0.5, 1, 0.5, 1], inf),
\amp, 0.6
).play;
)
(
Ndef(\bplay)[10] = \set -> Pbind(
\buf, d["Bass Drums"][1],
\dur, Pseq([0.5, 1, 0.5, 1], inf),
\amp, 0.6
).play;
)
As this is using samples that won’t translate, I’ll just say that
(
Ndef(\bplay)[10] = \set -> Pbind(
\buf, d["Bass Drums"][1],
\dur, Pseq([0.5, 1, 0.5, 1], inf),
\amp, 0.6
).play;
)
yields a piano tone. I assume this is because somehow it playing something like
{SinOsc.ar(note from Pbind)}.play
Instead of actually playing the sample. When I copy out
d["Bass Drums"][1].play
In the same running environment it plays the sample once.