Now you'll animate your virtual audio speaker so that it seems to reverberate to the beat of an audio track. The speaker fades into the scene to replace the letter O in the word SONIC in the final project. You'll also edit expressions to intensify the results; if you're not comfortable working with expressions yet, this example shows you how easy they can be.
Follow these steps:
Open the Radar Pulse composition. Drag Sonic_track.aif from the Project window into the Timeline at time 0;00, and place it below all the circle layers.
Choose Animation > Keyframe Assistant > Convert Audio to Keyframes. A new layer named Audio Amplitude is automatically added at the top of the Timeline. Select the layer, and press U on your keyboard to see the resulting keyframes.
The keyframes reflect the amplitude of all audio in the composition at each frame. Using expressions, you can make the properties of other layers animate according to the audio amplitude in this layer.
Creating keyframes based on the audio amplitude at each frame
Return to the sOnic Radar Comp 1 Timeline, select all the circle layers, and then press T to display their Opacity properties.
Select the Opacity property of all circle 1 layers, and then choose Animation > Add Expression. Expand each circle layer's Opacity property to display the new property named Expression: Opacity. Also expand the Audio Amplitude layer, its Effects group, and its Left Channel, Right Channel, and Both Channels. (You don't need to expand the Sliders.)
Drag the pick whip next to each circle layer's Expression: Opacity property, and choose the Audio Amplitude layer's Slider option for the Left Channel, Right Channel, or Both Channels. Cycle through the channel you link to so that each layer is linked to a different channel than its adjacent layers.
The circle 1, 4, and 7 layers should be linked to the Left Channel; the circle 2, 5, and 8 layers should be linked to the Right Channel; and the circle 3 and 6 layers should be linked to Both Cannels. A bunch of code is added to each circle layer's Expression Opacity property.
Using the pick whip to link each circle's Opacity to an audio channel Currently, the audio amplitude is so low that the circles aren't visible in the composition. You'll fix this in the next step by increasing the effect of the expressions.
Click at the end of the code next to circle 1, and type *20 to multiply the effect by 20.
At the end of the next layer's expression line, increase the *20 by 10 until you reach 50; repeat, starting at 20.
The Radar Pulse Timeline after editing the expressions
Delete the Sonic_track.aif audio file in the Timeline, and close the sOnic Radar composition.
Now you can see the circles in the composition and their varying levels of transparency. If you preview the animation, you'll see the circles pulsing to the beat.
Looping the pulse
Next you'll create a parent composition for the Radar Pulse composition and make it loop in time:
Create a new composition named Sonic Loop, using the NTSC D1 Square Pix, 720x540 composition, with Duration 15;00 seconds.
Drag the Radar Pulse composition to the Sonic Loop Timeline at time 0;00 to automatically center it in the Comp window.
Duplicate the Radar Pulse layer nine times, so you have ten layers.
Select all the layers, and choose Animation > Keyframe Assistant > Sequence Layers. Deselect Overlap, and click OK. This automatically places each layer in succession in time.
Save the project, and close the composition.
The Sequence Layers command lets you quickly distribute layers across time.