|
|
@ -352,8 +352,10 @@ void mdaEPiano::process(int16_t *outputs_r, int16_t *outputs_l) |
|
|
|
V->pos -= V->loop; |
|
|
|
V->pos -= V->loop; |
|
|
|
i = waves[V->pos] + ((V->frac * (waves[V->pos + 1] - waves[V->pos])) >> 16); |
|
|
|
i = waves[V->pos] + ((V->frac * (waves[V->pos + 1] - waves[V->pos])) >> 16); |
|
|
|
x = V->env * static_cast<float>(i) / 32768.0f; |
|
|
|
x = V->env * static_cast<float>(i) / 32768.0f; |
|
|
|
|
|
|
|
|
|
|
|
V->env = V->env * V->dec; //envelope
|
|
|
|
V->env = V->env * V->dec; //envelope
|
|
|
|
if (x > 0.0f) { |
|
|
|
if (x > 0.0f) |
|
|
|
|
|
|
|
{ |
|
|
|
x -= od * x * x; //overdrive
|
|
|
|
x -= od * x * x; //overdrive
|
|
|
|
if (x < -V->env) x = -V->env; |
|
|
|
if (x < -V->env) x = -V->env; |
|
|
|
} |
|
|
|
} |
|
|
@ -373,8 +375,8 @@ void mdaEPiano::process(int16_t *outputs_r, int16_t *outputs_l) |
|
|
|
l += l * lmod * lfo1; |
|
|
|
l += l * lmod * lfo1; |
|
|
|
r += r * rmod * lfo1; //worth making all these local variables?
|
|
|
|
r += r * rmod * lfo1; //worth making all these local variables?
|
|
|
|
|
|
|
|
|
|
|
|
outputs_l[frame] = static_cast<int16_t>(l) >> REDUCE_LOUDNESS; |
|
|
|
outputs_l[frame] = static_cast<int16_t>(l * 0x7fff) >> REDUCE_LOUDNESS; |
|
|
|
outputs_r[frame] = static_cast<int16_t>(r) >> REDUCE_LOUDNESS; |
|
|
|
outputs_r[frame] = static_cast<int16_t>(r * 0x7fff) >> REDUCE_LOUDNESS; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (fabs(tl) < 1.0e-10) tl = 0.0f; //anti-denormal
|
|
|
|
if (fabs(tl) < 1.0e-10) tl = 0.0f; //anti-denormal
|
|
|
|