Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
LIBRARY:TutorialsVideo TutorialsReviewsInterviewsEditorialsFeaturesBusinessAuthorsRSS FeedTraining DVDs

Synchronizing Animation to Audio Using After Effects

COW Library : Adobe After Effects Tutorials : Dan Ebberts : Synchronizing Animation to Audio Using After Effects
Synchronizing Animation to Audio Using After EffectsÂ’ Layer Markers and Expressions


from CreativeCow.net's ''25 Cool Things about After Effects 5.5'' Series


Synchronizing Animation to Audio Using After Effects' Layer Markers and Expressions
Dan Ebberts Dan Ebberts,
Sacramento, California, USA

©2002 by Dan Ebberts and CreativeCow.net. All rights are reserved.

Article Focus:
In after Effects 5.5, Adobe has added the capability for expressions to access keyframe and marker data. In this tutorial, Dan Ebberts will focus on how to use this new capability to synchronize an animation to an audio track using layer markers and expressions.


Download Movie Project file (includes ai file) Download Stuffit Expander for Windows

One of the very cool things about layer markers is that you can tap them in by hitting “*(the asterisk) on the numeric keypad while you preview the audio of a comp. This is very handy in visually identifying where points of interest (often “beats” in a piece of music) occur in the audio so that you can synchronize your animation to the audio.

The basic concept that we’re going to explore here is the idea that it’s possible to have an expression play a particular piece of the animation anywhere you put a layer marker. We’ll accomplish this by putting the expression in the time-remapping property of the layer. The expression will be in this form:

hit=marker.key(1).time;
t=time-this_comp.layer("drums.wav").marker.nearest_key(time).time;
t+hit


We’ll look at this expression more closely later.

We’ll actually be using layer markers in two layers to accomplish each synchronization. The pre-comp that contains the animation will have a single layer marker at the “hit point” which is the point of time in the action that we want to match up with the audio event. The other layer will have layer markers set in sync with the audio wherever we want the animation to occur. In the resulting animation, the “hit” will occur at each layer marker in the synchronizing layer.

To demonstrate how this works, I’ve assembled a little demo comp. Open the project in After Effects and then open “main comp” and preview it to examine the finished product. Here we’ve got an animated drummer synchronized to an audio track. Using the technique I’ll describe here, I was able to keyframe one drum hit, one cymbal hit, and one head nod and then use layer markers and expressions to make those animations repeat in sync with the audio. Most of the action takes place in the “drummer.ai” comp so go ahead and open that. This comp started out as an Illustrator file (containing the drummer’s body parts and drum pieces) that was imported as a comp.

Illustrator file after import as comp


To this comp I added the audio layer “drums.wav” and two null layers (for the synchronizing layer markers). Then I pre-comped all the moving pieces into their own comps.

Illustrator file comp after additional layers and precomps added


The drummer was “stitched” together in After Effects by moving the anchor points of the various body parts to the joints using the pan behind tool and then parenting the parts together (see my Creative Cow tutorial Animating a Walk Cycle for more information on how to do this). The cymbal was stitched together in the same manner. For each of the moving pieces I set up a short keyframed segment of motion by setting keyframes for the rotation property of the pieces involved. For example, open “cymbal comp”, select all the layers and type “u” to reveal the keyframes. Scrub the timeline to see the animation. Notice that only one cycle of motion has been keyframed. You can examine the other animated comps (“l arm comp”, “r arm comp”, and “head comp”) in the same way if you’d like. When you’re done, return to the “drummer.ai” comp.

time to sync up.

In this example we have an audio clip consisting of a snare drum and a ride cymbal. We have an animated drummer and we want his left hand in sync with the cymbal and his right hand in sync with the snare (OK – so he’s a left-handed drummer) and we’re going to have his head nod in sync with the “beat”. We also want the cymbal to react when the drummer strikes it. To accomplish this we’re going to need three “sync” tracks. One will have a layer marker every time the snare is hit, another will have a layer marker every time the cymbal is hit, and the third will have a layer marker on each “beat”.

