attack decay envelope with modulation inputs Ricardo Wurmus GPL env.axh 0) && !ntrig) { ntrig = 1; stage = 1; } else if (!(inlet_trig>0)) { ntrig = 0; } // decay if (stage == 0) { val = ___SMMLA(val,(-1<<26)+(param_d>>1)+(inlet_d>>1),val); // attack } else { int32_t a; MTOF(- param_a - inlet_a,a); // shift to let val rise more slowly a = a >> 4; val = val + a; // switch to decay phase at max if (val > 0x07FFFFFF) { val = 0x07FFFFFF; stage = 0; } } outlet_env = val; ]]>