ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Add value to slider based on another value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Krish Chhottra
Add value to slider based on another value
on Mar 3, 2018 at 10:46:59 pm

So basically I have null with slider control
with the pick whip, I connected an evolution type of effect (like the hue/saturation change which is in 360 degrees)
I have an audio aptitude layer
I want to add the value of the audio layer to the slider control without subtracting it after, so every frame, if the audio is at 3 the first frame and 11 at the second, the slider will go to 3 and then 14.
Thanks to anyone who tries to help me.


Return to posts index

Dan Ebberts
Re: Add value to slider based on another value
on Mar 4, 2018 at 1:21:59 am

Something like this maybe:


a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
accum = 0;
for (i = timeToFrames(inPoint); i <= timeToFrames(time); i++){
accum += a.valueAtTime(framesToTime(i));
}
value + accum*thisComp.frameDuration


It can be a performance hog though, because on each successive frame it has to do more and more work. If performance is an issue, it would be better to get Red Giant's Sound Keys, which has a built-in integration mode.

Dan



Return to posts index

Krish Chhottra
Re: Add value to slider based on another value
on Mar 4, 2018 at 2:28:47 am

Thanks for the advice, I did have sound keys. Just didn't know it can do this so easily!


Return to posts index

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