Activity › Forums › Adobe After Effects Expressions › SampleImage to affect sound volume
-
SampleImage to affect sound volume
Posted by Lukas Parkes on February 28, 2011 at 9:38 amHi
How would I go about sampling video image brightness, in order to affect volume of a soundtrack?
thanks
Lukas
Jay Ingles replied 15 years, 3 months ago 3 Members · 2 Replies -
2 Replies
-
Dan Ebberts
February 28, 2011 at 8:14 pmYou 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 pmSomeone 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")]
Reply to this Discussion! Login or Sign Up