tube

waveguide tube from the elements dsp code open sourced by mutable instruments. any bugs/issues you find are our own, report on the axoloti forum. Thanks to Olivier Gillet from Mutable Instruments for open sourcing their code. http://mutable-instruments.com
Author: Mark Harris
License: GPL
Github: fx/lmnts/tube.axo

Inlets

frac32.bipolar frequency

frac32.bipolar envelope

frac32.bipolar damping

frac32.bipolar timbre

frac32.bipolar gain

frac32buffer in

Outlets

frac32buffer out

Parameters

frac32.u.map frequency

frac32.u.map envelope

frac32.u.map damping

frac32.u.map timbre

frac32.u.map gain

Declaration
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));
}
Init
tube.Init();
Control Rate
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]);
}

Privacy

© 2024 Zrna Research