comparing ramping and smoothing

Ernest's icon

Smoothing a signal has often been requested. This patch contains two methods: an integrator, as suggested by cycling74, and a linear ramp. If your design needs a value smoothed to a precise value in a precise amount of time, the ramp is better. If it doesn't matter exactly how long the smoothing takes, or whether the smoother reaches a precise value in a fixed amount of time, the Cycling74 suggestion requires less CPU. The demo patch illustrates the output of the two implementations in gen~.

Max Patch
Copy patch and select New From Clipboard in Max.

leaozinho's icon

This is awesome. Forgive me - when I see Codebox I understand very little of what's going on. How could you adjust the time it takes? If I wanted it to be 20ms, for instance.

Ernest's icon

send this gen~ object a message "x 20."