Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add value to slider based on another value

  • Add value to slider based on another value

    Posted by Krish Chhottra on March 3, 2018 at 10:46 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.

    Krish Chhottra replied 8 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 4, 2018 at 1:21 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

  • Krish Chhottra

    March 4, 2018 at 2:28 am

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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy