Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Audio markers to control levels

  • Audio markers to control levels

    Posted by Olly Bea on January 16, 2012 at 10:06 am

    Hey all, 3 pronged this…..

    I would like to set markers on my audio layer that will drive its volume.

    So for example I have a clip that comes in with a voice over and I would like the background audio bed to drop down quiet whilst the voice is on and then when the voice over has finished the bed comes back up again, but I would like to drive this by markers as opposed to keyframes. (“In” and “Out” markers). This will happen multiple times over the course of the programme.

    I would also like a slider to control how quiet the audio drops to again rather than keyframing this in, so I vary this as I need.

    Finally, I would like the audio to fade down to its quiet level over an number of keyframes but I would like to be able to control this number again with a slider….

    I have no clue how to do this, could anyone help? Is this even doable?

    Cheers, Olly

    Olly Bea replied 14 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 16, 2012 at 5:10 pm

    I think this will work for what you want. At odd-numbered markers, it ramps the audio level down by the decibels specified by the fadeAmt slider over the number of frames specified by the fadeFrames slider. At even-numbered markers, it ramps back to the pre-expression value.


    fadeFrames = effect("Fade Frames")("Slider");
    fadeAmt = effect("Fade Amount")("Slider");

    n = 0;
    m = marker;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key(n).time > time) n--;
    }

    if (n > 0){
    t1 = m.key(n).time;
    t2 = t1 + framesToTime(fadeFrames);
    if (n%2)
    linear(time,t1,t2,value,value-[fadeAmt,fadeAmt])
    else
    linear(time,t1,t2,value-[fadeAmt,fadeAmt],value);
    }else
    value

    Dan

  • Olly Bea

    January 16, 2012 at 5:23 pm

    Has anyone told you that you are a genius!

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