Driving Graphic Parameters
Audio Analyzer
You can use an Audio Mix to drive any numeric layer parameter within a composition. Simply add an Audio Analyzer Generator to the parameter.
In the example below, we've added an Audio Analyzer Generator to the layer Scale parameter:
The Audio Analyzer performs a spectral analysis of the audio source that is connected to this Generator. This Audio Source can be an Audio Mix or a sound file in the Project Panel.
To connect an Audio Source:
- Go to the Generator Audio Source parameter
- Click on the connection slot containing two unplugged sockets to the right of this parameter, then select the Audio Mix or audio file from the list on the left
- Drag and drop one of these elements from the Project Panel onto this connection slot
The Audio Analyzer performs a spectral analysis of this audio source, extracting the amplitudes of the various frequencies, then averaging them. This average value is injected into the parameter for each frame.
Warning
If you connect an audio file from the Project Panel, it won't be able to undergo any time offset or changes from Modifiers. Connecting an Audio Mix lets you mix several audio layers within it, offset them in time, reduce their Volume Gain or add Modifiers to them.
Separate the analyzed Audio Mix from the one synchronized with a composition
The Audio Mix connected to the analyzer isn't necessarily the same one that'll be linked to the composition's Audio Source parameter. The linked Audio Mix, which serves as the audio source for the composition, determines what you'll hear when moving through the Timeline. But you can hear one Audio Mix during playback, while using other Audio Mixes to control visual layer parameters with Audio Analyzers.
Dynamic Changes
Any modifications made to the layers that make up the Audio Mix will update the Audio Analyzer connected to the parameter in real time. Changing an audio layer's Gain value will increase the signal's amplitude and, as a result, it'll also change the average coming out of the Audio Analyzer.
Adding Modifiers to the audio layers will have the same effect, as will shifting or stretching audio layers over time.
Temporal Radius
The purpose of the Temporal Radius parameter is to define a sample time window to average the amplitudes. The default value will define a 0.1 second window from the current time for averaging the amplitudes.
So the Generator output value is the result of the amplitude average at the current time over this window. If we set it to 3 seconds, the motion will be smoothed out, averaging much more amplitude over time. Any tiny variations will be buried in this average, overshadowed by larger amplitudes.
If we reduce this value, for example to 0.01 seconds (1/100th of a second), we'll capture a much smaller time window which will produce perfectly synchronized animations.
Output Value Built-in Multiplier
For audio that's not oversaturated, the Generator output values range between 0 and 1 - 0 representing silence, and 1 representing the maximum audio signal permitted.
If we apply this Generator to a Scale parameter, the result for a high-amplitude audio signal with a wide dynamic range may be visible immediately. But, if this Generator is applied to a rotation, this will evolve at most between 0 and 1 degree, which will be difficult to see.
This is where the Multipler parameter can be very useful, as it multiplies the Analyzer output value before injecting it into the parameter.
Analyzer Threshold
By default, the Audio Analyzer will average all of the frequency amplitudes in the audio signal. If high frequencies have a low amplitude, they'll have the same impact on this average as low frequencies with a higher amplitude.
But the Audio Analyzer can filter frequencies according to their amplitude in order to ignore the most insignificant ones when averaging.
The Threshold parameter allows you to set an amplitude threshold where any frequencies below it will be ignored. This can be used to define a kind of minimum output value.
Warning
Since you're now only taking into account frequencies with higher amplitudes, the average result injected into the parameter may also be larger. You may need to adjust the Multiply value accordingly.
Follow Time
When the Follow Time option is checked, even if you time shift a layer that has a parameter connected to an Audio Analyzer, the effect of the analysis will always be perfectly synchronized with the sound produced by the Audio Mix.
If we disable the Follow Time option and shift this layer from left to right, it will cause a time offset between the sound analysis and the application of the Audio Analyzer to the parameter.
This creates a delay effect between the music or sound in the Audio Mix and its influence on the parameter. This can be used to create visual echoes by duplicating the same layer several times with different offsets.