FORUMS: list search recent posts

Create "a gap" in continous Sinusoidal expresion

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eden Exposito
Create "a gap" in continous Sinusoidal expresion
on Dec 1, 2012 at 7:20:25 pm

Hi!

I have this expression and i want add a time variable (seconds) to create a "gap" between oscillation.

I think that i need 2 variables, one to control duration of oscilation and other to control a gap between oscillations.

I had create this manual simulation to better expose.

Thanks for your time

here the expression that i use to create sinusoidal: oscilacion_y=multiplicador_y*Math.sin(desfase_y+time*(frecuencia_y))*(amplitud_y);


Return to posts index

Dan Ebberts
Re: Create "a gap" in continous Sinusoidal expresion
on Dec 1, 2012 at 8:01:21 pm

Play around with this:

freq = 1; // osc. per second
gap = 2; // gap duration (sec)
amp = 200;

p = 1/freq;
t = time%(gap + p);
yOffset = (t < p) ? amp*Math.sin(t*freq*Math.PI*2) : 0;
value + [0,yOffset]


Dan



Return to posts index

Eden Exposito
Re: Create "a gap" in continous Sinusoidal expresion
on Dec 2, 2012 at 10:30:43 am

Like Always your work is magical Dan!

I had adapted your expression you can see it here. As you can see "decay" is clamping in parts with this method. Great to do something that is disappearing along time.

How i can maintain this decay and repeat in every oscillation. Like this screenshot

I had never seen "(t
Thanks for your time Dan!


Return to posts index


Dan Ebberts
Re: Create "a gap" in continous Sinusoidal expresion
on Dec 2, 2012 at 7:33:43 pm

For that, I think you'd be better off with something like this:

freq = 1.75;
period = 3;
amp = 100;
decayTime = 2;

t = time%period;
yOffset = amp*Math.sin(t*freq*Math.PI*2);
value + [0,ease(t,0,decayTime,yOffset,0)]


Dan



Return to posts index

Eden Exposito
Re: Create "a gap" in continous Sinusoidal expresion
on Dec 3, 2012 at 5:50:01 pm

Thanks Dan!

Works!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]