diff options
author | Be <be@mixxx.org> | 2018-06-12 17:46:32 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2018-06-12 18:51:00 -0500 |
commit | 21497c0cf47fad06e1c6aaa3f5b791e00a7c1fbe (patch) | |
tree | 04f9d67092cc2061a09745b7a5ac338e5ce99cb9 /lib | |
parent | 397c7769519672d544b3984e0e910a252e68ee3b (diff) |
make Reverb effect handle its own ramping on/off
This fixes a pop sound when enabling/disabling the effect in a D+W mode
chain.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reverb/Reverb.cc | 10 | ||||
-rw-r--r-- | lib/reverb/Reverb.h | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/reverb/Reverb.cc b/lib/reverb/Reverb.cc index ca5b8f03f8..98b204d886 100644 --- a/lib/reverb/Reverb.cc +++ b/lib/reverb/Reverb.cc @@ -431,13 +431,14 @@ Descriptor<PlateX2>::setup() #endif - +#include <util/rampingvalue.h> // (timrae) we have our left / right samples interleaved in the same array, so use slightly modified version of PlateX2::cycle void MixxxPlateX2::processBuffer(const sample_t* in, sample_t* out, const uint frames, const sample_t bandwidthParam, const sample_t decayParam, const sample_t dampingParam, - const sample_t blendParam) { + const sample_t currentSend, + const sample_t previousSend) { // set bandwidth input.bandwidth.set(exp(-M_PI * (1. - (.005 + .994*bandwidthParam)))); // set decay @@ -446,15 +447,14 @@ void MixxxPlateX2::processBuffer(const sample_t* in, sample_t* out, const uint f double damp = exp(-M_PI * (.0005+.9995*dampingParam)); tank.damping[0].set(damp); tank.damping[1].set(damp); - // set blend - sample_t blend = pow(blendParam, 1.53); + RampingValue<sample_t> send(pow(currentSend, 1.53), previousSend, frames); // the modulated lattices interpolate, which needs truncated float DSP::FPTruncateMode _truncate; // loop through the buffer, processing each sample for (uint i = 0; i + 1 < frames; i += 2) { - sample_t mono_sample = blend * (in[i] + in[i + 1]) / 2; + sample_t mono_sample = send.getNext() * (in[i] + in[i + 1]) / 2; PlateStub::process(mono_sample, decay, &out[i], &out[i+1]); } } diff --git a/lib/reverb/Reverb.h b/lib/reverb/Reverb.h index ac50cc9bd0..ac8821124a 100644 --- a/lib/reverb/Reverb.h +++ b/lib/reverb/Reverb.h @@ -227,7 +227,8 @@ class PlateX2 const sample_t bandwidthParam, const sample_t decayParam, const sample_t dampingParam, - const sample_t blendParam); + const sample_t currentSend, + const sample_t previousSend); void init(float sampleRate) { fs = sampleRate; |