3 Replies Latest reply on Apr 6, 2016 8:36 AM by Rick Gerard

    expression for wiggle scale to audio amplitude

    geoffsilvertip Level 1



      I'm new to AE so be gentle...


      I'm trying to make an image wiggle scale to the beat of the audio.


      I have successfully pick whipped it (hooray) and it works.


      However - it's too much and I need to scale it back!


      What expression do I need to use to limit the movement against audio peaks?




        • 1. Re: expression for wiggle scale to audio amplitude
          Mylenium Most Valuable Participant

          Multiply the value by whatever other value you fancy.



          • 2. Re: expression for wiggle scale to audio amplitude
            Szalam Adobe Community Professional & MVP

            You want your number to be smaller. So think back to math you did in school. The first thing I would try would be to add / 2 to the end of your expression or *.5 . That'll cut your value in half.

            • 3. Re: expression for wiggle scale to audio amplitude
              Rick Gerard Adobe Community Professional & MVP

              Type linear expression in the search help field at the top right corner of AE to study up on how that works.

              linear(t, tmin, tmax, value1, value2)

              That is from memory but you'll figure it out. "t" would be the pickwhip value. You could also use the ease functions. You'll find them under interpolation in the expression language menu in the timeline.


              The graph editor can help you figure out the tmin and tmax values. Then you just need to build an array for scale. For example if Both Channels went from 0 to 25 and you wanted the scale to go from 100% to 75% you would build the expression like this:

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

              s = linear(t, 0, 25, 100, 75);

              [s, s]

              This expression keeps the layer at 100% scale when the audio level is 0 and scales it down when it is at it loudest point. If you want the reverse to happen just reverse value1 and value2.