FORUMS: list search recent posts

Waiting until easeOut is finished.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tim Tam
Waiting until easeOut is finished.
on Jun 20, 2014 at 10:25:04 pm

Good evening!

I got a solid layer with its position bound to audio. I figured out I can set the duration (and position) by using "easeOut(time, start, end,[pos1,pos2],[pos3,pos4])"
I tried to write an expression that moves the solid after reaching a specific threshold. The problem though is, that it seems to check the "if" after every frame and therefore ends up never completing the easeOut. I am looking for a way to finish the easeOut even if "if" is not "true" anymore.

thresh= thisComp.layer("Black Solid 1").effect("Sound Keys")("Output 1")
if (thresh > 80){
t = time;
easeOut(time, t, t+2,[388,428],[128,428])}
else {
[388,428]}


Return to posts index

Dan Ebberts
Re: Waiting until easeOut is finished.
on Jun 21, 2014 at 12:52:29 am

You need a threshold detector. It'll be something like this:


threshold = 80.0;
audioLev = thisComp.layer("Black Solid 1").effect("Sound Keys")("Output 1");
above = false;
frame = 0;
while (frame <= timeToFrames(time)){
t = frame * thisComp.frameDuration;
if (audioLev.valueAtTime(t) > threshold){
above = true;
break;
}
frame++
}
if (above){
t += thisComp.frameDuration;
ease(time,t,t+2,[388,428],[128,428]);
}else
[388,428]



Dan



Return to posts index

Tim Tam
Re: Waiting until easeOut is finished.
on Jun 21, 2014 at 12:15:24 pm

Thanks a lot for your help already!
I realize that it works that way because if is set to true and will stay that way and therefore the easeOut function is able to do its job.
My next problem is to find a way to loop this function. After easeOut is done, I want it to reset after the threshhold is reached again (would work by just getting into that if loop again since the starting point would be used as a reset). I tried to use a "while" loop that just counts to x, but that doesn't seem to work in AAE. It might also be possible to just copy this function many times, but that is not a pretty solution either.
Is there any way to do easily do this?


Return to posts index


Dan Ebberts
Re: Waiting until easeOut is finished.
on Jun 21, 2014 at 5:31:21 pm

That expression works by finding the first threshold crossing. Maybe you need the version that finds the most recent:

http://www.motionscript.com/design-guide/audio-trigger.html

Just replace the last six lines with this one:

ease(t,0,2,[388,428],[128,428]);


Dan



Return to posts index

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