# [PD] smoothing numbers: something like Max's "slide" object?

Ali Momeni batchku at gmail.com
Wed Jan 18 22:22:51 CET 2017

```Thanks daniel!
Excuse me, I missed that in there.
This is great.

-ali

On Wed, Jan 18, 2017 at 4:10 PM, Daniel Iglesia <daniel.iglesia at gmail.com>
wrote:

> That expr handles increasing vs decreasing separately, with two separate
> smoothing coefficients (the .1 and .2). Break them out into additional
> inputs to [expr] and those can be changed dynamically as well.
>
> On Wed, Jan 18, 2017 at 12:52 PM, Ali Momeni <batchku at gmail.com> wrote:
>
>> Thanks daniel; i'm aware of this technique.
>> Im specifically looking for a smoothing method that allows variable
>> amounts of smoothing, and also implements a way to have increasing values
>> be smoothed differently than decreasing values.
>>
>> Any thoughts on that?
>>
>> -ali
>>
>> On Wed, Jan 18, 2017 at 3:45 PM, Daniel Iglesia <daniel.iglesia at gmail.com
>> > wrote:
>>
>>> 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>
>>>
>>>
>>> On Wed, Jan 18, 2017 at 11:18 AM, Ali Momeni <batchku at gmail.com> wrote:
>>>
>>>> Hello all,
>>>>
>>>> Can someone point me to an existing abstraction/external that behaves
>>>> somewhat like Max's "slide" object?  Specifically, i'm looking for a way to
>>>> smooth (low-pass) floats (control rate) but with the ability to smooth out
>>>> increasing and decreasing values differently.
>>>>
>>>> Thank you!
>>>>
>>>> -ali
>>>>
>>>> _______________________________________________
>>>> Pd-list at lists.iem.at mailing list
>>>> UNSUBSCRIBE and account-management -> https://lists.puredata.info/li
>>>> stinfo/pd-list
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170118/51eaa0f4/attachment.html>
```