diff options
author | Chris Robinson <[email protected]> | 2017-05-26 09:07:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-05-26 09:09:35 -0700 |
commit | 653f0a1405b5dbceab6c2d8adc8fa246bdb5f607 (patch) | |
tree | d13ecb71a49fab095e088b22e7b8133731170974 /Alc/effects/flanger.c | |
parent | 2b14c1d62389f3bb8fe52cac9b8d3cc97da0838f (diff) |
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.
Diffstat (limited to 'Alc/effects/flanger.c')
-rw-r--r-- | Alc/effects/flanger.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index 5593d549..d330511a 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -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)); } } |