Grabbing the previous incoming value, and one [expr] should do it, to implement a first order filter
y[i] := y[i-1] + α * (x[i] - y[i-1])
as
[expr if($f1>$f2, $f3+.1*($f1-$f3), $f3+.2*($f1-$f3))]
where $f1 is the incoming number, $f2 is the previous incoming number, the output of this expr is routed into the second inlet as $f3.
.1 is the smoothing coeff for increasing, .2 is the smoothing coeff for decreasing.
So:
[(floatatom)(
|
[t f f b]
| \ /
| \/
| /\
| / \
| [float]
| |
| |
| |
[expr if($f1>$f2, $f3+.1*($f1-$f3), $f3+.2*($f1-$f3)) ]
|
|
[(floatatom)(
|
<route connection into 3rd outlet of expr>