19
19
using namespace iplug ;
20
20
using namespace igraphics ;
21
21
22
+ const double kDCBlockerFrequency = 5.0 ;
23
+
22
24
// Styles
23
25
const IVColorSpec colorSpec{
24
26
DEFAULT_BGCOLOR, // Background
@@ -345,7 +347,7 @@ void NeuralAmpModeler::ProcessBlock(iplug::sample** inputs, iplug::sample** outp
345
347
irPointers = mIR ->Process (toneStackOutPointers, numChannelsInternal, numFrames);
346
348
347
349
// And the HPF for DC offset (Issue 271)
348
- const double highPassCutoffFreq = 5.0 ;
350
+ const double highPassCutoffFreq = kDCBlockerFrequency ;
349
351
// const double lowPassCutoffFreq = 20000.0;
350
352
const recursive_linear_filter::HighPassParams highPassParams (sampleRate, highPassCutoffFreq);
351
353
// const recursive_linear_filter::LowPassParams lowPassParams(sampleRate, lowPassCutoffFreq);
@@ -369,6 +371,11 @@ void NeuralAmpModeler::ProcessBlock(iplug::sample** inputs, iplug::sample** outp
369
371
void NeuralAmpModeler::OnReset ()
370
372
{
371
373
const auto sampleRate = GetSampleRate ();
374
+ // Tail is because the HPF DC blocker has a decay.
375
+ // 10 cycles should be enough to pass the VST3 tests checking tail behavior.
376
+ // I'm ignoring the model & IR, but it's not the end of the world.
377
+ const int tailCycles = 10 ;
378
+ SetTailSize (tailCycles * (int )(sampleRate / kDCBlockerFrequency ));
372
379
mInputSender .Reset (sampleRate);
373
380
mOutputSender .Reset (sampleRate);
374
381
mCheckSampleRateWarning = true ;
0 commit comments