-
Adjusting Dan’s Squash and Stretch Expression
I am trying to make the expression only effect the X axis instead of the Y. I can’t quite get the expression right. I swapped out the X and Y in the expression, but it did not work. How can I get this to only squash and stretch the X axis?
maxDev = 10; // max deviation in pixels
spd = 20; //speed of oscillation
decay = 1.0; //how fast it slows downn = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n--;
}
}if (n > 0){
t = time - marker.key(n).time;
y = scale[1] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
[value[0],y]
}else{
value
}