Start learning with our library of video tutorials taught by experts. Get started

After Effects Apprentice 09: Expressions
Illustration by John Hersey

Driven by sound


From:

After Effects Apprentice 09: Expressions

with Chris Meyer and Trish Meyer

Video: Driven by sound

One fun trick is to have sound appear to motivate, or move, your animations inside of a composition. Well, you can use expressions to help you do that. I'm going to go back to the Project panel and this time open up comp 08-Audio*starter where we have a speaker, we have a colorful background, and we have an audio track. I'm going to press 0 on the numeric keypad to queue up both the video and audio previews. (audio playing) Now expressions cannot directly access sound inside a layer.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
After Effects Apprentice 09: Expressions
1h 37m Intermediate Jul 27, 2011 Updated Nov 29, 2012

Viewers: in countries Watching now:

Expressions are one of the most powerful but underused features in After Effects. They can be used to animate layer properties with code, as compared to explicitly keyframing every value in the Timeline, and have multiple parameters and layers that follow the lead of a master layer or controller effect, making it much easier to coordinate complex animations and quickly accommodate client changes. In this introduction, Chris Meyer shows how to let After Effects do most of the work by creating simple but very useful expressions that can be put to work on a wide variety of jobs.

The After Effects Apprentice videos on lynda.com were created by Trish and Chris Meyer and are designed to be used on their own and as a companion to their book After Effects Apprentice. We are honored to host these tutorials in the lynda.com Online Training Library®.

Topics include:
  • Creating and managing expressions
  • Linking together different parameters
  • Randomizing a layer's movement
  • Looping an animation
  • Controlling multiple layers from a single source
Subjects:
Video Motion Graphics Visual Effects
Software:
After Effects
Authors:
Chris Meyer Trish Meyer

Driven by sound

One fun trick is to have sound appear to motivate, or move, your animations inside of a composition. Well, you can use expressions to help you do that. I'm going to go back to the Project panel and this time open up comp 08-Audio*starter where we have a speaker, we have a colorful background, and we have an audio track. I'm going to press 0 on the numeric keypad to queue up both the video and audio previews. (audio playing) Now expressions cannot directly access sound inside a layer.

I'll type LL to reveal the audio waveform for that layer. However, there is a very handy keyframe assistant that can take that sound and create the keyframes for you. I'll go to Keyframe Assistant > Convert Audio to Keyframes. This looks at all your audio layers inside of composition and creates one null object-- remember, we said nulls make great master controls--and by pressing U to reveal keyframes, creates a stream of keyframe values that represent the loudness of the audio.

Notice here where the audio is quieter, the values derived are relatively low. Just a couple frames later where the audio is louder, those values jump up higher. Same thing here, low audio amplitude, low keyframe values; a little bit later, louder, higher values. If you want to see this more graphically, again, don't be afraid to go into that Graph Editor. You can select each of these parameters and see the resulting value graph. And actually, I would recommend going around and seeing what your minimum values are, your lowest points there, is around 6.

What your highest points are, here a little over 50. Look at the Right Channel, highest value looks to be about 50 again, lowest value in the order of 5, and Both Channels kind of like the stereo mix. Don't select just the effect like I just did; select the actual parameter. There is a slider. Maximum value 50, minimum values around 5 again. Okay, keep those in mind, because now we know what is the value range of our loudness. I'm going to turn off the video switch for this controller. Just get rid of that little red box.

Okay, let's turn our attention to the speaker. We want that woofer to bounce along in time with the music. Turn off our Graph Editor and then twirl up the Left and Right Channels, because I think I'm going to use Both Channels since I only have one mono speaker here. For the speaker, we've already applied an effect for you. I'll press F3. We've applied the Bulge effect to this speaker. We've gone ahead and set the center of the bulge to be right at the center of that speaker cone. That way as you control the Bulge Height, you can make the speaker push out and pull in.

Again, scrub this value a little bit while watching the speaker and get a feel for what value range seems to make sense. I think at my loudest excursions I might want to go to probably no more than 1, to be honest. Yeah, -1 looks like it's pulled in quite a bit as well. So +1 or -1 looks like a good range for my Bulge Height. I'm going to twirl up Levels and Drop Shadow just to reduce confusion in this display. Okay, I want to create an expression to have the Bulge Height follow my Audio Amplitude.

Remember, earlier in this lesson, we said there was a great expression that made your life easier for doing things like that, the Interpolation expression, such a linear. I want to enable expressions for the Bulge Height. Again, hold Option or Alt, click on stopwatch. The parameter will automatically be opened up down here in the Timeline panel for me. Now, for the Interpolation expression, I can either take advantage of the Expression Language menu and open up Interpolation and select one of the linear expressions and start replacing its values, or eventually, you'll find you remember this--it's faster to type it in yourself.

So I'm going to type in "linear," open parentheses, and then remember the following mantra: as a parameter goes from A to B, I want to go from Y to Z. Those are the numbers you need to enter to make linear work. Okay, what's the parameter I want to follow? I use the pick whip and select Audio Amplitude's slider value. After Effects has already typed in the necessary code for me. Type a comma. You'll always need a comma to separate parameters. The spaces are optional, but you need the commas.

Okay, as that parameter goes from its minimum to maximum, what do we say were the minimum and maximum values? About 5 and about 50. Okay, now where do I want to go from? I want to go from, say, -1 to 1. This is not going to be an exactly accurate representation of a speaker because unfortunately Audio Amplitude only goes in the plus direction. It doesn't go plus and minus like a speaker should. But this will still give us an animation that's in time with the music, and it will be good enough to fool the viewer.

Now let's go ahead and close parentheses to close off the parameters for linear and click anywhere to accept the expression. I'm going to scroll down a little bit here, so that you can see the audio waveform better. And let's go ahead and RAM Preview, watching the audio waveform and the resulting action of the speaker cone. Press 0 to RAM Preview. (audio playing) That was pretty easy.

That's a pretty cool animation-- a lot easier than trying to do it by hand, too. Now for your challenge, why don't you make this animation work in stereo? Why don't you create two of these speakers and hook one of them up to the Left Channel and the other one to the Right Channel and see if they animate differently. Now, truth be told, the Convert Audio to Keyframes command inside After Effects isn't all that powerful. There are better third-party alternatives available. Trapcode's Sound Keys is great and Boris Continuum Complete also contains a really nice audio-to-keyframe converter.

So if you like this sort of trick, I would suggest buying one of those third-party effects so you have even more control.

Find answers to the most frequently asked questions about After Effects Apprentice 09: Expressions.


Expand all | Collapse all
please wait ...
Q: This course was updated on 11/29/2012. What changed?
A: We have added exercise files designed for After Effects CS6. We also added a movie that shows our premium subscribers how to use the exercise files.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed After Effects Apprentice 09: Expressions.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.