FORUMS: list search recent posts

Dan's Expression for Time Stretch

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Madison
Dan's Expression for Time Stretch
on Jun 14, 2012 at 1:38:27 pm

Hi Dan,

I got the following expression for a stretch effect from your site:

freq =3;
amplitude = 35;
decay = 1.0;

s = amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time);
scale + [s,s]

Is there a way to change this expression so that the animation starts from 0 scale value. In others words, I want the layer to 'appear' like a pop-up.

Return to posts index

Dan Ebberts
Re: Dan's Expression for Time Stretch
on Jun 14, 2012 at 2:51:32 pm

Try this, it may be close to what you're looking for:

t = time - inPoint;
startVal = 0;
endVal = 100;
dur = 0.1;
if (t < dur){
s = linear(t,0,dur,startVal,endVal);
amp = (endVal - startVal)/dur;
freq = 3;
decay = 5;
w = freq*Math.PI*2;
s = endVal + amp*Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w;

Adjust the amplitude of the overshoot by changing the dur variable (smaller value = more overshoot).


Return to posts index

John Madison
Re: Dan's Expression for Time Stretch
on Jun 22, 2012 at 3:08:32 pm

It works like a treat!

If it is not too much to ask Dan, can you also help with the following:

I am looking to move a layer so it appears to drop from the middle of the screen to the bottom. However, I want to be able to control the start of the drop and the speed with controllers. The start is to be designated by a marker preferably.
So lets says a text layer is on the middle of the screen. At about 4 secs it drops by moving up a few pixels first and then all the way down to the bottom of the screen (or completely off screen)

This is related to the above time stretch and hence why I am asking here.

Thanks :)

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved