aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/chorus.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-05-26 09:07:27 -0700
committerChris Robinson <[email protected]>2017-05-26 09:09:35 -0700
commit653f0a1405b5dbceab6c2d8adc8fa246bdb5f607 (patch)
treed13ecb71a49fab095e088b22e7b8133731170974 /Alc/effects/chorus.c
parent2b14c1d62389f3bb8fe52cac9b8d3cc97da0838f (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/chorus.c')
-rw-r--r--Alc/effects/chorus.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c
index 21db73f6..62f2e531 100644
--- a/Alc/effects/chorus.c
+++ b/Alc/effects/chorus.c
@@ -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));
}
}