Detect beats
detect_beatsFinds beat times in an After Effects Audio Amplitude layer by detecting amplitude peaks above a threshold and spacing them by a minimum gap; optionally adds markers and returns average BPM.
Instructions
Find beats/peaks in an 'Audio Amplitude' layer (from audio_to_keyframes; created automatically from 'audioLayer' when missing): samples the channel slider per frame and picks local peaks above threshold (fraction of the max, default 0.5) at least minGap seconds apart (default 0.25). Optionally adds a comp (or layer) marker per beat. Returns beat times in seconds and an average BPM.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "detect_beats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| comp | No | Composition name, 'Folder/Name' path, or item id. Omit to use the active composition. | |
| limit | No | Max beats returned (default 500). | |
| detail | No | Also return frame and amplitude per beat. | |
| minGap | No | Minimum seconds between beats (default 0.25). | |
| channel | No | Channel slider to analyse (default 'both'). | |
| endTime | No | Analyse until this time (default comp end). | |
| startTime | No | Analyse from this time (default 0). | |
| threshold | No | Peak threshold as a fraction of the max amplitude (default 0.5). | |
| addMarkers | No | Add a marker at every beat. | |
| audioLayer | No | Audio layer to convert when there is no amplitude layer yet. | |
| markerLabel | No | Marker label color index. | |
| markerLayer | No | Put beat markers on this layer instead of the comp. | |
| markerComment | No | Marker comment (default 'beat'); a running number is appended unless numberMarkers=false. | |
| numberMarkers | No | Append the beat number to the comment (default true). | |
| amplitudeLayer | No | Audio Amplitude layer (default: the first one in the comp). | |
| absoluteThreshold | No | Absolute slider value threshold (overrides threshold). |