Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Automatically change bed volume through expressions?

  • Automatically change bed volume through expressions?

    Posted by Michael Combs on July 30, 2007 at 5:45 pm

    What I’m looking to do is create an expression that will adjust the volume of a bed of music based upon the volume of another layer. So, if the VO starts up, the bed is dropped to 20 of peak. If a second passes without audio, the bed is slowly brought up to 100%. Is this doable?

    Dan Ebberts
    replied 18 years, 9 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    July 30, 2007 at 9:10 pm

    Interesting idea. This seems to work. You need to convert the VO track to keyframes. Fiddle with the four parameters until you get something you like. The squelch parameter assumes your bed is stereo – just change it to a single number if it’s mono.

    silenceLevel = 5; // volume level of VO where squelch is removed
    silenceTime = 1.0; // length of silence before bed starts to ramp up
    rampTime = 0.5; // time to ramp up bed
    squelch = [12, 12]; //amount to squelch bed (db)

    VO = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”); //VO level

    if (silenceLevel > VO.value){
    t = time;
    while (t > 0 && t > time – (silenceTime + rampTime)){
    t -= thisComp.frameDuration;
    if (VO.valueAtTime(t) >silenceLevel) break;
    }
    if (time – t > silenceTime){
    linear(time – t, silenceTime, silenceTime + rampTime, value – squelch, value);
    }else{
    value – squelch;
    }
    }else{
    value – squelch;
    }

    Dan

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