Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions SampleImage to affect sound volume

  • Dan Ebberts

    February 28, 2011 at 8:14 pm

    You could write an expression for audio levels that uses sampleImage() to get the RGB of the sample area of the layer you want to control the audio. Then use rgbToHsl() to convert the RGB to HSL so you can use the luminance value ([2]). There’s a lot of stuff you need to define first though, like how much of the layer you want to sample, where the center of the sample area is, and most importantly, how you want the luminance of the sample area to affect the audio level. Audio level is in db, with 0 being the default setting and -192 being the minimum. So you need to define a relationship between the luminance value and db.

    Dan

  • Jay Ingles

    June 3, 2011 at 10:28 pm

    Someone helped me a couple months ago with the same issue.
    I used the code below.

    Note that I created a Null called “sound keys” and added a slider controller called “SoundKeys Controller”. Then i used trapcode sound keys to map the song out to keyframes.

    Hope this helps!

    temp = thisComp.layer("SoundKeys CONTROLLER").effect("Sound Keys")("Output 1");
    [temp*thisComp.layer("SoundKeys CONTROLLER").effect("SOUNDKEYS SCALE MULTIPLIER")("Slider")]

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