frac32buffer carrier
frac32buffer modulator
frac32.bipolar release
frac32.bipolar formant
frac32buffer out
frac32.u.map release
frac32.u.map formant
inline float constrainQ27(int32_t v, float vMin, float vMax) {
return std::max<float>(vMin, std::min<float>(vMax, q27_to_float(v)));
}
warps_deriv::Vocoder vocoder;
vocoder.Init(48000);
float fmod[BUFSIZE];
float fcar[BUFSIZE];
float fout[BUFSIZE];
int i;
for (i = 0; i < BUFSIZE; i++) {
fmod[i] = q27_to_float(inlet_modulator[i]);
fcar[i] = q27_to_float(inlet_carrier[i]);
}
vocoder.set_release_time(constrainQ27(param_release + inlet_release, 0.0f,
1.0f));
vocoder.set_formant_shift(constrainQ27(param_formant + inlet_formant, 0.0f,
1.0f));
vocoder.Process(&fmod[0], &fcar[0], &fout[0], BUFSIZE);
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] = float_to_q27(fout[i]);
}