Audio reactive animation in After Effects: pump, shake and flash
Three expressions that make any layer pump, shake or flash to the music, driven by beat keyframes, plus a no-plugin version built on linear().
By Filip Miernik
Tutorial
7 min read
To make a layer react to music in After Effects, link one of its properties to a slider whose keyframes follow the audio. An expression on Scale makes the layer pump, on Position it shakes, and on Opacity it flashes. This guide starts with the no-plugin version, built on After Effects’ own Convert Audio To Keyframes and linear(), then gives you three expressions to paste, written for the hit slider that Flexile’s beat keyframes create.
In this guide
- How audio reactive animation works
- Audio reactive animation without a plugin
- Create band and hit sliders with Flexile
- Recipe 1: pump on Scale
- Recipe 2: shake on Position
- Recipe 3: flash on Opacity
- Let an AI app do the linking
- Try the recipes in Flexile
How does audio reactive animation work?
Every audio reactive setup has two parts: a slider with keyframes that follow the sound, and an expression on the property you want to move. The expression reads the slider on every frame and turns its number into size, position or opacity.
Two kinds of slider are useful:
- Band slider. One keyframe per frame, from 0 to 100 %, for the frequency band you picked. Use it when the motion should follow the music all the time.
- Hit slider. Jumps to 100 on each hit in that band and falls back. Use it when you want one clear move per beat.
After Effects’ own Convert Audio To Keyframes gives you amplitude sliders. Flexile’s beat keyframes give you both kinds, for the band you choose. To add an expression, Alt-click (Windows) or Option-click (macOS) the stopwatch next to the property and paste the code.
How to make audio reactive animation without a plugin
After Effects can turn audio into keyframes on its own. Adobe’s Convert Audio To Keyframes keyframe assistant measures amplitude, and linear() maps that amplitude to any range you want.
- Set the work area to the part of the song you need.
- With the comp active, choose Animation > Keyframe Assistant > Convert Audio To Keyframes.
- After Effects adds an Audio Amplitude layer with three sliders: Left Channel, Right Channel and Both Channels.
- Paste this expression on the Scale of the layer that should pump:
// Native pump: Scale follows the Audio Amplitude layer from Convert Audio To Keyframes.
var amp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
var quiet = 4; // amplitude that should mean "no pump"
var loud = 28; // amplitude that should mean "full pump"
value * linear(amp, quiet, loud, 1, 1.2)linear(t, tMin, tMax, value1, value2) returns value1 when t is at or below tMin, value2 at or above tMax, and a straight blend in between (Adobe’s expression reference). Adobe documents no fixed range for the amplitude values, so look at the Both Channels keyframes in the Graph Editor and set quiet and loud from your own track.
The command reads the whole comp mix, only in the work area, and only as amplitude. The guide on audio to keyframes by band covers these limits and the usual workarounds.
To use the three recipes below with this layer, replace their var hit line with a 0 to 100 version of the amplitude:
var hit = linear(thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider"), 4, 28, 0, 100); // 0 to 100Comparing beat plugins? Read how Flexile works as a BeatEdit alternative that is free during beta.
Create band and hit sliders with Flexile
Flexile is our After Effects extension. Its beat keyframes write a band slider and a hit slider in one step:
- Open Window > Extensions > Flexile for AE, go to the Audio page and open its Beat tab.
- Select the layer with sound (a song, a voice-over or a video layer), or use the whole comp mix.
- Pick a band: Auto, Kick, Bass, Snare, Hi-hat, Vocals or Full, or drag your own range on the spectrum. Choose Kick to match the recipes below (Auto names its sliders “Beat” and “Beat hit”).
- Leave Mark each hit on (it is on by default). It adds the hit slider and a marker on each hit.
- Check the preview, which shows the exact values, the BPM and the hit count, then click Create keyframes.
Flexile adds a null called Audio · <layer name> above your audio layer. It holds a slider named after the band, for example “Kick”, a “Kick hit” slider, and a “BPM” slider when the tempo is steady. On our 46-second demo song at 30 fps, that came to 1,384 keyframes per slider, 116 kick hits and 113.3 BPM. One undo step removes it all.
The bands cover Kick 40–120 Hz, Bass 60–250 Hz, Snare 1,500–4,000 Hz, Hi-hat 6,000–12,000 Hz, Vocals 300–3,000 Hz and Full 30–16,000 Hz. Auto picks the most rhythmic low band in the song. Run the Beat tab again with another band to add its sliders to the same null. If the hits come too often or too rarely, open Fine-tune and change Hit sensitivity (default 50 %). Higher finds softer hits. Watch the hit count before you write.
Each recipe below starts by reading one of these sliders, and the names must match your Timeline panel exactly, including the dot in the null’s name. After writing, Flexile shows an expression for the band slider, which ends in effect("Kick")("Slider") for the Kick band. To use it in a recipe, replace everything between var hit = and the semicolon with it, then change "Kick" to "Kick hit". Or pick-whip the hit slider instead of typing.
Recipe 1: pump on Scale
The classic audio reactive logo: it grows on every kick and settles back. Paste this on Scale:
// Pump on Scale: the layer grows on each hit and settles as the hit slider falls.
var hit = thisComp.layer("Audio · song.wav").effect("Kick hit")("Slider"); // 0 to 100
var extra = 15; // % of extra size at a full hit
value * (1 + (hit / 100) * (extra / 100))At a full hit the layer is 15 % larger than its own Scale. Change extra to taste. Because the code multiplies value, the property’s own value at the current time, your Scale keyframes still count.
For a pump that follows the kick drum all the time instead of once per hit, change “Kick hit” to “Kick”. For a springier pop, see how to add overshoot to the pulse with bounce and overshoot expressions.
Recipe 2: shake on Position
A hard shake on each snare hit, for titles and logos that react to the backbeat. Paste this on Position:
// Shake on Position: a fast wiggle whose size follows the hit slider.
var hit = thisComp.layer("Audio · song.wav").effect("Snare hit")("Slider"); // 0 to 100
var maxShake = 12; // pixels of movement at a full hit
var speed = 20; // wiggles per second
var offset = wiggle(speed, maxShake) - value;
value + offset * (hit / 100)wiggle() returns the property’s value plus a random offset. Subtracting value leaves only the offset, and the hit slider scales it, so the shake fades out as the slider falls back. maxShake is in pixels, speed in wiggles per second.
This recipe reads “Snare hit”, so run the Beat tab once more with the Snare band first, or change the name to “Kick hit”.
Recipe 3: flash on Opacity
A strobe on each hit. Put it on a white solid above your footage, or on the logo itself. Paste this on Opacity:
// Flash on Opacity: dim between hits, full strength on each hit.
var hit = thisComp.layer("Audio · song.wav").effect("Kick hit")("Slider"); // 0 to 100
var dim = 35; // opacity between hits, in %
ease(hit, 0, 100, dim, value)ease() takes the same arguments as linear() but eases in and out at both ends, so the flash softens as it fades. With the hit slider at 0 the layer sits at dim, and at 100 it reaches the Opacity you set. On a white solid, set dim to 0 so the footage stays clear between hits.
For a glow that breathes with the bass instead of flashing, run the Beat tab with the Bass band and point the var hit line at its “Bass” slider instead of a hit slider.
Let an AI app do the linking
If you connect an AI app such as Claude Desktop, Claude Code or Cursor to Flexile, you can ask for the same result in one sentence. Flexile analyses the song and writes the sliders, and the AI links your layers to them with expressions. Every Flexile call is one undo step.
Make the logo pulse on every kick of the song.
Shake the title on each snare hit.
Try the recipes in Flexile
Flexile is free during beta and needs a free account. It runs on macOS and Windows and supports After Effects 2025 or newer. Beat keyframes work on any computer that runs the panel, for clips up to 20 minutes long.
- Create a free Flexile account and install the extension.
- Open the Audio page’s Beat tab, click Create keyframes and paste one of the recipes above.
Related posts
Convert audio to keyframes in After Effects: one layer, one band
What Convert Audio To Keyframes gives you, its three limits (the whole comp mix, amplitude only, the work area), the usual workarounds, and keyframes per layer and per frequency band.
BeatEdit alternatives for After Effects: Flexile, Sound Keys and free tools
BeatEdit compared with Flexile, Trapcode Sound Keys, BeatMarker AE and After Effects’ own Convert Audio to Keyframes: what each one writes, what it costs and when BeatEdit is still the right pick.

Bounce and overshoot expressions in After Effects (and one-click versions)
Two commented expressions to paste: an overshoot that springs past each keyframe and a bounce that rebounds like a ball. Plus slider controls, fixes and Flexile’s one-click rigs.