FORUMS: list search recent posts

Triggered random movement

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ed Handley
Triggered random movement
on Oct 21, 2013 at 3:43:40 pm

Hello,
I am trying to modify one of Dan Ebberts great expressions to perform a continuous random
movement on an audio trigger.
The following works but generates a new random start and end on each trigger, I'd like it to just continue from the previous random end point but can't figure out how to make the end point from a previous trigger the new start point.
Any advice much appreciated, thanks, Ed.

lev = thisComp.layer("soundkeys").effect("Sound Keys")("Output 1");
minVal = [0.1*thisComp.width, 0.1*thisComp.height,0];
maxVal = [0.9*thisComp.width, 0.9*thisComp.height,0];
minT = 0.2;
maxT = 2;
threshold = 5.0;
above = false;
frame = timeToFrames(time);

while (true){
t = framesToTime(frame);
seedRandom(t,true);
m = random(minVal,maxVal);
m2 = random(minVal,maxVal);
t2 = random(minT,maxT);
outVal = ease(time,t,t+t2,m,m2);
if (above){
if (lev.valueAtTime(t) &lt; threshold){
frame++;
break;
}
}else if (lev.valueAtTime(t) >= threshold){
above = true;
}
if (frame == 0){
break;
}
frame--
}
outVal;


Return to posts index

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