Layer1 Audio Adjusts the audio levels of Layer2? But How?

Moderators: Disciple, zlovatt

Post Reply
Brandon Brown
Posts: 1
Joined: November 13th, 2007, 10:20 pm
Location: Chicago
Contact:

I have a composition full of classified style ads (each with a voiceover) with a music bed that runs the duration of the entire movie. I want the music bed to drop 10dB any time a voice over read shows up and rises back up 10dB when the voice over stops. Before laying down the Music bed, I can generate a Audio Amplitude track with the "Convert Audio to Keyframes." Anytime there is no voice over the slider reads 0; anytime there is voice over the slider reads greater than 0--so we have a good clean "if/else" base to work with.

The script below works ok, but... there is no ramp for the transition from 0dB to -10dB so the audio just drops and rises immediately (instead of over 1 second. I'm also not sure how to tell the property to ramp "backwards" (-10dB to 0dB) when the voice over stops.

This script is applied to the Music Bed to be manipulated:

temp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

if (temp>0){
temp = -10
}else{
temp =0
}

[temp, temp]

Can anyone help?

Thanks.
Brandon Brown
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

Brandon Brown wrote:I have a composition full of classified style ads (each with a voiceover) with a music bed that runs the duration of the entire movie. I want the music bed to drop 10dB any time a voice over read shows up and rises back up 10dB when the voice over stops. Before laying down the Music bed, I can generate a Audio Amplitude track with the "Convert Audio to Keyframes." Anytime there is no voice over the slider reads 0; anytime there is voice over the slider reads greater than 0--so we have a good clean "if/else" base to work with.

The script below works ok, but... there is no ramp for the transition from 0dB to -10dB so the audio just drops and rises immediately (instead of over 1 second. I'm also not sure how to tell the property to ramp "backwards" (-10dB to 0dB) when the voice over stops.

This script is applied to the Music Bed to be manipulated:

temp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

if (temp>0){
temp = -10
}else{
temp =0
}

[temp, temp]

Can anyone help?

Thanks.
Ah na, wrong methodology. If the voice was on separate snippets, you could do it based on in and out-points and it, but with a converted layer and lots of keyframes it's pretty pointless. Iterating through all of them and finding their values will be slow as hog plus the code will be a bit complex. Frankly you will get this done much quicker in a sequencing program like Audition even if you have have to pull the sliders manually...

Mylenium
[Pour Mylène, ange sur terre]
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

The effect is called called "ducking" in the audio world.

If you have access to an audio program or editor, you may want to "prep" the music bed in external software.

But if you really are stuck with After Effects processing, why not just extend your expression a bit.

[code]
temp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
switch (true)
{
case (temp > 0 & temp < 10 ) :
temp = 0;
break;
case (temp > 10 & temp < 20 ) :
temp = -1;
break;
case (temp > 30 & temp < 40 ) :
temp = -2;
break;
case (temp > 50 & temp < 80 ) :
temp = -5;
break;
case (temp > 80 & temp < 200) :
temp = -10;
break;
default :
temp = 0
}

[temp, temp]
[/code]

I am guessing at amplitude values here, but this may get you what you need as far as a ramp in and out. Add more case statements to smooth out the processing.
Post Reply