Ok, I see now. You’re talking about bouncing instead of overshooting. I think if you change the line that calculates the value of “s” to this, it should do it. (If this goes in the wrong direction, then put a minus in front of amplitude.)
s = amplitude*Math.abs(Math.cos(freq*t*2*Math.PI))/Math.exp(decay*t);
Math.abs gives the absolute value, i.e. it removes the minus from negative values.
Kalleheikki Kannisto
Senior Graphic Designer