|
|
|
@ -90,7 +90,8 @@ void AudioEffectModulatedDelay::update(void) |
|
|
|
|
float mod_idx; |
|
|
|
|
float mod_number; |
|
|
|
|
float mod_fraction; |
|
|
|
|
|
|
|
|
|
float modulation_f32[AUDIO_BLOCK_SAMPLES]; |
|
|
|
|
|
|
|
|
|
bp = block->data; |
|
|
|
|
arm_q15_to_float(modulation->data, modulation_f32, AUDIO_BLOCK_SAMPLES); |
|
|
|
|
mp = modulation_f32; |
|
|
|
@ -115,15 +116,15 @@ void AudioEffectModulatedDelay::update(void) |
|
|
|
|
c_mod_idx += _delay_length; |
|
|
|
|
|
|
|
|
|
// linear interpolation
|
|
|
|
|
if (c_mod_idx < 1) |
|
|
|
|
if (c_mod_idx == 0) |
|
|
|
|
{ |
|
|
|
|
idx[0] = _delay_length - 1; |
|
|
|
|
idx[1] = 0; |
|
|
|
|
} |
|
|
|
|
else if (c_mod_idx + 1 >= _delay_length) |
|
|
|
|
else if (c_mod_idx == _delay_length - 1) |
|
|
|
|
{ |
|
|
|
|
idx[0] = 0; |
|
|
|
|
idx[1] = c_mod_idx; |
|
|
|
|
idx[1] = _delay_length - 1; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -131,9 +132,9 @@ void AudioEffectModulatedDelay::update(void) |
|
|
|
|
idx[1] = c_mod_idx + 1; |
|
|
|
|
} |
|
|
|
|
if (mod_idx < 0.0) |
|
|
|
|
*bp = round(float(_delayline[idx[0]]) * (1.0 - mod_fraction) + float(_delayline[idx[1]]) * mod_fraction); |
|
|
|
|
*bp = round(float(_delayline[idx[0]]) * fabs(mod_fraction) + float(_delayline[idx[1]]) * (1.0 - fabs(mod_fraction))); |
|
|
|
|
else |
|
|
|
|
*bp = round(float(_delayline[idx[0]]) * mod_fraction + float(_delayline[idx[1]]) * (1.0 - mod_fraction)); |
|
|
|
|
*bp = round(float(_delayline[idx[0]]) * (1.0 - mod_fraction) + float(_delayline[idx[1]]) * mod_fraction); |
|
|
|
|
|
|
|
|
|
// push the pointers forward
|
|
|
|
|
bp++; // next audio data
|
|
|
|
|