The impulse trigger responsible for the amp trigger doesn’t work when executing the synthdef
I need to execute the w.set amptrigrate …weird since the initial argument for amptrigrate is 4/2 (2 hertz)
Here is the code
(
SynthDef(\effem,
{
arg moddetune=1,modratio=2,modtrigrate=1,carrierratio=1,carrierdetune=(-1),moddepth=8,att=2,decay=0.5,ampatt=0.001,ampdec=0.250,amptrigrate=4/2;
var mod,carrier,modenv;
mod=SinOsc.ar(220+moddetune*modratio);
modenv=EnvGen.ar(Env([0,1,0],[att,decay],[0,-2]),doneAction:0,gate:Impulse.ar(modtrigrate));
mod=(moddepth*mod)*modenv;
carrier=SinOsc.ar(220+carrierdetune*carrierratio,mod)*0.3;
carrier=carrier*EnvGen.ar(Env([0,1,0],[ampatt,ampdec],[0,-2]),doneAction:00,gate:Impulse.ar(amptrigrate))!2;
Out.ar(0,carrier);
}).add
)
w=Synth(\effem);
w.free;
w.set(\modtrigrate,4/2);
w.set(\amptrigrate,8/2);////////have to execute this line
w.set(\ampatt,0.001);
w.set(\ampatt,0.250);
w.set(\ampdec,1);
w.set(\ampdec,0.125);
w.set(\decay,0.5);
w.set(\at,0.001);
w.set(\moddepth,10)
w.set(\moddepth,5);
w.set(\moddepth,2);
w.set(\moddepth,100,\modratio,2,\moddetune,6,\carrierratio,1,\att,5,\decay,8);///lots of parameters in one
//////////