frac32buffer in
frac32.bipolar frequency
frac32.bipolar dispersion
frac32.bipolar brightness
frac32.bipolar damping
frac32.bipolar position
frac32buffer l
frac32buffer r
frac32.u.map frequency
frac32.u.map dispersion
frac32.u.map brightness
frac32.u.map damping
frac32.u.map position
combo dispersion
elements::String string;
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));
}
string.Init(attr_dispersion);
static float in[BUFSIZE];
static float out[BUFSIZE];
static float aux[BUFSIZE];
int i;
for (i = 0; i < BUFSIZE; i++) {
in[i] = q27_to_float(inlet_in[i]);
}
string.set_frequency(constrainQ27(param_frequency + inlet_frequency, 0.0000001,
1.0f));
string.set_brightness(constrainQ27(param_brightness + inlet_brightness, 0.0f,
1.0f));
string.set_damping(constrainQ27(param_damping + inlet_damping, 0.0f, 1.0f));
string.set_position(constrainQ27(param_position + inlet_position, 0.0f, 1.0f));
// dispersion blows up ~ > 0.2
string.set_dispersion(constrainQ27(
q27_to_float(param_dispersion + inlet_dispersion) * 0.20f, 0.0f, 0.20f));
string.Process(in, out, aux, BUFSIZE);
for (i = 0; i < BUFSIZE; i++) {
outlet_l[i] = float_to_q27(out[i]);
outlet_r[i] = float_to_q27(aux[i]);
}