frac32.positive brill
frac32.bipolar pitch
frac32buffer.bipolar wave
frac32.s.map.pitch pitch
frac32.u.map brill
const int N = 2;
// Saw
float p, dp;
float slope, _slope_1;
p = 0.0f;
int32_t idp;
MTOFEXTENDED(param_pitch + inlet_pitch, idp);
dp = idp * (0.25f / (1 << 30));
float coef = 1.0f + 15 - (param_brill + inlet_brill) * (15.0f / (1 << 27));
if (coef < 1)
coef = 1;
slope = (N * dp * coef > 0.5f) ? 2.0f : 1.0f / (1.0f - N * dp * coef);
_slope_1 = 1.0f / (slope - 1.0f);
p += dp;
p -= (p > 1);
float x = p * slope;
if (x > 1) { // ]1, slope] -> ]1, 0]
x = (slope - x) * _slope_1;
}
x = 2 * x - 1;
x = 0.5f * x * (3 - x * x);
outlet_wave = (int32_t)(x * (1 << 27));