aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/modulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/effects/modulator.c')
-rw-r--r--Alc/effects/modulator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c
index f97f7572..7f1a2cad 100644
--- a/Alc/effects/modulator.c
+++ b/Alc/effects/modulator.c
@@ -137,8 +137,7 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext
else /*if(Slot->Params.EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SQUARE)*/
state->GetSamples = ModulateSquare;
- state->step = fastf2i(props->Modulator.Frequency*WAVEFORM_FRACONE /
- device->Frequency);
+ state->step = float2int(props->Modulator.Frequency*WAVEFORM_FRACONE/device->Frequency + 0.5f);
state->step = clampi(state->step, 1, WAVEFORM_FRACONE-1);
/* Custom filter coeffs, which match the old version instead of a low-shelf. */