Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Audio to Keyframe fade out

  • David Conklin

    August 29, 2016 at 5:23 pm

    Try something like this:

    //This gets the audio from the audio Amplitude layer that 'Convert Audio to Keyframes' made
    var aud = thisComp.layer("Audio Amplitude")("Effects")("Both Channels")("Slider");

    // This gets the value of the Opacity property BEFORE you applied the expression. Basically returns the value you'd see when
    // you click the 'opacity' value box to enter a value. It then divides that by 100 to give you a range 0-1 instead of 0-100.
    var offset = value/100;

    // Now, we multiply the audio data by our offset.
    aud*offset

    What this does, is that it allows you to keyframe your opacity from 0-100, and have that compound on top of the data that’s being created by the Audio to Keyframes. So, just paste this expression onto opacity, set a keyframe at 100 for when you want the fade out to begin, and a keyframe at 0 when you want the fade to be complete. This works because when your opacity is 100, we divide it by 100 and get a value of 1. The audio data multiplied by 1 is just the audio data. When our opacity is 0, we multiply the audio value by 0 and get 0. When our opacity is 50, we divide that by 100 to get 0.5, and 0.5 times our audio data is half of the value.

    I hope that makes sense. Give it a try and let me know if it doesn’t work!

    David Conklin
    mographcode.tumblr.com

  • James Hepher

    August 30, 2016 at 10:31 am

    It doesn’t seem to be doing what I need.

    I think I need to create some sort of linear ramp from 100-0.

    So when the opacity is 100 it automatically trigger a ramp that fades out for a set duration.

    Any ideas?

    Cheers,

    J

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