I never used the EnvGen adsr. , so I tried it
The env is set to doneaction :2 , yet the voices keep on stacking up when sequenced from a Pbind
(
SynthDef(\Sqwer,
{| ampatt =0.001,ampdec=1,ampsus=0.2,amprel=0.3filtatt=0.001,filtdecay=0.500,filtsus=0.2,filtrel=0.2,osc1amp=0.3,osc2amp=0.3,osc3amp=0.3,offset1=0,offset2=0.2,offset3=(-0.2),filterfreq=600,res=1,freq=30,
filteramount=100,pan=0,vol=0.7,fsh=5,xfade=0|
var sig,sig1,sig2,sig3,ampenvelope,filterenvelope;
filterenvelope=EnvGen.ar(Env.adsr(filtatt,filtdecay,filtsus,filtrel),doneAction:0);
ampenvelope=EnvGen.ar(Env.adsr(ampatt,ampdec,ampsus,amprel,),doneAction:2);
sig1=Pulse.ar((freq+offset1).midicps,mul:osc1amp);
sig2=Pulse.ar((freq+offset2).midicps,mul:osc2amp);
sig3=Pulse.ar((freq+offset3).midicps,mul:osc3amp);
sig=sig1+sig2+sig3;
sig=RLPF.ar(sig,(filterfreq+(filterenvelope*filteramount)).clip(20,20000),rq:res);
sig=XFade2.ar(sig,FreqShift.ar(sig,fsh),pan:xfade);
sig=sig*vol;
sig=sig*ampenvelope;
sig=Pan2.ar(sig,pos:pan)!2;
Out.ar(0,sig);
}).add
)
Synth(\Sqwer,[\freq,58,\offset1,-24,\offset2,-0.3,\offset3,0.1,\filterfreq,800,\filteramount,600,\xfade,0,\fsh,3]);
(
Pdef(\bebe,
Pbind(\instrument,
\Sqwer,
\dur,Pseq([1/4,1/4,1/4,1/4],inf),
\freq,Pseq([60,61,62,63,64,65,66],inf),
\offset1,0,
\offset2,0.2,
\offset3,-0.1,
\filterfreq,Prand([400,500,400,500],inf),
\filteramount,1800,
\filtatt,0.001,
\filtdecay,0.3,
\filtsus,0.2,
\filtrel,0.1,
\ampatt,0.001,
\ampdec,0.1,
\ampsus,0.0,
\amprel,0.1,
\vol,0.3,
\res,0.5,
\xfade,-1,
\fsh,Pwhite(2,5,inf),
)
)
)
Pdef(\bebe).play(t)
Pdef(\bebe).stop(t)
t=TempoClock(124/60).permanent_(true);