frac32.bipolar frequency
frac32.bipolar envelope
frac32.bipolar damping
frac32.bipolar timbre
frac32.bipolar gain
frac32buffer in
frac32buffer out
frac32.u.map frequency
frac32.u.map envelope
frac32.u.map damping
frac32.u.map timbre
frac32.u.map gain
elements::Tube tube;
inline float constrainQ27(int32_t v, float vMin, float vMax) {
return std::max<float>(vMin, std::min<float>(vMax, q27_to_float(v)));
}
inline float constrain(float v, float vMin, float vMax) {
return std::max<float>(vMin, std::min<float>(vMax, v));
}
tube.Init();
static float buf[BUFSIZE];
int i;
for (i = 0; i < BUFSIZE; i++) {
buf[i] = q27_to_float(inlet_in[i]);
}
tube.Process(constrainQ27(param_frequency + inlet_frequency, 0.0000001, 1.0f),
constrainQ27(param_envelope + inlet_envelope, 0.0f, 1.0f),
constrainQ27(param_damping + inlet_damping, 0.0f, 1.0f),
constrainQ27(param_timbre + inlet_timbre, 0.0f, 1.0f), buf,
constrainQ27(param_gain + inlet_gain, 0.0f, 1.0f), BUFSIZE);
for (i = 0; i < BUFSIZE; i++) {
outlet_out[i] = float_to_q27(buf[i]);
}