| Changing audio levels dependence if there's another video playing on top of it?
• | | | |
 | Changing audio levels dependence if there's another video playing on top of it?
by Eliezer Cisner on Aug 7, 2012 at 6:45:19 pm |
I'll try to make this question as clear as possible, if I'm not clear enough, please don't hesitate to ask me, and I'll try my best to rephrase:
I have multiple video layers in my comp, and over them I have multiple short overlying layers (all named "Bumper n" that are supposed to play from time to time while the the underlying videos continue playing. The underlying video volumes need to get a bit softer every time the overlying videos play. Is there any expression that can tell the underlying videos to play softer every time there's an overlying video layer?
Sorry if I'm not clear enough.
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Dan Ebberts on Aug 7, 2012 at 7:25:35 pm |
This should drop the auido 12db if there's an active layer with audio above it in the layer stack:
attenuate = false;
for (i = 1; i < index; i++){
if (thisComp.layer(i).audioActive){
attenuate = true;
break;
}
}
attenuate ? value - [12,12] : value
Dan
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Eliezer Cisner on Aug 7, 2012 at 7:36:21 pm |
Wow, wow, wow! Simply genius! I almost gave up even before posting it, and the answer came so fast! No words, Dan, no words!
Thanks a billion!
P.S. Is it possible to have the audio transition gradually to its lower volume?
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Dan Ebberts on Aug 7, 2012 at 8:23:11 pm |
Something like this:
ramp = .25;
db = [12,12];
attenuate = false;
for (i = 1; i < index; i++){
if (thisComp.layer(i).audioActive){
attenuate = true;
break;
}
}
if (attenuate){
L = thisComp.layer(i);
if (time < (L.inPoint+L.outPoint)/2)
linear(time,L.inPoint,L.inPoint+ramp,value,value-db)
else
linear(time,L.outPoint-ramp,L.outPoint,value-db,value);
}else
value
ramp sets the duration of the fade time (in seconds).
Dan
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Eliezer Cisner on Aug 7, 2012 at 8:39:45 pm |
Amazing! Thanks, Dan!
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Eliezer Cisner on Aug 7, 2012 at 8:44:11 pm |
I hate to nag, but I hope you don't mind if I add another query:
I'd like, if possible, to have the audio ramp back up a bit earlier, approximately two seconds before the end of the overlying layer (so the underlying audio is back to normal when the overlying video is complete).
Thank you and sorry...
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Dan Ebberts on Aug 7, 2012 at 11:22:56 pm |
This should do it:
ramp = .25;
db = [12,12];
out = 2;
attenuate = false;
for (i = 1; i < index; i++){
if (thisComp.layer(i).audioActive){
attenuate = true;
break;
}
}
if (attenuate){
L = thisComp.layer(i);
if (time < (L.inPoint+L.outPoint)/2)
linear(time,L.inPoint,L.inPoint+ramp,value,value-db)
else
linear(time,L.outPoint-ramp-out,L.outPoint-out,value-db,value);
}else
value
Dan
| | | | |
• | | | |  | Re: Changing audio levels dependence if there's another video playing on top of it? by Eliezer Cisner on Aug 8, 2012 at 2:56:33 pm |
Dan Ebberts, a genius in our midst.
Thanks!
| | | | |
| |
|