ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

"Playing" a layer...

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Royce Jennings
"Playing" a layer...
on Jun 19, 2011 at 8:19:06 am

I am trying to "play" a video (16 frame animation) on command. I am using audio converted to keyframes (recording of a single note played multiple times, different rhythms), and I want to write an expression saying every time a note is played (>6.0 value would work for each note's beginning), this 16 frame animation plays through and then freezes on the last frame (0:00:00:15). It's important that it stops on the last frame of that layer while the rest of the timeline continues on. The effect would be that the animation is the note being played each time, in sync with the audio. But it needs to be an expression because it is too long to do manually.

Anyone know how to do this?.....

Return to posts index

Greg Burrus
Re: "Playing" a layer...
on Jun 20, 2011 at 4:06:08 pm

I made a quick expression that I think might be what your trying to do.

enable=effect("Enable Bounce")("Checkbox");
soundLVL = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
if( enable == 1){
if(soundLVL >30){




This expression allows you to set value to occur when the key is greater then a number you set(30 in my code). Mine simply adds 100 to the position but you could do anything. If you wanted something smooth you should use the linear method or something to increment you value like a loop.

If it doesn't hit the value it stays the same as you have it set. I setup a switch that enables the effect or not. You could also use this to freeze it with a certain value other then the default you begin with.

I uploaded the project I did the code in.

Hope that helps & if not

I would suggests that you post this in the after effects expressions forum since that's the right forum for this question

Or try

Greg - Blog - Portfolio

Return to posts index

Royce Jennings
Re: "Playing" a layer...
on Jul 15, 2011 at 10:28:35 am


I appreciate the suggestions! Unfortunately, the part I really needed the help in was the missing part (position in your example). I need a way to "play" a layer and freeze on the last frame.

I have re-posted this in the expression forum per your suggestion.

Return to posts index

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