Forums > Jitter

Gen – Smoothstep function


t
February 12, 2012 | 3:36 pm

I was trying to observe the difference between "mix" and "smoothstep" types of interpolation. And somehow I can’t understand what "smoothstep" is doing.

Use the toggle to switch between "mix" and "smoothstep"…

– Pasted Max Patch, click to expand. –


pid
February 12, 2012 | 3:53 pm

[mix] is default linear interpolation, [smoothstep] is default no interpolation. i see the results fine with your patch. what do you see?



t
February 12, 2012 | 5:02 pm

this is what I see at xfade 0 and 1 for [smoothstep]. I was expecting some kind of crossfade…?

[attachment=185057,3339] [attachment=185057,3340]

Attachments:
  1. Screenshot20120212at5.59.53PM.png

February 12, 2012 | 6:08 pm

smoothstep is a different beast compared to mix. mix mixes between two values where the mix value is between [0, 1]. smoothstep gives you a ramp in the range [0, 1] that is calculated from two values and an interpolation value that is between those two inputs. For example:

smoothstep(0, 2, 0.5) –> 0.16
smoothstep(0, 2, 1.5) –> 0.84
smoothstep(0, 2, 1.75) –> 0.96

smoothstep(1, 2, 0.5) –> 0
smoothstep(1, 2, 1.5) –> 0.5
smoothstep(1, 2, 1.75) –> 0.84

If you’re trying to create a hermite interpolated crossfade, you’ll need to something like this:

– Pasted Max Patch, click to expand. –


pid
February 12, 2012 | 8:53 pm

thanks wesley! now i know too…


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