animate-to-audio
Animate a layer property from audio amplitude or beat transients in a single call, bypassing separate waveform analysis and manual keyframe creation.
Instructions
Generate After Effects keyframes for a layer property directly from an audio file's waveform, in one call - no need to call analyze-audio-waveform and compute keyframes by hand first. Two modes: 'waveform' follows the amplitude envelope continuously (a VU-meter style effect - glow intensity, scale, or opacity riding the music), one keyframe per analyzed sample. 'peaks' pulses the property at each detected transient/beat and decays back to baseline (a beat-pop style effect - e.g. a logo scaling up on every kick). Accepts any audio format ffmpeg supports (mp3, m4a/aac, ogg, flac, ...) the same way analyze-audio-waveform does; uncompressed WAV needs no extra dependency. Targets a plain layer property (e.g. 'ADBE Opacity') by default, or an effect's property when effectIndex/effectName/effectMatchName is given.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | 'waveform' (default): continuous amplitude-follow. 'peaks': discrete pulse-and-decay at each detected transient. | |
| curve | No | Response shaping (default: linear). 'exponential' emphasizes loud peaks (punchier); 'logarithmic' boosts quiet-passage detail. In 'peaks' mode this only affects velocitySensitivePeaks scaling. | |
| compName | No | Name of the target composition. Preferred over compIndex when both are given. | |
| filePath | Yes | Absolute path to the audio file (obtained from get-audio-info sourceFilePath). | |
| compIndex | No | 1-based composition index, used if compName is not given. | |
| layerName | No | Name of the target layer (alternative to layerIndex). | |
| numPoints | No | Waveform samples to analyze, each becoming one keyframe in 'waveform' mode (default: 100). Ignored for keyframe generation in 'peaks' mode (still used to detect the peaks themselves), where the number of keyframes instead follows how many transients are detected. Kept well below analyze-audio-waveform's own cap since every point here becomes a real After Effects keyframe. | |
| outputMax | Yes | Property value at full amplitude (waveform amplitude 1, or peaks-mode value at the instant of a hit). | |
| outputMin | Yes | Property value at silence/rest (waveform amplitude 0, or peaks-mode baseline between hits). | |
| startTime | No | Seconds to offset every generated keyframe by, to start the animation partway through the comp (default: 0). | |
| effectName | No | Display name of the effect to target. | |
| layerIndex | No | 1-based index of the target layer within the composition. | |
| effectIndex | No | 1-based index of the effect in the layer's Effects group, to target an effect property instead of a plain layer property. | |
| propertyName | No | Target property name or matchName (e.g. 'ADBE Opacity', 'ADBE Scale', 'ADBE Rotate Z' - matchNames are locale-independent and preferred). Used when propertyPath is not given, or as the effect-property fallback. | |
| propertyPath | No | Path to the target property, from the effect root (if an effect selector is given) or from the layer root otherwise, e.g. ['Compositing Options', 'Effect Opacity'] or [3, 1]. | |
| clearExisting | No | Remove the property's existing keyframes first (default: true). | |
| propertyIndex | No | Fallback target property index under the effect root (effect targeting only). | |
| effectMatchName | No | Internal matchName of the effect to target. | |
| keyframeOptions | No | Optional graph/easing controls applied uniformly to every keyframe this call generates. | |
| smoothingWindow | No | Waveform mode only: moving-average window (in samples) to smooth out jittery amplitude before keyframing (default: 3, use 1 to disable). | |
| peakDecaySeconds | No | Peaks mode only: seconds to fall back to outputMin after each hit (default: 0.15). | |
| velocitySensitivePeaks | No | Peaks mode only: scale each hit's height by how loud that specific transient was, instead of every hit jumping to the same outputMax (default: true). |