Blog > Tutorials > After Effects Tutorials > After Effects Expressions & Audio Tutorial

After Effects Expressions & Audio Tutorial

01.03.2009 Bookmark and Share

1. Create a new project and make a new composition. Next, import some audio, it doesn’t matter what it is anything with sound will work fine. Create a circle by double clicking the Ellipse Tool. When you double click, it automatically will make your circle the size of your composition. (This also applies when creating masks.) After you have your circle make the scale 50%.
After_Effects_Expression_Audio_01.jpg

2. Bring your audio into the composition then right click and go to Keyframe Assistant > Convert Audio to Keyframes.
After_Effects_Expression_Audio_02.jpg

3. A null called Audio Amplitude will automatically be created with your data. Under the effects you’ll see Left, Right, and Both channels. You can delete Left and Right since we won’t be using them for this tutorial. With scale selected on your shape layer go to Animation > Add Expression.
After_Effects_Expression_Audio_03.jpg

4. Use the pick whip and choose “Slider”.
After_Effects_Expression_Audio_04.jpg

5. Do a RAM Preview by pressing the 0 key on the numpad and you’ll notice the animation is rather unpleasant to watch since it’s so quick. Next we’ll change the expression so we can tweak the settings.

Paste this over your expression:
temp = linear(thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”), 0, 40, 50, 100);
[temp, temp]
After_Effects_Expression_Audio_05.jpg

6. You’ll need to find the max value for your Slider data. Turn on the graph editor and then include the Slider in the graph editor. Move the playhead to where the audio peaks and then look at the corresponding value of the slider, it will probably be around 40-50.

In the expression there was 4 numbers: 0, 40, 50, 100.
To break this down in human terms, when the Slider value is 0 the scale of my circle will be 50%. When the slider value is 40 (my max), the circle will be 100%. Replace “40″ with your max value.
After_Effects_Expression_Audio_06.jpg

7. We’ll add a outer glow as a finishing touch.
After_Effects_Expression_Audio_07.jpg

8. Pick whip the Slider after making the Size of your outer glow an expression. RAM Preview your movie again to see the results.
After_Effects_Expression_Audio_08.jpg

The end result is nothing too interesting, but you can apply the same techniques to particle systems or more advanced effects to make nice graphics driven by your audio.

Also you may want to have a look at Trapcode Soundkeys which will allow you to do what we just did, but with a lot more control. You can target certain frequencies and more. You can see a demo here.

Sam Morris After Effects Tutorials

  1. Ned Barth
    March 5th, 2011 at 13:57 | #1

    Very nice tutorial! I'm working through all of them and they are really great. Quick question though: is is possible the above expression has a typo, or some extra spaces or something like that? I've tried pasting it in and AE doesn't like it. Tried debugging it, too, and I think it has something to do with the expression for the first variable (I subbed in "time" and it worked). Thanks for sharing your knowledge, really appreciate it.

    • Jenna
      November 2nd, 2011 at 11:39 | #2

      I'm having the exact same issue.

  2. Michael
    October 21st, 2011 at 20:04 | #3

    is it possible to have two amplitudes going on at the same time for differnt sounds and animations, Like a circle scaling to one vocal track, and a square scaling to another vocal track.

    • behappee
      October 24th, 2011 at 19:30 | #4

      Have you tried converting the different audio layers to keyframes and then changing their names accordingly?

  1. No trackbacks yet.