In this post, you will learn how to create an audio meter using shape layers in After Effects.
Alright, so we are in After Effects but first, let me show you what we are going to be creating today.
As you can see from the image above, we are going to be creating an active audio meter all with shape layers in After Effects.
If you remember, back in tip number 49, I showed you how to create an audio meter using text and expressions in After Effects, but today we are going to be using shape layers.
By the way, I won’t be able to show you everything you see in this composition from scratch. Instead, I will show you the most important parts and you should be able to figure out the rest.
If you want to get the most out of this tutorial, then I highly recommend downloading the project file for this tutorial and following along!
Alright, now let’s start creating our audio meter with shape layers!
Double click on the rectangle tool to bring it inside of our composition.
Change the size of the Shape Layer 1 from 1920 x 1080 to 130 x 30. To do that we need to collapse the Shape Layer 1 and go to Contents – Rectangle 1 – Rectangle Path 1 – Size.
Select Contents, go to Add and select Repeater.
The Repeater takes our Shape Layer 1 and then repeats it as many times as we want.
I want our Shape Layer 1 to repeat 20 times. So under copies, I will change that number from 3 to 20.
Right now my Shape Layer 1 repeats itself to the right. I want to change the direction. To do that I need to change the position of Repeater 1 from 100 to 0. (Repeater 1 – Transform: Repeater 1 – Position)
And the second number, which is 0, needs to be changed to -40 because I want our audio meter to go up.
Select Shape Layer 1 and do CTRL+ALT+Home (CMD+OPT+HOME on a Mac) to center the pivot point.
Press CTRL+HOME (CMD+HOME on a Mac) to center the shape in our composition
That is exactly what I want and now we are ready for animation!
I am first going to convert the welcome to ukramedia.wav audio waves into keyframes because I want the actual value so I can do something with it.
To do that we are going to right-click on the welcome to ukramedia.wav and then go to Keyframe Assistant – Convert Audio to Keyframes.
Now we have a new solid that has been created.
We can select our new solid Audio Amplitude and hit U on the keyboard to see all the keyframes.
We have a Left Channel, a Right Channel and then Both Channels.
If I move the time indicator in the timeline, you can see that the numbers for our Left, Right and Both Channels are exactly the same.
Select the Right and the Left Channel and hit delete to get rid of them. That way we only have one channel to worry about.
Go back inside of the Shape Layer 1 and then select the copies and then hit S twice to solo it.
ALT+CLICK on the Copies stopwatch icon to activate an expression.
Let’s define some variables inside of the text box. I am going to say audio = and then I will pick-whip to Both Channels slider property.
audio = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
Next, I am going to do a linear expression. The linear expression kind of restricts the numbers. For example, right now if I look at our audio waves, I can see that the circled audio wave in the picture below is probably the highest point of our audio.
And if we scroll through the timeline with our time indicator, we can see that the slider number of our Both Channels is never higher than 19.
I think if I say do not go higher than 19 then we are probably going to be safe. In other words, our audio wave for this project goes from 0 to 19. I do not think it gets higher than 19.
With that said, I am going to restrict it with linear expression. So I am going to say linear() and I am going to say take the values from Both Channels slider like so:
Then from there, I want my lowest number to be 0 and then my highest number to be 19.
linear(audio, 0, 19)
And so when it is 0, I want it to be 0 as well and when it is 19, I want to be 20 because I have 20 bars and I do not want to go higher than 20. So essentially, we are just restricting numbers here.
linear(audio, 0, 19, 0, 20)
Alright, now let’s see what happens!
If we start playing from the beginning, you can see it works quite well. The bars are responding to the audio.
Now the cool thing about our bars being a shape layer is that we can actually add more things to it. We can add another Repeater by going to Contents – Add – Repeater.
We can go inside Repeater 2 and play with the different properties that it has to offer.
For example, we can give our wave bars some breathing room by adjusting the Transform: Repeater 2 Position.
We can play around with scale.
The sky is the limit to what we can do here. We can also add other things like Zig Zag.
Hopefully, you get an idea of how powerful and useful it can be.
I hope you found this post useful. If you would like to learn more about Expression and how it can speed up your workflow in After Effects, check out my Learn After Effects Expressions Course.