3

How to Make Visual Elements React to Audio In After Effects

 1 year ago
source link: https://www.makeuseof.com/after-effects-make-visual-elements-react-to-audio/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to Make Visual Elements React to Audio In After Effects

Published 3 hours ago

Want to animate your visual elements to the beat of the music? Let's show you how in After Effects.

After Effects dashboard showing audio graph of sound range.

Adding audio to a video in After Effects is easy, but what if you want to use visuals with your audio? Well, that’s easy too.

Whether it’s a logo, illustration, or text, you’ll be able to make it move in sync with the audio by the time you’re done reading this article. Not only that, but you can make anything else react to audio in After Effects, too.

Let’s jump right in.

Importing Elements to After Effects

For this project, you’ll need a piece of audio, a still image or video footage, and an illustration or written phrase.

Start a new project in After Effects. Import your still image or video footage to the Project panel. You can do this by dragging the files from your desktop or by double-clicking the Project panel and opening a file directly.

The audio is the most important element. You can download royalty-free audio—something with heavier beats will work best. We’re going to use Fun Life by Fassounds.

With your audio downloaded, drag it into the Project panel. We’re using the entire length of audio for the video, but you can just use a section of it if that’s all you need.

For the visual element—the part reacting to the audio—you can use a premade illustration with a transparent background, or add a visual in After Effects. We’re going to write a phrase directly in After Effects. If you want to import a phrase or illustration from other programs, you can create a transparent background using Illustrator or using Photoshop or Canva.

Drag your background image or video footage into the timeline panel, as well as your audio file. If you have a premade visual asset, drag that in, too. If you’re writing a phrase in AE, you can write it after the other elements are in the timeline panel.

After Effects composition with photo of sunset and black text saying

Hit the Text Tool (Cmd + T for Mac or Ctrl + T for Windows) to type your phrase. Use the Character, Paragraph, and Align menus on the right to format your text. Choose a font style that matches the music and a phrase that works with your image or video footage. Your text will be on its own layer in the timeline.

Using Keyframes With Audio In After Effects

Keyframes are a commonly used tool in After Effects, but you can use them for more than just visual transformations. Engaging with keyframes on your audio layers will open a whole new world.

Identify the Audio Keyframes

First, we need to extract information from the audio. Right-click on the audio layer in the timeline and go to Keyframe Assistant > Convert Audio to Keyframes. This will analyze the audio and produce a new layer called Audio Amplitude.

After Effects layers showing Audio Amplitude layer.

Within the Audio Amplitude layer, click Effects, and you’ll see three channels—left, right, and both. Within each of those channels are keyframes that relate to the audio.

After-Effects-Zoomed-Timeline

They won’t look like obvious keyframes at first, but if you zoom in on the timeline using the toggle at the bottom, you’ll see them more clearly.

Unless your audio has specific beats only in the left or the right channels, you should just focus on the single layer for both channels.

After-Effects-graph-editor

To view the audio’s keyframes as a graph, click Both Channels > Slider > Graph Editor. If you’re zoomed out on the timeline, the graph will look chaotic, but if you zoom in, it smooths it out.

Visually, the graph shows the volume of the audio. So louder music or beats will have larger spikes in the graph, versus quieter areas of the song having smaller spikes.

Make the Visual Element React to Audio With Scale

If you’ve used After Effects before, you’ll know that the keyframes of visual elements are found under the Transform label in the layer. Opening that label shows the Transform options: Anchor Point, Position, Scale, Rotation, and Opacity. We’re going to make our text change in scale as a reaction to the audio.

After Effects layer Scale with code expressions.

On the text layer, open Transform and find Scale. Hold down Alt (Windows) or Option (Mac) and the stopwatch next to Scale. This opens further options, including the ability to write our own expressions in code to animate the audio.

After Effects layers showing expression pick whip being dragged to audio slider.

Click the Expression Pick Whip button (swirl icon) and drag it to the Slider on the audio layer; a blue line will appear when you drag.

After Effects slider layer expression code.

This adds a line of code to the text’s Scale layer. You’ll notice the size of the text changes too. Now, the text starts at 0% size and only expands to 100% at the loudest parts of the music, which isn’t very often.

After Effects Scale expressions code.

To change that, we need to add some information to the end of the code. After [temp, temp], write + [100, 100] at the end. This results in your text or image starting at 100% size and only getting bigger with the beats, rather than any smaller.

Add Range to Your Visual Reactions

While the previous technique does the job and makes the visual asset react to the audio, perhaps it may be reacting too much. If you want the text to react only to larger beats in the music and not every beat in the music, you can smooth out the Slider keyframes.

After Effects layer slider value set to 0,0,0,0.

Go to the audio layer’s Slider and hold Alt (Windows) or Option (Mac) while clicking the Slider keyframe stopwatch. Delete the expression code that appears. In its place, write ease(value,0,0,0,0). You can edit these numbers for more detailed movements later.

The first two value numbers relate to the range within the audio expression that affects the Slider (and don’t forget your text layer is connected to the Slider). If you hit the Graph Editor button, you can see the range of audio by hovering over each point and seeing the unit numbers.

If your song starts quietly, you may see low ranges until the audio really gets going. If you only want to sync text to the audio once the beat kicks in, look at the ranges when the beat starts. The song we’re using starts with a heavy beat. We’re going to choose mid-range unit numbers, so the text only reacts to larger beats and not every beat.

The mid-range is around 20-30 with the max range at 50. Look at your own audio to decipher your appropriate mid-range. Click off of the Graph Editor and go back to your line of code. Change the first 0 to your lower range number and the second 0 to your higher range number.

The second set of value numbers determines what your range will be in percentage terms. The first 0 should stay the same to determine that everything up to your first number is treated as 0%. The final 0 should be changed to 100 to represent 100% of the size for everything between your first and second numbers.

After Effects ease values.

So if you had 25 and 50, your code should now read: ease(value,25,50,0,100). Change these at your own discretion if you want more dramatic reactions.

To make your reactions a little smoother, go to Window > Smoother to open the Smoother menu. Then change the tolerance to 10. This only makes a minute difference, but it creates slightly softer movements to your element reactions.

Which Animations Work Best With Audio?

While we focused on Scale for this tutorial, the audio reaction can be applied to any visual effect found in After Effects. To apply the effect, just hold Alt (Windows) or Option (Mac) while clicking the stopwatch of any effect, and then drag the Expression Pick Whip (swirl icon) to the audio Slider.

You can apply splashes of brightness with the effect, even while another effect is present. You could also change opacity with the beat, or movement with the anchor point. Anything that’s available in After Effects can be easily attached to your audio channel for a fully immersive experience.

Sync Visual Elements to Audio In After Effects

Having the ability to sync your text or visual assets to any audio is a skill that’s going to make people think you’re a superstar video editor. Take your new After Effects skill and apply it whenever you want to add some great sounds with great visuals in your videos.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK