Hi, I was trying the SC-808 SynthDefs made by Yoshinosuke Horiuchi with Patterns. Despite the EnvGen
has a doneAction: 2
the synth is not cleared and therefore it generates infinite nodes.If I replace the Env.new
with a Env.perc
they are correctly cleared. So how can I also free the synth using Env.new
?
(
SynthDef.new(\bd, {
arg decay=30, amp=2, gate=0, tone=56;
var fenv, env, trienv, sig, sub, punch, pfenv;
env = EnvGen.kr(Env.new([0.11, 1, 0], [0, decay], -225),doneAction:2);
trienv = EnvGen.kr(Env.new([0.11, 0.6, 0], [0, decay], -230),doneAction:0);
fenv = Env([tone*7, tone*1.35, tone], [0.05, 0.6], -14).kr;
pfenv = Env([tone*7, tone*1.35, tone], [0.03, 0.6], -10).kr;
sig = SinOsc.ar(fenv, pi/2) * env;
sub = LFTri.ar(fenv, pi/2) * trienv * 0.05;
punch = SinOsc.ar(pfenv, pi/2) * env * 2;
punch = HPF.ar(punch, 350);
sig = (sig + sub + punch) * 2.5;
sig = Limiter.ar(sig, 0.5) * amp;
sig = Pan2.ar(sig, 0);
Out.ar(0, sig);
}).add;
Pbindef(\bd, \i, \bd, \a, 1, \d, 1/4).play;