diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2018-06-27 00:17:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-27 00:17:53 +0200 |
commit | 35fa2e3b263a64063a42e279ed62c0190639b054 (patch) | |
tree | bbe477796e74e9c07b9498fc47e09d90b1f35c3f /lib | |
parent | 9da873a777a147a3afadfb3a988ec42112359d1e (diff) | |
parent | 21497c0cf47fad06e1c6aaa3f5b791e00a7c1fbe (diff) |
Merge pull request #1710 from Be-ing/ramping_fixes_2
Effects ramping fixes
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; |