Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an Init Delay Timing Condition #1453

Merged
merged 1 commit into from
Jan 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/common/SurgeStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ SurgeStorage::SurgeStorage(std::string suppliedDataPath)
last_key[0] = 60;
last_key[1] = 60;
temposyncratio = 1.f;
temposyncratio_inv = 0.0f; // Use this as a sentinel (since it was not initialized prior to 1.6.5 this was the value at least win and mac had). #1444

songpos = 0;

for (int i = 0; i < n_customcontrollers; i++)
Expand Down
12 changes: 12 additions & 0 deletions src/common/dsp/effect/DualDelayEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,22 @@ void DualDelayEffect::init()
lp.suspend();
hp.suspend();
setvars(true);
inithadtempo = true;
// See issue #1444 and the fix for this stuff
if( storage->temposyncratio_inv == 0 )
{
inithadtempo = false;
}
}

void DualDelayEffect::setvars(bool init)
{
if( ! inithadtempo && storage->temposyncratio_inv != 0 )
{
init = true;
inithadtempo = true;
}

float fb = amp_to_linear(*f[2]);
float cf = amp_to_linear(*f[3]);

Expand Down
14 changes: 14 additions & 0 deletions src/common/dsp/effect/FreqshiftEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,24 @@ void FreqshiftEffect::init()
fi.reset();
ringout = 10000000;
setvars(true);

inithadtempo = true;
// See issue #1444 and the fix for this stuff
if( storage->temposyncratio_inv == 0 )
{
inithadtempo = false;
}

}

void FreqshiftEffect::setvars(bool init)
{
if( ! inithadtempo && storage->temposyncratio_inv != 0 )
{
init = true;
inithadtempo = true;
}

feedback.newValue(amp_to_linear(*f[fsp_feedback]));

if (init)
Expand Down
2 changes: 2 additions & 0 deletions src/common/dsp/effect/effect_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class DualDelayEffect : public Effect

private:
lag<float, true> timeL, timeR;
bool inithadtempo;
float envf;
int wpos;
BiquadFilter lp, hp;
Expand Down Expand Up @@ -121,6 +122,7 @@ class FreqshiftEffect : public Effect
private:
lipol<float, true> feedback;
lag<float, true> time, shiftL, shiftR;
bool inithadtempo;
float buffer[2][max_delay_length];
int wpos;
// CHalfBandFilter<6> frL,fiL,frR,fiR;
Expand Down