FORUMS: list search recent posts

Sequence in expressions between various layers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sander Rednas
Sequence in expressions between various layers
on Oct 22, 2013 at 5:25:50 pm

Hi Guys. I have a rather complex thing i want to work out, and i'm quite new to the feature of Expressions. What i did managed to work out is an expression which scales the (vector)object in the layer depending on audio keyframes. My goal is to have 13 seperate layers, and all of them should use this expression.

But, the complex part for me is, the layers need to use the expression in a specific order, for example, first layer 3, then layer 4, then 7, etc. I think it has something to do with Index, because of the connection between layers, an If/Else statement, and of course Scale. Has anyone perhaps some tips or references for me? A big THANKS in advance!

Greets, Sander


Return to posts index

Dan Ebberts
Re: Sequence in expressions between various layers
on Oct 23, 2013 at 12:01:14 am

This is an interesting one. I think the simplest approach is to use a beat counter, that starts at time = 0. Each layer's version of the expression would be looking for a specific beat (I have it set up so it's looking for the beat number that matches the layer's index, but you could have it watching for any beat. A added a wobble as the "triggered" part of the expression at the end. Hope it helps!


threshold = 10.0;
myBeat = index; // set this to the beat number you want to trigger this layer
audioLev = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

above = false;
frame = 0;
n = 0;
while (frame <= timeToFrames(time)){
t = framesToTime(frame);
if (above){
if (audioLev.valueAtTime(t) < threshold){
above = false;
}

}else if (audioLev.valueAtTime(t) >= threshold){
above = true;
n++;
if (n == myBeat) break;
}
frame++
}

myTime = (n == myBeat) ? time - t : 0;

// your expression, using "myTime" instaed of "time":

amp = 25;
freq = 5;
decay = 4.0;

angle = freq * 2 * Math.PI * myTime;
wobble = 1 + amp * Math.sin(angle) / Math.exp(decay * Math.min(myTime,10)) / 100;
[value[0] * wobble, value[1] / wobble]



Dan



Return to posts index

Sander Rednas
Re: Sequence in expressions between various layers
on Oct 29, 2013 at 10:23:52 am

He Dan, thanks for your answer! I tried to use it, but since i'm quite a AE Expressions newbie, it didn't worked out. I tried to combine it with an expression i wrote, see the box below.

Have you have any idea how i could combine your expression with mine? Thanks in advance!!

gr. Sander

//expression i use for Scale:

x = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider")*20;
y = value[0]+(x/40);
if (y>0) {
[x,y];
}
else {
[(x*40),y];
}


Return to posts index

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