This commit is contained in:
chriskiefer 2026-03-18 20:07:46 +00:00
parent ecacfb9d0c
commit 56c1189c5e

View file

@ -19,7 +19,7 @@
template<size_t NPARAMS=24> template<size_t NPARAMS=41>
class VerbFXAudioApp : public AudioAppBase<NPARAMS> class VerbFXAudioApp : public AudioAppBase<NPARAMS>
{ {
public: public:
@ -55,11 +55,6 @@ public:
smoother.Process(neuralNetOutputs.data(), smoothParams.data()); smoother.Process(neuralNetOutputs.data(), smoothParams.data());
// float allp1fb = smoothParams[4] * 0.99f;
// float allp2fb = smoothParams[5] * 0.99f;
// float allp3fb = smoothParams[14] * 0.99f;
wetdry_mix_ = (smoothParams[0] * 0.9f) + 0.1f; wetdry_mix_ = (smoothParams[0] * 0.9f) + 0.1f;
const float lp0fb = smoothParams[1] * 0.98f; const float lp0fb = smoothParams[1] * 0.98f;
const float lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f; const float lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;
@ -85,27 +80,80 @@ public:
const float lp7fb = smoothParams[15] * 0.98f; const float lp7fb = smoothParams[15] * 0.98f;
const float lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f; const float lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;
float lp0 = lpcomb0.lpcombfb(mix, SIZE_comb0, lp0fb, lp0cutoff);
float lp1 = lpcomb1.lpcombfb(mix, SIZE_comb1, lp1fb, lp1cutoff);
float lp2 = lpcomb2.lpcombfb(mix, SIZE_comb2, lp2fb, lp2cutoff);
float lp3 = lpcomb3.lpcombfb(mix, SIZE_comb3, lp3fb, lp3cutoff);
float lp4 = lpcomb4.lpcombfb(mix, SIZE_comb4, lp4fb, lp4cutoff);
float lp5 = lpcomb5.lpcombfb(mix, SIZE_comb5, lp5fb, lp5cutoff);
float lp6 = lpcomb6.lpcombfb(mix, SIZE_comb6, lp6fb, lp6cutoff);
float lp7 = lpcomb7.lpcombfb(mix, SIZE_comb7, lp7fb, lp7cutoff);
float y = lp0 + lp1 + lp2 + lp3 + lp4 + lp5 + lp6 + lp7;
const float allp0fb = smoothParams[17] * 0.98f; const float allp0fb = smoothParams[17] * 0.98f;
const float allp1fb = smoothParams[18] * 0.98f; const float allp1fb = smoothParams[18] * 0.98f;
const float allp2fb = smoothParams[19] * 0.98f; const float allp2fb = smoothParams[19] * 0.98f;
const float allp3fb = smoothParams[20] * 0.98f; const float allp3fb = smoothParams[20] * 0.98f;
y = allp0.allpass(y, SIZE_allp0, allp0fb); const float filterBankF0 = 40.f + (smoothParams[21] * 40.f);
y = allp1.allpass(y, SIZE_allp1, allp1fb); const float filterBankF1 = 80.f + (smoothParams[22] * 80.f);
y = allp2.allpass(y, SIZE_allp2, allp2fb); const float filterBankF2 = 160.f + (smoothParams[23] * 160.f);
y = allp3.allpass(y, SIZE_allp3, allp3fb); const float filterBankF3 = 320.f + (smoothParams[24] * 320.f);
const float filterBankF4 = 640.f + (smoothParams[25] * 640.f);
const float filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);
const float filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);
const float filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);
const float filterBankRes0 = 1.f + (smoothParams[29] * 18.f);
const float filterBankRes1 = 1.f + (smoothParams[30] * 18.f);
const float filterBankRes2 = 1.f + (smoothParams[31] * 18.f);
const float filterBankRes3 = 1.f + (smoothParams[32] * 18.f);
const float filterBankRes4 = 1.f + (smoothParams[33] * 18.f);
const float filterBankRes5 = 1.f + (smoothParams[34] * 18.f);
const float filterBankRes6 = 1.f + (smoothParams[35] * 18.f);
const float filterBankRes7 = 1.f + (smoothParams[36] * 18.f);
const float ddelayTime = 10.f + (smoothParams[37] * 8181.f);
const float ddelayFeedback = (smoothParams[38] * 0.98f);
const float filterBankLFOFreq = (smoothParams[39] * 0.5f);
const float filterBankLFODepth = (smoothParams[40] * 0.3f);
float filterBankIn = mix;
float filterBankOut=0;
const float filterBankFreqMod = 1.f + lfo1.sinebuf4(filterBankLFOFreq) * filterBankLFODepth;
filterBankOut = filterBank0.bandpassChamberlain(filterBankIn, filterBankF0 * filterBankFreqMod, filterBankRes0);
filterBankOut += filterBank1.bandpassChamberlain(filterBankIn, filterBankF1 * filterBankFreqMod, filterBankRes1);
filterBankOut += filterBank2.bandpassChamberlain(filterBankIn, filterBankF2 * filterBankFreqMod, filterBankRes2);
filterBankOut += filterBank3.bandpassChamberlain(filterBankIn, filterBankF3 * filterBankFreqMod, filterBankRes3);
filterBankOut += filterBank4.bandpassChamberlain(filterBankIn, filterBankF4 * filterBankFreqMod, filterBankRes4);
filterBankOut += filterBank5.bandpassChamberlain(filterBankIn, filterBankF5 * filterBankFreqMod, filterBankRes5);
filterBankOut += filterBank6.bandpassChamberlain(filterBankIn, filterBankF6 * filterBankFreqMod, filterBankRes6);
filterBankOut += filterBank7.bandpassChamberlain(filterBankIn, filterBankF7 * filterBankFreqMod, filterBankRes7);
filterBankOut *= 0.5f;
float verbIn = filterBankOut;
float verbOut=0.f;
verbOut = lpcomb0.lpcombfb(filterBankOut, SIZE_comb0, lp0fb, lp0cutoff);
verbOut += lpcomb1.lpcombfb(filterBankOut, SIZE_comb1, lp1fb, lp1cutoff);
verbOut += lpcomb2.lpcombfb(filterBankOut, SIZE_comb2, lp2fb, lp2cutoff);
verbOut += lpcomb3.lpcombfb(filterBankOut, SIZE_comb3, lp3fb, lp3cutoff);
verbOut += lpcomb4.lpcombfb(filterBankOut, SIZE_comb4, lp4fb, lp4cutoff);
verbOut += lpcomb5.lpcombfb(filterBankOut, SIZE_comb5, lp5fb, lp5cutoff);
verbOut += lpcomb6.lpcombfb(filterBankOut, SIZE_comb6, lp6fb, lp6cutoff);
verbOut += lpcomb7.lpcombfb(filterBankOut, SIZE_comb7, lp7fb, lp7cutoff);
verbOut = allp0.allpass(verbOut, SIZE_allp0, allp0fb);
verbOut = allp1.allpass(verbOut, SIZE_allp1, allp1fb);
verbOut = allp2.allpass(verbOut, SIZE_allp2, allp2fb);
verbOut = allp3.allpass(verbOut, SIZE_allp3, allp3fb);
float delayed = ddelay.read(ddelayTime);
ddelay.write(filterBankOut + (ddelayFeedback * delayed));
float y= delayed + verbOut;
// Mix dry // Mix dry
@ -162,12 +210,25 @@ protected:
maxiReverbFilters<SIZE_comb6> lpcomb6; maxiReverbFilters<SIZE_comb6> lpcomb6;
maxiReverbFilters<SIZE_comb7> lpcomb7; maxiReverbFilters<SIZE_comb7> lpcomb7;
maxiFilter filterBank0;
maxiFilter filterBank1;
maxiFilter filterBank2;
maxiFilter filterBank3;
maxiFilter filterBank4;
maxiFilter filterBank5;
maxiFilter filterBank6;
maxiFilter filterBank7;
DynamicDelay<8192> ddelay;
maxiDCBlocker dcb; maxiDCBlocker dcb;
float wetdry_mix_{0.5f}; float wetdry_mix_{0.5f};
OnePoleSmoother<kN_Params> smoother{150.f, kSampleRate}; OnePoleSmoother<kN_Params> smoother{150.f, kSampleRate};
maxiOsc lfo1;
}; };
#endif #endif