frac32buffer trig
frac32buffer o
frac32.s.map rate
frac32.s.map.pitch slew
int ntrig;
int count;
int cnt;
uint32_t val;
int32_t v26 = 1 << 26;
int32_t vel;
count = 0;
ntrig = 0;
cnt = 0;
int32_t slew;
MTOFEXTENDED(param_slew, slew)
int32_t rate;
MTOFEXTENDED(param_rate, rate)
rate = rate >> 2;
val = __USAT(val - rate, 31);
if ((inlet_trig > 0) && !ntrig) {
count += 1;
if (count >= 1 << cnt) {
cnt += 1;
count = 0;
if (val < 1) {
vel = vel > 0 ? -v26 : v26;
val = 1 << 30;
count = 0;
cnt = 0;
}
}
ntrig = 1;
} else if (!(inlet_trig > 0))
ntrig = 0;
outlet_o = vel;