Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using expressions to control Audio Levels

  • Using expressions to control Audio Levels

    Posted by Luis Morales on May 25, 2008 at 3:52 pm

    Hello everyone.
    I know this is feasable the problem is that my knowledge of expressions is still a little limited. I have created this videowall, made up of several video layers in 3D space, and each one has its own audio track. Now, what i’d like to do is come up with an expression that links either the camera’s position or point of interest with each of the layers’ audio levels, so when we’re looking at an specific portion of the videowall, we only hear the audio coming from the video we’re looking at. So far, I figure the expression would have to retrieve either the camera’s position or point of interest and based on the match between that and the actual layers’ position, set the audio level to a certain value.
    I hope this makes sense to somebody else…
    Any ideas on how to approach this are welcome.

    Have an excellent day,

    L

    Mike Clasby replied 17 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Mike Clasby

    May 26, 2008 at 1:10 am

    This works for a video wall if the videos are not children, like, not parented to a Null. When the camera’s POI is within 40 pixels of the video’s position it’s Audio will be at Audio Max (AudMax) or have an Audio Level of 0. At 60 pixels or greater it will be at AudMin, or –100 Audio Level.

    Put the Expression on the Audio Level (LL reveals)(Copy the Expression, Alt Click the Audio Level Stopwatch, Paste):

    audLevUp = 40;//at this distance from anchor point or less audio Max
    audLevDown = 60;//at this distance from anchor point or greater audio Min

    AudMax = 0;//Max Audio Levels
    AudiMn = -100;// Min Audio Levels

    point1=this_layer.position;
    point2=thisComp.layer(“Camera 1”).pointOfInterest;
    delta=sub(point1, point2);// Find the vector between them
    distance=length(delta);// Now find the length

    linear(distance, audLevUp, audLevDown, [AudMax,AudMax],[AudiMn,AudiMn]);

    To put the same expression on several layers at once (they’ll all need it), put it on one layer first, select the expression, Edit>Copy Expression Only, Select all the layer you want to get it, then Paste.

    This is a modification from here:
    https://jjgifford.com/expressions/geometry/length.html
    Example: Interactive Blur

    Let me go see if I can figure out that world vector thing again (or rob from Dan this time).

  • Mike Clasby

    May 26, 2008 at 4:00 pm

    After looking at my expression I realized that in the test i had re-sized the videos in the wall to 25%, so the first two paramters, audLevUp = 40 and audLevDown = 60 are too small.

    You might try something like 200 and 240.

  • Luis Morales

    May 26, 2008 at 5:04 pm

    Thank you very much Mike, it works like a charm…
    I had to set-up a little bit further since my videowall was actually a pre-comp in 3D space, so I reimported my video layers shut video off, and positioned them where they are actually sitting in the 3D comp, then applied your expression (with new values) and it works! It’s exactly what i needed. This is saving LOTS of time, so THANKS a LOT!!!
    Hope I can help you out some other time.
    Take care,
    L

  • Mike Clasby

    May 26, 2008 at 6:22 pm

    Great!

    I’m glad they weren’t parented to a Null, I still haven’t noodled that out.

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