diff options
author | Be <be@mixxx.org> | 2018-06-04 07:36:16 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2018-06-04 07:40:35 -0500 |
commit | 9e05a18c2e27dcf7c3ebd27ff9aa649d2040c195 (patch) | |
tree | 2843379fd5d22029ff9b3ef3504da2696956c349 /lib/reverb | |
parent | f3a1442138ea0a93374bd09dcd73ee2206235671 (diff) |
remove Reverb Dry/Wet parameter and restore old mixing behavior
2b72491ee2a0bd761e0d68600b62ebbb3b89dc6c changed the Reverb effect so
that the dry signal was not passed through when the effect unit was in
D+W mode. A new dry/wet parameter was added to compensate for this in
fd25553f2905c07165980084914ed648fe6dfa81 so there would still be a way
to adjust the relative prominence of Reverb in a D+W chain. However, no
change to the mixing of Reverb was needed in the first place. Simply
keeping the dry signal with a Send parameter works in both D/W and D+W
modes.
Diffstat (limited to 'lib/reverb')
-rw-r--r-- | lib/reverb/Reverb.cc | 53 | ||||
-rw-r--r-- | lib/reverb/Reverb.h | 25 |
2 files changed, 42 insertions, 36 deletions
diff --git a/lib/reverb/Reverb.cc b/lib/reverb/Reverb.cc index 67f4b0ec1c..30b5dad5dd 100644 --- a/lib/reverb/Reverb.cc +++ b/lib/reverb/Reverb.cc @@ -433,29 +433,32 @@ Descriptor<PlateX2>::setup() // (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, double wet) { - // set bandwidth - input.bandwidth.set(exp(-M_PI * (1. - (.005 + .994*bandwidthParam)))); - // set decay - sample_t decay = .890*decayParam; - // set damping - 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); - - // 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 xl, xr; - PlateStub::process(mono_sample, decay, &xl, &xr); - out[i] = (xl * wet) + (in[i] * (1 - wet)); - out[i + 1] = (xr * wet) + (in[i + 1] * (1 - wet)); - } -} +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) { + // set bandwidth + input.bandwidth.set(exp(-M_PI * (1. - (.005 + .994*bandwidthParam)))); + // set decay + sample_t decay = .890*decayParam; + // set damping + 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); + + // 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 xl, xr; + PlateStub::process(mono_sample, decay, &xl, &xr); + out[i] = xl + in[i]; + out[i + 1] = xr + in[i + 1]; + } + } diff --git a/lib/reverb/Reverb.h b/lib/reverb/Reverb.h index c40a108b46..ac50cc9bd0 100644 --- a/lib/reverb/Reverb.h +++ b/lib/reverb/Reverb.h @@ -221,16 +221,19 @@ class PlateX2 #endif /// (timrae) Define our own interface instead of using the original LADSPA plugin interface -class MixxxPlateX2 : public PlateStub { - public: - void 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, double wet); - - void init(float sampleRate) { - fs = sampleRate; - PlateStub::init(); - PlateStub::activate(); - } -}; + class MixxxPlateX2 : public PlateStub { + public: + void 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); + + void init(float sampleRate) { + fs = sampleRate; + PlateStub::init(); + PlateStub::activate(); + } + }; #endif /* REVERB_H */ |