Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Addition to Audio volume to scale(layer) expression?

  • Addition to Audio volume to scale(layer) expression?

    Posted by Robin Hamilton on June 29, 2007 at 4:44 pm

    I have a character animation and for a quasi lip sync. I am using an expression that scales a layer (mouth), according to the volume of an audio track.

    I have one question though. Does anyone know of an expression that would turn the opacity of another layer from 0 to 100 (eg. a closed mouth layer) when the audio reaches a minimum volume (user set db value)? As well as a max volume.

    Markofcain replied 18 years, 10 months ago 3 Members · 2 Replies
  • 2 Replies
  • Roland R. kahlenberg

    June 30, 2007 at 10:21 am

    Lots of similar Qs been posted here. Best to perform a Search using the word “Interpolation”

    Cheers
    Roland Kahlenberg
    https://www.broadcastGEMs.com – Adobe After Effects project files
    https://www.myspace.com/rorkrgbspace

  • Markofcain

    June 30, 2007 at 10:44 am

    Set up the comp by:

    1) Convert the Audio to key frames
    2) select the layer you want to toggle on and off
    3) open the opacity — “T” Key
    4) Alt click the stopwatch (PC assumed here)
    5) drag the pick whip to the audio slider

    AE will generate an expression for you like:
    thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”)

    We want to change this so that we can modify the value before it gets passed to the opacity. What we need to do is:
    1) assign a variable to the audio levels
    2) assign a variable to the opacity level
    3) set a lower limit value below which the opacity is zero and above which the opacity is set to 100.

    So now the expression looks like this:

    signal_value = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    if (signal_value < 25 ) { opacity_value = 0; } else { opacity_value = 100; }; opacity_value; The logic is intuitively obvious to the most casual observer -- but I will walk you through just in case: The conditional statement of the expression constantly checks the value of the variable "signal_value." If the value of variable "signal_value" is less than 25, then the expression path flows to the statement immediately below where the variable opacity_value is set to zero. If, however, the value of the variable "signal_value" is 25 or greater, then the expression path jumps to the statement immediately below the "else" where the variable opacity_value is set to 100. Finally, the last line "returns" or announces the opacity_value to the layer. HTH Mark Cain Sarasota, FL USA

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