Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions audio amplitude and scale range

  • audio amplitude and scale range

    Posted by Amopix on May 23, 2007 at 8:50 am

    Hello,

    Expressions in after effects is something i am not very familiar with. I am creating a cartoon using sounds effects and I want the eyes of a bird to react to the sounds. I converted the sounds to keyframes and used the scale’s pickwhip of the eyes layer and linked it to “both channels”. I got this expression :
    temp = thisComp.layer(“Audio Amplitude”).effec(“Both Channels”)(“Slider”);
    [temp,temp]
    it works just fine but i would like the scale to be limited in a range something like minimum scale = 50 and maimum scale = 150.
    Hope to read from you.
    Thanks in advance for your help.

    mat

    Lord Scales replied 18 years, 11 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    May 23, 2007 at 12:00 pm

    It’s going to look like this:

    maxAudio = 20; // whatever your maxium audio amplitude is
    temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    linear(temp,0,maxAudio,[50,50],[150,150])

    Dan

  • Amopix

    May 23, 2007 at 1:35 pm

    Thanks a lot Dan.

    mat

  • Lord Scales

    May 23, 2007 at 5:53 pm

    [Dan Ebberts]
    maxAudio = 20; // whatever your maxium audio amplitude is
    temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    linear(temp,0,maxAudio,[50,50],[150,150])”

    Dan, using this wouldn’t we get the same?

    minScale = 50;
    maxScale = 150;

    temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    fS = clamp (temp, minScale, maxScale);

    [fS, fS]

    It is more a test. I am not with AFX in this PC, so I just would like to know with clamp (v, limit1, limit2) cutoffs the value or “fill” it inside the limits.

  • Dan Ebberts

    May 23, 2007 at 6:01 pm

    No, that wouldn’t work. You’d be clamping the audio level (which probably varies between 0 and 20 or so) to the range between 50 and 150. Since it would always be less than the lower limit (50) the result would always be clamped at 50.

    Dan

  • Lord Scales

    May 23, 2007 at 6:19 pm

    Hmm, good point. I created my example thinking in sampling a beat in the audio.

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