ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Limiting movement on my expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Cox
Limiting movement on my expression
on Apr 19, 2019 at 6:42:27 pm

I'm brand new to After Effects and I'm trying to work out how to have a minimum and maximum movement on my expression. I have the Y position of an object linked to my audio but it moves way too high and way too low. So for example I'd like to make the lowest my object could go 0, and the highest 50.

I've tried searching what I'm looking for but I don't exactly know how to phrase it

Praise to thee who understands my idiot way of trying to explain.


Return to posts index

Dan Ebberts
Re: Limiting movement on my expression
on Apr 19, 2019 at 7:27:10 pm

There are several variations, depending on how you have things set up, but the key is to remap your audio amplitude range to your desired y movement range, using linear(), like this:

a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider").value;
y = linear(a,0,25,0,50);
value + [0,y]

It will look different if you have separated dimensions, or want to specify the actual y value, rather than an offset range.


Dan



Return to posts index

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