frac32buffer filter input
frac32 pitch
frac32 filter resonance
frac32buffer filter output
frac32.s.map.pitch pitch
frac32.u.map.filterq reso
frac32.s.map gain
int32.hradio mode
biquad_state bs;
biquad_coefficients bc;
biquad_state Bs;
biquad_coefficients Bc;
int32_t freq;
int i;
int32_t out[BUFSIZE];
int32_t filter(int32_t FREQ, int32_t RESO, int32_t MODE) {
switch (MODE > 0 ? MODE : 0) {
case 0:
biquad_lp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 1:
biquad_hp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 2:
biquad_bp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 3:
biquad_bp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 4:
biquad_bp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 5:
biquad_lp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 6:
biquad_hp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 7:
biquad_lp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 8:
biquad_lp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
case 9:
biquad_hp_coefs(&bc, FREQ, INT_MAX - (__USAT(RESO, 27) << 4));
break;
}
};
biquad_clearstate(&bs);
biquad_clearstate(&Bs);
int32_t mode = param_mode;
int32_t gain = param_gain;
int32_t reso = inlet_reso + param_reso;
MTOF(param_pitch + inlet_pitch, freq);
filter(freq, reso, mode);
biquad_dsp(&bs, &bc, inlet_in, outlet_out);
switch (mode > 0 ? mode : 0) {
case 0:;
break;
case 1:;
break;
case 2:;
break;
case 3:
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] -= inlet_in[i];
};
break;
case 4:
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] = inlet_in[i] + ___SMMUL(outlet_out[i] << 2, gain << 3);
};
break;
case 5:
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] = inlet_in[i] + ___SMMUL(outlet_out[i] << 2, gain << 3);
};
break;
case 6:
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] = inlet_in[i] + ___SMMUL(outlet_out[i] << 2, gain << 3);
};
break;
case 7:
for (i = 0; i < BUFSIZE; i++) {
out[i] = outlet_out[i];
}
biquad_hp_coefs(&Bc, freq, INT_MAX - (__USAT(reso, 27) << 4));
biquad_dsp(&Bs, &Bc, inlet_in, outlet_out);
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] -= out[i];
};
break;
case 8:
for (i = 0; i < BUFSIZE; i++) {
out[i] = outlet_out[i];
}
biquad_bp_coefs(&Bc, freq, INT_MAX - (__USAT(reso, 27) << 4));
biquad_dsp(&Bs, &Bc, inlet_in, outlet_out);
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] -= out[i] + ___SMMUL(param_gain << 3, inlet_in[i] << 2);
};
break;
case 9:
for (i = 0; i < BUFSIZE; i++) {
out[i] = outlet_out[i];
}
biquad_bp_coefs(&Bc, freq, INT_MAX - (__USAT(reso, 27) << 4));
biquad_dsp(&Bs, &Bc, inlet_in, outlet_out);
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] -= out[i] + ___SMMUL(param_gain << 3, inlet_in[i] << 2);
};
break;
}