X Course Advisor FREE Course Advisor
Watch Tutorials
Animating with Sound in After Effects, Part 1

Check out our AA MasterClasses courses!

Using sound to drive animations is a lot of fun in After Effects. If you don’t have the resources to buy a dedicated plug-in like Trapcode Sound Keys don’t worry. Extracting and converting the amplitude data of a sound file and turning it into Keyframe data is really easy. You can then use this data to drive any parameter in After Effects with Expressions.

In this tutorial I’m going to show you the basics of how this is done. You’ll find the resources used in a project file.

Step 1 - Set Up Your Project

I’ve created a New Composition (Command-N) and called it "Sound Animation". It’s 500px x 300px, with a duration of 8 seconds at 30 fps.

I’m going to import a sound file I made of a simple drum beat. I do this by going to File > Import > File or hitting Command-i

Important: Before you do this make sure your Project sample rate is set to the same one as your audio. In my case 44.1khz. This is found in File > Project Settings. After Effects defaults to 48khz.

Drag the audio file into the Sound Animation tab from the Project window. If you select the audio file and hit (LL) you will see the waveform.

Step 2 - Convert Audio to Keyframes

In the Comp, Control-click (or right-click) on the audio file and select Keyframe Assistant > Convert Audio to Keyframes

When this is done you’ll have a new ‘Null Object’ layer called ‘Audio Amplitude’. Select it and press "E" to show Effects. Click the disclosure triangle beside ‘Both Channels’ and then click on ‘Slider’. Hit the Graph Editor button (see orange arrow in the figure below) to see the generated keyframes.

You can delete the ‘Left Channel’ and ‘Right Channel’ effects as we don’t need them for now. If you look in the Effects Controls panel, you should see your Slider. This is what’s holding the ‘Audio Amplitude’ Keyframe values. Now we want to connect this up to something.

Step 3 - Changing Opacity

Expressions in After Effects are based on Javascript. They enable you to link and drive parameters with other parameters or change parameters with things like Sliders (like our ‘Both Channels’ slider).

You don’t need to know how to write Javascript like a pro as After Effects will do most of the work for you via the Pick Whip. The Pick Whip enables you to visually link parameters and After Effects writes the expression for you. Here’s a simple example.

Create a new Solid (Command-Y), make it white, 100px x 100px. Call it ‘Box’.

With the ‘Box’ layer selected press T to reveal the ‘Opacity’ controls. 

Now Option-click the stopwatch icon by Opacity to show its Expressions controls. You should see some text appear:

Drag from the Pick Whip icon (the swirly shell-shaped one) onto the ‘Slider’ on the Audio Amplitude layer.

You should now see that AE has written an expression in the text field which has linked the Opacity value to the current value of the ‘Slider’ on the Audio Amplitude layer. 

Looking at the screenshot below, you can see the value for Both Channels is 23.30 and that the Opacity percentage is rounded down to 23%. The Audio Amplitude ‘Slider’ is now controlling the ‘Box’ opacity value.


Let’s break the expression down quickly so you can see what it’s doing:

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

  • thisComp. : refers to the current Composition (Sound Animation)
  • layer("Audio Amplitude"). : the Audio Amplitude layer in the Comp.
  • effect("Both Channels") : refers to the effect instance inserted on the layer.
  • ("Slider") : points to the effect parameter we want to get our values from.

When pick whipping you’ll see this kind of expression format a lot. Once you're more familiar with them it becomes easier to edit and manipulate them. Speaking of which...

...we have a bit of a problem in the fact that the values generated by the Audio Amplitude Keyframes are a bit low. The peak value is about 23.30 and we need a value closer to 100 for our Opacity percentage. 

We can easily remedy this by adding some simple math to the expression, say multiplying the value of Audio Amplitude ‘Slider’ by 4!

So all I need to do is add "*4" to the end of the Expression:

thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider")*4

You can see that adding this equation to the Expression gives us a much healthier Opacity value.

This is the result of the audio keyframes driving the opacity value of ‘Box’. 

Step 4 - Pumping A Speaker

So let’s try another basic example. This time we’re going to use the audio data to drive a parameter of one of After Effects built-in plug-ins on an image. Hide the ‘Box’ layer.

I’ve imported an image of a speaker I made in Cinema 4D, and dragged it into my Comp.

Go to the effects panel and select Distort > Bulge. Drag the effect onto the layer.

I’ve set up the Bulge effect with these values:

Now Option-click the stopwatch icon to the left of the Bulge Height parameter to reveal the Expression settings.

Drag from the pick whip icon onto the ‘Slider’ on the Audio Amplitude layer (see screenshot).

We now have a problem in that the Bulge Height value only goes up to 4. Our Audio Amplitude ‘Slider’ values are maxing out the effect to the extreme. The maximum Bulge height value I need is 1. 

To keep these values within an acceptable range, you can divide the value of the Audio Amplitude ‘Slider’ by its maximum value, which is 23. This means that at the maximum peak level of 23, we will get a Bulge Height value of 1 (23/23 = 1). Slider values below 23 will result in a decimal lower than 1, which is good!

Here you can see the equation at the end of the Expression:

And here's the final result of the effect:

Download the macProVideo.com Hub After Effects Animating with Sound Project Files here.

So there you have it: a couple of simple examples showing you how you can drive parameters with sound. Next time I’ll show you how you go about dealing with parameters that are Arrays and how you use Variables to simplify the process with Expressions. 

We’ll set up some controls to fine tune a more complex animation using sound.

To learn more about Motion Tracks and Stabilization in After Effects.

Check out our AA MasterClasses courses!

Toby Pitman

Toby Pitman | Articles by this author

For the past 20 years Toby has worked as a professional guitarist, programmer and producer. Clients include Sir Paul McCartney, George Michael, Shirley Bassey, Yusuf Islam, Giles Martin as well as the London 2012 Olympic Ceremonies. He has also worked extensively in TV, Advertising and Film. As well as composing himself he has also worked alongside many composers like David Arnold, Clint Mansell and Simon Franglen on many major film releases. An expert in synthesis and sound design Toby has also lectured for Apple on their Logic Pro music software which he has used since its days on the Atari. He has also worked as an educator for the International Guitar Foundation and the Brighton Institute of Modern Music teaching guitar. In his spare time (of which there is very little) he moonlights as a motion graphics artist specialising in Cinema 4D and After Effects.


You must be logged in to post a comment.
Create an Account  Login Now

What is macProVideo.com?

macProVideo.com is an online education community featuring Tutorial-Videos & Training for popular Audio & Video Applications including Adobe CS, Logic Studio, Final Cut Studio, and more.
© 2018 macProVideo.com
a division of NonLinear Educating Inc.