FORUMS: list search recent posts

# Wiggle Y loop

FAQ   •   VIEW ALL
 Wiggle Y loop on Apr 19, 2017 at 3:47:51 pm

I'm trying to get an vertical bar to seamlessly loop on the y axis, I have this expression but it's just not working properly.

Any help would be appreciated! ☺

freq = 2;
amp = 150;
w = wiggle (freq ,amp);

startFrame = framesToTime(20);
stopFrame = framesToTime(200);
easeOver = framesToTime(20);

if((time >= startFrame)&&(time < stopFrame)){

if((time >= startFrame)&&(time <= startFrame+easeOver))
linear(time, startFrame, startFrame + easeOver, [value[0], w[1]]);
else

if(time >= stopFrame - easeOver)
linear(time, stopFrame - easeOver, stopFrame, [value[0], w[1]]);

else [value[0], w[1]];
}

else value

 Re: Wiggle Y loopon Apr 19, 2017 at 4:51:52 pm

here's a link that describes how to create looping wiggle:
http://motionscript.com/design-guide/looping-wiggle.html
modifying dan's code to fit what you are trying to do, i came up with this which creates looping vertical wiggle:
```freq = 2; amp = 150; loopTime = thisComp.duration; t = time % loopTime; wiggle1 = wiggle( freq, amp, 1, 0.5, t ); wiggle2 = wiggle( freq, amp, 1, 0.5, t - loopTime ); w = linear( t, 0, loopTime, wiggle1, wiggle2 ); [ value[0], w[1] ]```
if you need it to start and stop, like in your current expression (which wouldn't exactly be looping anymore), it would need further modification.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW

 Re: Wiggle Y loopon Apr 19, 2017 at 5:00:55 pm

Thanks Kevin.

Yeah sorry maybe my wording was misleading.

I need the start and end positions as it forms a logo...

 Re: Wiggle Y loopon Apr 19, 2017 at 5:28:27 pm

got it, try this:
```freq = 2; amp = 150; startFrame = framesToTime( 20 ); stopFrame = framesToTime( 200 ); easeOver = framesToTime( 20 ); w = wiggle( freq, amp ); if( time >= startFrame && time < stopFrame ) { if( time >= startFrame && time <= startFrame + easeOver ) { linear( time, startFrame, startFrame + easeOver, value, [ value[0], w[1] ] ); } else { if( time >= stopFrame - easeOver ) { linear( time, stopFrame - easeOver, stopFrame, [ value[0], w[1] ], value ); } else { [value[0], w[1]]; } } } else { value; }```
you were very close, you just needed to interpolate from the wiggle position back to the original value in line 15, also start with the original value in line 12.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW