Smooth

Follows its input with a gentle lag, with separate times for going up and coming down.

Parameters

NameTypeDescription
ValueoutputFloatThe value on its way to the input.
InputFloatThe value to follow.
Rise TimeFloatHow many seconds the output takes to reach an input that is above it.
Fall TimeFloatHow many seconds the output takes to reach an input that is below it.

Smooth takes the edges off sudden changes. When the input jumps, the output moves towards it fast at first and slows down as it gets close. It is like a car easing into a parking space. It reaches the input in about the given time, no matter how big the jump was. A time of 0 follows the input at once.

Going up uses the rise time and coming down uses the fall time, so the two can differ. A short rise and a long fall makes something light up at once and fade away slowly, which is a common shape for reacting to sound or to a button.

Because every change takes the same time, big changes move faster than small ones. Limit Speed is the alternative when the output should travel at a constant speed and take longer for a bigger change. Spring is the one that overshoots and bounces.

Keywords: lag, ease, filter, damp, soften, low pass, attack, release