The PingPong Delay plays ok for like a second and then it starts to click and sound a bit erratic. Not sure if I implemented the delay effect properly or if it has something to do with the bufnum
argument.
p=ProxySpace.push(s);
p.makeTempoClock;
p.clock.tempo = 160/60;
(
b = Buffer.alloc(s, s.sampleRate,2);
SynthDef.new(\acid, {|bufnum = 0, out = 1, freq= 100, gate = 0.5, amp= 2, width=0.48, ffreq = 2000, rez=0.8, delayTime = 2, feedback = 0.5 |
var plfo, fcurve, sig;
plfo = SinOsc.kr(6, mul:0, add:1);
freq = Lag.kr(freq, 0.04) * plfo;
fcurve = EnvGen.kr(Env.adsr(0.0, 0.1, 0.4, 3), gate);
fcurve = (fcurve - 1).madd(2, 1) * ffreq;
sig = Pan2.ar( Pulse.ar(freq, width) + Pulse.ar(freq+3, width) );
sig = RLPFD.ar(sig, fcurve + ffreq, rez) *
EnvGen.kr(Env.adsr(0, 0.5, 0.8, 0.05), gate, doneAction: Done.freeSelf);
sig = PingPong.ar(b.bufnum, [sig,sig], delayTime ,feedback, 1 );
Out.ar(out, sig * amp );
}).add;
)
(
var seq = Pxrand([0.25, 1, 0.25, 0.50, 0.25, 3, 0.25, 0.50, 1, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25 ], inf);
var seq2 = Pxrand([0.25], inf);
~acid = PmonoArtic(
\acid,
\legato, seq,
\degree, Pxrand(
[ Pxrand([5, 8, 12, 3, 4, -7, 3, 4]-12, 2),
Pseq([-5, -8, -12, -6, -4, -14, -6, -4]/2, 1)
], inf),
\ffreq, Pxrand(
[ Pxrand([100,500, 800, 1200, 2000, 1200, 2400], 1),
Pseq([200,800, 900, 1500, 1800, 1200, 1900], 1)
], inf),
\dur, seq2,
\amp, Pxrand([3, 2, 2, 2, 1, 1, 3, 3, 3, 3, 3], inf),
);
~play_acid = ~acid.play();
)