mirror of
https://codeberg.org/armin/horizont.git
synced 2026-09-01 04:10:46 +02:00
fix pitch feedback loop; tune analyzer UI and dry/wet reflection
This commit is contained in:
parent
b1b83104a7
commit
2359bfd579
5 changed files with 57 additions and 33 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue