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