Skip to content

Commit 7f2079d

Browse files
committed
Apply ringout for convolution.
1 parent f34746d commit 7f2079d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/common/dsp/effects/ConvolutionEffect.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@ void ConvolutionEffect::init_default_values()
205205
fxdata->p[convolution_mix].val.f = 1.f;
206206
}
207207

208+
int ConvolutionEffect::get_ringout_decay()
209+
{
210+
if (!initialized)
211+
return 0;
212+
213+
return std::ceil(static_cast<float>(irSize_ + delayTime_.v) / static_cast<float>(BLOCK_SIZE));
214+
}
215+
208216
void ConvolutionEffect::process(float *dataL, float *dataR)
209217
{
210218
if (!initialized)
@@ -307,6 +315,7 @@ void ConvolutionEffect::prep_ir()
307315
}
308316

309317
normalize(irLsub, irRsub);
318+
irSize_ = irLsub.size();
310319
s = s && convolverL_.init(std::max(BLOCK_SIZE, 16), 256, irLsub);
311320
s = s && convolverR_.init(std::max(BLOCK_SIZE, 16), 256, irRsub);
312321
if (!s)

src/common/dsp/effects/ConvolutionEffect.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class ConvolutionEffect : public Effect
5858
void init() override;
5959
void init_ctrltypes() override;
6060
void init_default_values() override;
61+
int get_ringout_decay() override;
6162
void process(float *dataL, float *dataR) override;
6263

6364
private:
@@ -66,6 +67,7 @@ class ConvolutionEffect : public Effect
6667

6768
pffft::TwoStageConvolver convolverL_;
6869
pffft::TwoStageConvolver convolverR_;
70+
std::size_t irSize_;
6971
alignas(16) std::array<float, BLOCK_SIZE> workL_;
7072
alignas(16) std::array<float, BLOCK_SIZE> workR_;
7173
alignas(16) std::array<float, BLOCK_SIZE> delayedL_;

0 commit comments

Comments
 (0)