Discussion:
setting min and max perameters with expressions
(too old to reply)
b***@adobeforums.com
2006-11-11 16:05:05 UTC
Permalink
Hi,

I'm stll trying to grok expression syntax, any help with this problem would help me alot.

I have converted an audio track to keyframes, and I am using an expression to drive the size of a different layer to match the "audio amplitude". What I don't know how to do is set a minimum and maximum threshold (for example, all input over 100% stops at 100%), or drive the x and y sizes independently. Any suggestions would be appreciated.
D***@adobeforums.com
2006-11-11 17:14:05 UTC
Permalink
This should get you started:

a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
minAudio = 0;
maxAudio = 21;
minScale = 50;
maxScale = 150;
s = linear(a,minAudio,maxAudio,minScale,maxScale);
[s,s]

This is how you'd do if for just the y axis:

a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
minAudio = 0;
maxAudio = 21;
minScale = 50;
maxScale = 150;
s = linear(a,minAudio,maxAudio,minScale,maxScale);
[value[0],s]

Dan
b***@adobeforums.com
2006-11-14 11:16:51 UTC
Permalink
Thanks Dan. That helps alot.. not only with my problem, but also in better understanding expressions.

Again, thank you.

Loading...