Fix handling chorus and flanger LFO displacement offset

The phase offset is modulo-wrapped rather than masked, so it's best to avoid
negative offsets.
This commit is contained in:
Chris Robinson
2017-05-26 09:07:27 -07:00
parent 2b14c1d623
commit 653f0a1405
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -165,7 +165,10 @@ static ALvoid ALchorusState_update(ALchorusState *state, const ALCdevice *Device
}
/* Calculate lfo phase displacement */
state->lfo_disp = fastf2i(state->lfo_range * (phase/360.0f));
if(phase >= 0)
state->lfo_disp = fastf2i(state->lfo_range * (phase/360.0f));
else
state->lfo_disp = fastf2i(state->lfo_range * ((360+phase)/360.0f));
}
}
+4 -1
View File
@@ -165,7 +165,10 @@ static ALvoid ALflangerState_update(ALflangerState *state, const ALCdevice *Devi
}
/* Calculate lfo phase displacement */
state->lfo_disp = fastf2i(state->lfo_range * (phase/360.0f));
if(phase >= 0)
state->lfo_disp = fastf2i(state->lfo_range * (phase/360.0f));
else
state->lfo_disp = fastf2i(state->lfo_range * ((360+phase)/360.0f));
}
}