Exponential and inverse exponential remapping?

Rodrigo's icon

So I'm trying to create a buffer slicing algorithm that will slice a buffer into 16 slices and I want to be able to space those slices anywhere ranging from an exponential spacing (many slices towards the start, and less towards the end) to linear to inverse exponential spacing (few slices at the start, and many towards the end).

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

I have these scaling/remapping things that I use a bunch which are handy:

But they don't offer much gradient here. It would be ideal to have a single parameter to be able to control this that would be able to produce a known inversion (so param of 1.0 = linear, 1.5 = extreme one way, 0.5 = extreme the other way, and anywhere in between).

With the examples I posted I only have double/quadruple jumps, and [scale]'s exponential base input only goes in "one direction".

Anyone know how to best do this?

metamax's icon

Rodger, it sounds like linear tweening equations would be useful. I posted a few "in out" examples on another thread. Here are the "in" and "out" versions that were originally used to create them.

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

In
-

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

Out
-

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

In Out

metamax's icon

whoops.. the above equations are correct but I forgot to update the itables.

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

In (fixed)
-

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

Out (fixed)

Rodrigo's icon

Oooh, those are nice!

I remember (and saved!) your in/out functions before. This is exactly what I needed, with some nice gradations in there.

metamax's icon

Ah, great to hear! And sorry about the "Rodger" thing. Too much eggnog or something.

Rodrigo's icon

Hehe, no problem.

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

They're indeed nice; search here for Gregory's collection ("tweening", "tulip"), and here's my own very simple patch I use for teaching:

Brendan

brendan mccloskey's icon

and a really nice collection, based on JS (the author of which is by now anonymous):

g_easing.zip
zip