Forums > Gen

Parameter smoothing in gen~


July 13, 2013 | 5:02 am

Hi guys,
trying to do parameter smoothing in gen~.
Any strategy?
I’ve tried this following simple thingie but doesn’t provide the required amount of smoothing.
Have to use audio rate parameters outside of gen~ (i.e. using sig~ )

<code>

— Pasted Max Patch, click to expand. —

</code>

thanks
a.

July 13, 2013 | 5:23 am

Hi Alfonso

Gregory Taylor’s response to my recent "line~ as counter" question here might help. Very nice interpolation idea.

http://cycling74.com/forums/topic/translate-msp-line-into-gen-counter/

Brendan

July 13, 2013 | 6:43 am

In itself the strategy works well, it’s just that the argument for mix should be much closer to 1. This setup behaves similar to slide~.

<code>

— Pasted Max Patch, click to expand. —

</code>

July 13, 2013 | 6:55 am

many thanks guys! useful infos!

December 18, 2013 | 10:49 am

I just made this gen~ patch inspired by supercollider’s "lag3". Very useful for parameter smoothing. Unlike line~ it has a smooth start and end, in some cases producing less unwanted artifacts.

<code>

— Pasted Max Patch, click to expand. —

</code>

December 19, 2013 | 12:38 am

Great – thanks!

April 27, 2014 | 3:02 pm

I made this, it’s simple. For faster response the .01 could be higher (and .99 changed the two coefficients still add up to 1). I think it could be twice or more faster, but I didn’t need it.

One nice thing is, with faster audio rates, the difference between samples is smaller, so the coefficients don’t need to change when sample rate changes.

Attachments:
  1. Capture

    Capture.jpg

April 27, 2014 | 3:47 pm

i use the basic idea of a moving-average filter:
0.5(n + n-1)
but alter it for differing needs….
(uh… in case it needs be said: n = current sample, n-1 = previous…)

I really dig Tarik’s though :D

February 18, 2015 | 7:39 am

Im trying to do exactly this but I can’t find the ‘history’ object! What does it do and where can I get it?

February 18, 2015 | 11:44 am

use gen?

February 18, 2015 | 3:08 pm

The mix/history combo is the same as a one pole (and Ernest’s example is also a one pole).

Tarik’s is three one poles in series, with some code for calculating the desired coefficient from a duration (and constant target threshold). BTW, in Tarik’s code the abs() is unnecessary, so the onepole() is still equivalent to mix+history. Here’s the same, slightly re-arranged:

— Pasted Max Patch, click to expand. —
February 18, 2015 | 4:45 pm

ooh. Pretty!

Viewing 12 posts - 1 through 12 (of 12 total)

Forums > Gen