In this case, we will put the layer markers for the snare right on the audio layer (drums.wav). We’ll need two dummy layers for the other sync markers (here we’ll use null layers – “Null 1” for the cymbal and “Null 2” for the beat. I put the layer markers in by selecting the layer, starting an audio preview by hitting the “.” on the numeric keypad, and then tapping the “*” key on the numeric keypad wherever I wanted a marker. Then I fine-tuned each marker position by dragging it until it was in the position where I wanted the “hit” to occur.

Since the synchronizing expression is going to be applied to the time-remapping property of each animated layer, I had to enable time-remapping for each of those layers. I did this by selecting the layer to be animated and selecting “Enable Time Remapping” from the Layer menu. Then I typed “rr” to reveal the Time Remap property and Alt-Clicked (Opt-Click on the Mac) the little stopwatch to enable the expression for the property. Then I entered the synchronizing expression.

Select the “r arm comp” layer. Type “rr” to reveal the Time Remap property and click the little twirly to reveal the expression. Click the equal sign next to the little stopwatch to disable the expression. Scrub through the first part of the time line and notice that with the expression disabled the drumstick held by the right arm strikes the drum once at the layer marker.

with expression disabled hit occurs at “r arm comp” layer marker


Re-enable the expression by clicking the equal sign again and scrub through the timeline. Notice that with the expression enabled, the drumstick now hits the drum in sync with the layer markers in “drums.wav” layer.

with expression enabled hits occur at “drums.wav” layer markers


Let’s take a closer look at the expression itself:

hit=marker.key(1).time;
t=time-this_comp.layer("drums.wav").marker.nearest_key(time).time;
t+hit


Let’s dissect it a little and see what’s going on. The first two lines of the expression use the new capability added to After Effects 5.5 that allows access to layer marker properties. The first line creates a variable called “hit” that is the time at which the first (and in this case – only) layer marker of “r arm comp” occurs. The second line defines a variable “t” that is the difference between the current comp time and the time of the nearest layer marker in the “drums.wav” layer (which has a layer marker for each drum hit). The last line simply adds the two variables and the result gets plugged into the time remapping property of “r arm comp”. What does all this accomplish? Consider the case when the comp time is exactly the same as one of the layer markers in “drums.wav”. In that case, “t” will be zero, which means that “r arm comp” will have its time remapped to its own “hit” marker. The net result of this is that wherever there is a layer marker in “drums.wav”, “r arm comp” will be time-remapped to the point where the drumstick hits the drum. In fact, the whole range of animation around the “hit” point in “r arm comp” gets remapped to sync up with the layer markers in “drums.wav”.

Pretty cool, huh?

This same technique is used to sync “l arm comp” and “cymbal comp” to the layer markers in “Null 1”, and “head comp” to the layer markers in “Null 2”.



###Dan Ebberts.
If you have any questions or comments, please visit the CreativeCOW.net After Effects forum.




Please visit our forums and view other articles at CreativeCOW.net if you found this page from a direct link.


  Adobe After Effects Tutorials   •   Adobe After Effects Forum
Reply   Like  


Related Articles / Tutorials:
Adobe After Effects
What's new in After Effects CS6: Shapes from Vector Layers

What's new in After Effects CS6: Shapes from Vector Layers
  Play Video
In this tutorial, Kevin P McAuliffe shows you how, using the great new "Create Shapes from Vector Layers" command in After Effects CS6, you can create 3D extruded client logos in minutes, as opposed to having to wait hours for a 3D application to render it out.

Tutorial, Video Tutorial
Adobe After Effects
AE Basics 44: Shaping Text And Advanced Options

AE Basics 44: Shaping Text And Advanced Options
  Play Video
AE Basics - A Creative COW series for new users of Adobe After Effects. Lesson 44: In this (more advanced) tutorial, Andrew Devis shows the options to change the way text moves through its range and explains how to change this from the default smooth animation to a much more 'digital' or abrupt instant change. Andrew then goes on to demonstrate more of the advanced options in the timeline to 'shape' your text so that it can have a more interesting or dramatic look allowing for the type of animation that would be very difficult to achieve otherwise.

Tutorial, Video Tutorial
Adobe After Effects
Create a Rotating Counter TWO: Adding & Adjusting a Bounce

Create a Rotating Counter TWO: Adding & Adjusting a Bounce
  Play Video
In the second part of this 2 part tutorial, Andrew Devis shows how to animate the rotation of this group of layers as well as how use and adjust an expression that ships with After Effects to have the layers bounce in place as they stop which can give the sense of the counter having some real mechanical properties rather than just a linear of easy-ease keyframe approach.

Tutorial, Video Tutorial
Adobe After Effects
Create a Rotating Counter ONE: Positioning 3D Layers

Create a Rotating Counter ONE: Positioning 3D Layers
  Play Video
In the first part of this 2 part tutorial, Andrew Devis shows how to create and place layers in 3d space such that they can be rotated as a single group to be used for a rotating counter. Andrew shows how to create and place the layers using both the math function of AE as well as a handy and simple expression that places layers a fixed distance or rotation from the previous layer. He then goes on the show how to create and use a controller for the multiple layers so that they act as a single group. In the next tutorial, Andrew will show how to animate the rotation of this group of layers as well as how use and adjust an expression that ships with After Effects to have the layers bounce in place as they stop which can give the sense of the counter having some real mechanical properties rather than just a linear of easy-ease keyframe approach.

Tutorial, Video Tutorial
Adobe After Effects
Confessions of a Creative Maniac: Keys to Getting It In

Confessions of a Creative Maniac: Keys to Getting It In

In the history of computing, including the extension to the notion of what actually falls under the guise of history - let's face it, smartphones are really just diminutive computers in a somewhat flimsy disguise - an often overlooked aspect of the entire discussion is something absolutely core to the idea of how these communications devices interface with us - the venerable keyboard.

Editorial
Adobe After Effects
Introducing After Effects CS6 - Extruded Text and Shapes

Introducing After Effects CS6 - Extruded Text and Shapes
  Play Video
In this introductory tutorial to the new 3D capabilities of After Effects CS6, Kevin P McAuliffe shows the basics of how to extrude text and shapes inside of After Effects CS6, and also shows how tight integration with Adobe's Illustrator will have you creating powerful client logos in minutes, instead of in separate 3D applications.

Tutorial, Video Tutorial
Adobe After Effects
Adobe After Effects: Compositing Actors in Virtual 3D Sets

Adobe After Effects: Compositing Actors in Virtual 3D Sets
  Play Video
Rob Mize follows up his Creating Virtual 3D Sets tutorial with this demonstration of how to composite real-life actors into these 3 dimensional environments. Learn how to create an effective sense of interaction between your actors and their virtual environment using only your green screened footage and AE's 3D capabilities.

Tutorial, Video Tutorial
Adobe After Effects
FreeForm Pro and Aqua Pack: Basic introductory series Part 2

FreeForm Pro and Aqua Pack: Basic introductory series Part 2
  Play Video
The second tutorial from the series describes techniques for manipulating the depth map and texture map that can be used for a logo reveal.

Tutorial, Video Tutorial
Adobe After Effects
Panning Large Scenes Using Target Layers in 3D

Panning Large Scenes Using Target Layers in 3D
  Play Video
In this follow-on tutorial to his short series on working in 3D space, Andrew Devis shows how to use this simple technique to quickly and accurately pan around large layers/compositions to zoom in to the exact point required each time. You'll use target layers to get the exact coordinates needed for accurate panning - simple but effective!

Tutorial, Video Tutorial
Adobe After Effects
FreeForm Pro and Aqua Pack: Basic introductory series Part 1

FreeForm Pro and Aqua Pack: Basic introductory series Part 1
  Play Video
Introductory series (first in a set of three) for simulation of large bodies of water, water environments and water replacement in After Effects using FreeForm Pro from Mettle and the Aqua Pack enhancement pack.

Tutorial, Video Tutorial
MORE


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2012 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]