Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to drive Gain Reduction Meter?

  • Expression to drive Gain Reduction Meter?

    Posted by Willie Frazier on September 12, 2012 at 2:37 am

    Hi everyone,

    I am faced with a bit of a conundrum, and would appreciate some help from the collective wisdom here.

    Presently I am making an audio compressor animation for instructional purposes. This compressor features a pair of VU meters. One for level, which works the way most folks are accustomed to seeing VU meters operate, where the needle bounces in an arc from left to right, with the left most point representing silence, and the right most point of travel indicating the peak of the audio level. I have written an expression that accomplishes this behavior quite nicely:

    r=thisComp.layer(“Audio Amplitude 2”).effect(“Both Channels Smooothed”)(“Slider”)*effect(“multiplier”)(“Slider”)+effect(“offset”)(“Slider”);
    clamp(r,-38,65)

    I am not, however, having much luck in making such a setup for the second meter, which is to be a Gain Reduction meter. This meter works differently than a level meter in that the needle instead hovers at a position analogous with 1 o’clock, and moves to the left only when the audio has passed a certain level and the compressor kicks in. The amount of left travel (done via rotation with an anchor point at the bottom of the needle) coincides with the amount of attenuation the signal receives based on the compressor’s settings.

    This GR meter then, has very little movement, and is only occasionally triggered. I thought the minimal movement would be easy to hand-key, but this has turned out to be a tedious and time-consuming process. I feel there simply must be a way to achieve this with an expression.

    Any help is greatly appreciated,

    – Will

    Paul Roper replied 13 years, 8 months ago 3 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    September 13, 2012 at 3:47 pm

    i have to say that i’m not familiar with a gain reduction meter… but i think that an expression to represent what you’ve described could be done with an if() statement and linear() function…

    ReducThreshold = 65; // the level where compression starts
    ReducMax = 100; // the maximum compression level
    AngleMin = 30; // start position, apprx 1 o’clock
    AngleMax = -30; // move left to some angle

    r=thisComp.layer(“Audio Amplitude 2”).effect(“Both Channels Smooothed”)(“Slider”)*effect(“multiplier”)(“Slider”)+effect(“offset”)(“Slider”);

    if (r>65) linear(r,ReducThreshold,ReducMax,AngleMin,AngleMax) else 30;

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Paul Roper

    September 13, 2012 at 4:29 pm

    Plonk this into your rotation of the gain amount needle:

    (I’ll send you the project too!)

    – Paul

    VU=thisComp.layer("VU needle").transform.rotation;
    linear(VU,-90,0,-90,-45)

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