Jitter
Builders for small random variations, meant for the Volume and PlaybackSpeed of sounds so repeated sounds do not
sound identical. Each builder returns a function that gives a new value every time it is called.
INFO
Values never go below 0, since a negative volume or speed means nothing. There is no upper clamp; Roblox clamps the property itself.
A builder never throws. An argument that is not a number warns when the builder is called and falls back to a value that gives no variation, so the mistake shows up where it was made and the sounds keep playing.
Functions
Uniform
Jitter.Uniform(center: number,--
The value the jitter varies around. Falls back to 1 when it is not a number.
spread: number--
The largest distance from the center. Falls back to 0 when it is not a number.
) → () → number--
Gives a new value when called.
Spreads values evenly between center - spread and center + spread.
local speed = VluxySF.Jitter.Uniform(1, 0.15)
sound1.PlaybackSpeed = speed() -- a random value from 0.85 to 1.15
sound2.PlaybackSpeed = speed() -- another one
Range
Jitter.Range(min: number,--
The smallest value. Falls back to max when it is not a number.
max: number--
The largest value. Falls back to min when it is not a number.
) → () → number--
Gives a new value when called.
Spreads values evenly between min and max. When min is above max the two are swapped.
local speed = VluxySF.Jitter.Range(0.85, 1.15)
sound.PlaybackSpeed = speed()
Natural
Jitter.Natural(center: number,--
The value the jitter varies around. Falls back to 1 when it is not a number.
spread: number--
The largest distance from the center. Falls back to 0 when it is not a number.
) → () → number--
Gives a new value when called.
Like Uniform, but values cluster near the center and rarely reach the edges, which sounds more natural for
repeated sounds like footsteps.
local volume = VluxySF.Jitter.Natural(0.8, 0.1)
footstep.Volume = volume()