Chorus fixes.

master
Holger Wirtz 5 years ago
parent c2549adcab
commit 9cad9262d5
  1. 11
      effect_modulated_delay.cpp
  2. 1
      effect_modulated_delay.h

@ -90,6 +90,7 @@ 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);
@ -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

@ -60,7 +60,6 @@ class AudioEffectModulatedDelay :
arm_biquad_casd_df1_inst_f32 filter_lp_mod;
float filter_lp_state[4];
float filter_lp_coeffs[5];
float modulation_f32[AUDIO_BLOCK_SAMPLES];
#endif
};

Loading…
Cancel
Save