Add need_cleanup flag for reverb

The cleanup() overwrites about 120kbytes of memory, which may affect the GUI speed on slower PIs. It is better to run it before audio processing.
pull/883/head
Gergo Koteles 2 weeks ago
parent fb89954716
commit 18a313671f
  1. 6
      src/effect_platervbstereo.cpp
  2. 2
      src/effect_platervbstereo.h
  3. 2
      src/minidexed.cpp

@ -228,6 +228,12 @@ void AudioEffectPlateReverb::doReverb(const float32_t* inblockL, const float32_t
rv_time = rv_time_k;
if (need_cleanup)
{
cleanup();
need_cleanup = false;
}
for (uint16_t i=0; i < len; i++)
{
// do the LFOs

@ -106,8 +106,10 @@ public:
float32_t get_size(void) {return rv_time_k;}
float32_t get_level(void) {return reverb_level;}
void set_need_cleanup(void) {need_cleanup = true;};
void cleanup(void);
private:
bool need_cleanup = false;
float32_t reverb_level;
float32_t input_attn;

@ -1015,7 +1015,7 @@ void CMiniDexed::SetParameter (TParameter Parameter, int nValue)
nValue=constrain((int)nValue,0,1);
m_ReverbSpinLock.Acquire ();
if (nValue)
reverb->cleanup ();
reverb->set_need_cleanup ();
m_ReverbSpinLock.Release ();
break;

Loading…
Cancel
Save