Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Audio Amplitude and Saber slider

  • Audio Amplitude and Saber slider

    Posted by Chris Riley on January 8, 2024 at 3:01 pm

    Help with Slider Animation

    Hello friends,

    I have an Audio Amplitude layer. When the Audio Amplitude hits a keyframe that is 39, I want a specific saber slider to move from 0 to 100 in 30 seconds. I have an expression but instead of the animation being smooth it blinks in and out. The saber slider bounces from the correct value to 0 during animation. I dont want to use markers bc my song could change. Any ideas?

    -Thank you

    Brie Clayton replied 2 years, 6 months ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    January 8, 2024 at 5:00 pm

    Like this maybe:

    triggerVal = 39;
    a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    t = 0;
    for (f = 0; f <= timeToFrames(time); f++){
    if (a.valueAtTime(framesToTime(f)) >= triggerVal){
    t = time - framesToTime(f);
    break;
    }
    }
    linear(t,0,30,0,100)
  • Chris Riley

    January 9, 2024 at 2:01 am


    Dan Ebberts
    This works perfectly. I’ve watched youtube videos and read forums and no one could answer this question except you. I’ve tried for 2 weeks to get this to work and you did it in 1 hour. Terrific! Thank you! -Chris

  • Brie Clayton

    January 9, 2024 at 2:53 am

    Thank you for this solve, Dan!

  • Chris Riley

    January 12, 2024 at 11:26 pm

    This expression works great but it only executes once. Any ideas on how to get the slider to reset back to 0 after it hits 100% and wait for the next trigger value?

  • Dan Ebberts

    January 13, 2024 at 12:54 am

    Try this:

    triggerVal = 39;
    a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    t = 0;
    f = 0;
    while (f <= timeToFrames(time)){
    if (a.valueAtTime(framesToTime(f)) >= triggerVal){
    t = time - framesToTime(f);
    if (t <= 30) break;
    f += timeToFrames(30);
    }
    f++;
    }
    t > 30 ? 0 : linear(t,0,30,0,100)
  • Chris Riley

    January 13, 2024 at 1:00 am

    OMG! That is total genius. It works flawlessly. Thank you again Dan!

  • Brie Clayton

    January 13, 2024 at 11:57 pm

    Thank you for solving this, Dan!

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