frac32 phase
frac32 lvl
frac32 o1
frac32 o2
frac32 o3
frac32 o4
frac32.u.map.gain width
frac32.u.map.gain start
frac32.u.map.gain spread
uint32_t Phase;
int r = 1;
int32_t lvl;
int32_t SHAPE(int32_t in, int32_t width, int32_t start, int32_t spread,
int nr) {
float32_t ratio = (float32_t)(lvl) / width;
in += start;
in += spread * nr;
in = (in > 0 ? -in : in) + width >> 4;
return in = (int32_t)(in > 0 ? in * ratio : 0) << 1;
}
Phase = 0;
Phase = inlet_phase << 4;
int32_t strt = param_start << 1;
int32_t sprd = param_spread << 1;
lvl = inlet_lvl << 3;
outlet_o1 = SHAPE(Phase, param_width, strt, sprd, 0);
outlet_o2 = SHAPE(Phase, param_width, strt, sprd, 1);
outlet_o3 = SHAPE(Phase, param_width, strt, sprd, 2);
outlet_o4 = SHAPE(Phase, param_width, strt, sprd, 3);