Bounce on Marker Event Expression

//BOUNCE ON MARKER EVENT (put in scale):
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
}
if (n == 0){
value;
} else {
max_dev=20; // max deviation in pixels
spd=20; //speed of oscillation
decay=6; //how fast it slows down
t = time - marker.key(n).time;
s = max_dev*Math.sin(spd*(t))/Math.exp(decay*t);
value + [s,s];
}
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.