bool32.rising trigger
bool32.rising reset
int32 max
frac32 stepsize
int32 output
int32 max
bool32.pulse carry pulse
int32 maximum
frac32.u.map.gain stepsize
int ntrig;
int rtrig;
int count;
count = 0;
ntrig = 0;
rtrig = 0;
outlet_c = 0;
int max = inlet_max;
if ((inlet_trig > 0) && !ntrig) {
count += 1;
if (count >= max) {
count = 0;
outlet_c = 1;
}
ntrig = 1;
} else if (!(inlet_trig > 0))
ntrig = 0;
if ((inlet_r > 0) && !rtrig) {
count = 0;
rtrig = 1;
} else if (!(inlet_r > 0))
rtrig = 0;
int cnt = count;
int32_t stepsize = param_stepsize + (inlet_stepsize << 4);
stepsize = stepsize > 0 ? stepsize : -stepsize;
cnt = count * (___SMMUL(stepsize, param_maximum) << 1);
cnt = cnt - cnt / param_maximum * param_maximum;
outlet_o = cnt;
outlet_max = param_maximum;