diff --git a/effect_modulated_chorus.cpp b/effect_modulated_chorus.cpp index 1a2c03b..6f18de6 100644 --- a/effect_modulated_chorus.cpp +++ b/effect_modulated_chorus.cpp @@ -116,18 +116,13 @@ void AudioEffectModulatedDelay::update(void) #ifdef INTERPOLATE // get x/y values around mod_idx - uint16_t i_mod_idx = int(mod_idx + 0.5); uint8_t c = 0; for (j = INTERPOLATION_WINDOW_SIZE / -2; j <= INTERPOLATION_WINDOW_SIZE / 2; j++) { - int16_t ji_mod_idx = i_mod_idx + j; - if (ji_mod_idx > _delay_length) - y[c] = float(_delayline[ji_mod_idx - _delay_length - 1]); - else if (ji_mod_idx < 0) - y[c] = float(_delayline[_delay_length + j + 1]); - else - y[c] = float(_delayline[ji_mod_idx]); - c++; // ;-) + y[c] = float(_delayline[(int(mod_idx + 0.5) + _circ_idx + j) % _delay_length]); + if (y[c] < 0) + y[c] = _delay_length + y[c]; + c++; // because 42 is the answer! ;-) } modulation_interpolate.valueI(mod_idx); diff --git a/mdaEPiano.cpp b/mdaEPiano.cpp index 8d34fa4..91d2740 100644 --- a/mdaEPiano.cpp +++ b/mdaEPiano.cpp @@ -253,7 +253,7 @@ void mdaEPiano::setOverdrive(float value) void mdaEPiano::setLoudness(float value) { //volume = value * 0.32258; // 0.00002 * 127^2 - volume = 0.2f; + volume = value * 0.2f; } void mdaEPiano::setParameter(int32_t index, float value)