21 return static_cast<float>(val) * (1.0f / 127.0f);
26 return static_cast<float>(val) * (1.0f / 65535.0f);
31 return static_cast<float>(val) * (1.0f / 16383.0f);
37inline constexpr float map_linear(
float t,
float min,
float max) {
38 return min + (max - min) * t;
44 return min + (max - min) * t * t;
49inline constexpr float map_scurve(
float t,
float min,
float max) {
50 float s = t * t * (3.0f - 2.0f * t);
51 return min + (max - min) * s;
DSP atoms for audio signal processing.
constexpr float map_scurve(float t, float min, float max)
constexpr float u14_to_float(uint16_t val)
Normalize 14-bit MIDI (0-16383) to [0.0, 1.0] (pitch bend, NRPN)
constexpr float map_quadratic(float t, float min, float max)
constexpr float map_linear(float t, float min, float max)
Linear mapping: t → min + (max - min) * t.
constexpr float cc_to_float(uint8_t val)
Normalize MIDI CC (0-127) to [0.0, 1.0].
constexpr float u16_to_float(uint16_t val)
Normalize 16-bit unsigned (0-65535) to [0.0, 1.0].