top of page
Audio React Expression

Advanced Expression, Time Based Animation, Dynamic, Animation Techniques, Audio React
Audio React Expression
This expression scales a layer based on audio amplitude, increasing size when the audio level exceeds a set threshold. It also smooths the scaling animation by referencing the previous frame's scale value for better motion.
This expression animates a layer's scale in sync with audio beats. It monitors the "Audio Amplitude" layer and triggers scaling when the audio surpasses a set threshold. The `linear()` function maps audio values to a chosen size range, while `valueAtTime()` smooths the movement by referencing a previous frame, creating a natural and dynamic motion effect.
// Connect to the audio amplitude slider
audioLevel = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
// Set scaling limits
minScale = 100;
maxScale = 120;
// Define bass threshold for triggering
bassThreshold = 20;
// Smooth the animation
smoothTime = 0.1;
previousValue = thisLayer.scale.valueAtTime(time - smoothTime);
// Control scaling based on audio level
scaleValue = (audioLevel > bassThreshold)
? linear(audioLevel, bassThreshold, 100, minScale, maxScale)
: minScale;
// Final scaling output
[scaleValue, scaleValue]
How to Use This Expression?
Add an Audio Layer: Import your audio file and add it to your timeline.
Create a New Shape or Text Layer: This will be the layer that reacts to the audio.
Apply the Expression:Select the shape or text layer.
Press S to open the Scale property.
Hold Alt (Windows) or Option (Mac) and click the stopwatch icon next to Scale.
Paste the provided expression into the expression editor.
Convert Audio to Keyframes:Right-click on the audio layer.
Go to Keyframe Assistant → Convert Audio to Keyframes.
A new layer named Audio Amplitude will appear.
Connect the Expression: The expression automatically references the Both Channels slider in the Audio Amplitude layer.
Adjust Values: Modify minValue and maxValue in the expression to control the size range of your visual element.
Preview the Animation: Play your timeline to see the layer respond to the audio's volume.
Trending
bottom of page