fix pitch feedback loop; tune analyzer UI and dry/wet reflection

This commit is contained in:
Armin 2026-08-10 15:36:11 +02:00
commit 2359bfd579
5 changed files with 57 additions and 33 deletions

View file

@ -182,13 +182,11 @@ void HorizontEngine::processSample (float inL, float inR, float& outL, float& ou
const float loopInvRt = invRt * (1.0f - 0.7f * fbGain);
const float gMax = std::exp (-6.907755f * baseLen[0] * sizeCur * loopInvRt);
const float shiftOutL = shiftL.process (lastWetL, ratio);
const float shiftOutR = shiftR.process (lastWetR, ratio);
const float fbL = fl + fbGain * 0.5f * (1.0f - gMax) * shiftL.process (lastWetL, ratio);
const float fbR = fr + fbGain * 0.5f * (1.0f - gMax) * shiftR.process (lastWetR, ratio);
const float dL = diffL2.process (diffL1.process (fbL, diffG), diffG);
const float dR = diffR2.process (diffR1.process (fbR, diffG), diffG);
const float dL = diffL2.process (diffL1.process (fl, diffG), diffG);
const float dR = diffR2.process (diffR1.process (fr, diffG), diffG);
float wetL = 0.0f;
float wetR = 0.0f;
@ -204,6 +202,14 @@ void HorizontEngine::processSample (float inL, float inR, float& outL, float& ou
wetR += 0.25f * combR[(size_t) i].process (dR, lenR, dampC, gainR);
}
// recirculate the shifted wet outside the comb bank: loop gain is exactly
// fbGain (< 1) so it cannot self-oscillate; gated off at 0 semitones
if (std::fabs (ratio - 1.0f) > 1e-4f)
{
wetL += fbGain * shiftOutL;
wetR += fbGain * shiftOutR;
}
wetL = dcL.process (wetL);
wetR = dcR.process (wetR);