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