Attempt to "fade in" phase resets on return to unity, so as to return to an approximate pass-through without too audible a click

This commit is contained in:
Chris Cannam
2022-06-17 15:01:26 +01:00
parent bcdd1149df
commit 380cad53b4
4 changed files with 104 additions and 30 deletions

View File

@@ -186,19 +186,20 @@ public:
++phaseLockBand;
}
double ph = 0.0;
if (inhop == outhop) {
ph = m_unlocked[c][i];
} else if (inRange(f, g->phaseReset) || inRange(f, g->kick)) {
if (inRange(f, g->phaseReset) || inRange(f, g->kick)) {
ph = phase[c][i];
} else if (inhop == outhop) {
ph = m_unlocked[c][i];
} else if (inRange (f, g->highUnlocked)) {
ph = m_unlocked[c][i];
} else {
int peak = m_currentPeaks[c][i];
int prevPeak = m_prevPeaks[c][peak];
int peakCh = c;
if (inRange (f, g->channelLock)) {
if (inRange(f, g->channelLock)) {
int other = m_greatestChannel[i];
if (other != c) {
if (other != c &&
inRange(f, guidance[other]->channelLock)) {
int otherPeak = m_currentPeaks[other][i];
int otherPrevPeak = m_prevPeaks[other][otherPeak];
if (otherPrevPeak == prevPeak) {
@@ -216,7 +217,7 @@ public:
double(g->phaseLockBands[phaseLockBand].beta);
ph = peakNew + beta * diff;
}
outPhase[c][i] = ph;
outPhase[c][i] = princarg(ph);
}
}