Analyze tempo, key and chords
audio_analyzeAnalyze audio files to detect tempo, key, chord progression, structure, beats, and more, with confidence warnings for uncertain estimates.
Instructions
Analyses music: tempo (BPM) with alternatives, beats, onsets, meter (time signature), key with ranked candidates, a chord timeline with bar and beat, sections, melody, tuning, timbre, dynamics, rhythm and percussive hits, with roman numerals and harmonic functions on request. Use it to answer 'what is the BPM / key / chord progression / structure of this song'. Every estimate carries a confidence and the warnings say where it is shaky, for example a wrong meter or a half-time tempo; bar and beat are always attached even when the meter is doubtful. Tempo and key are the derivation project_create and midi_compose use; the first key candidate is the bass-weighted full-analysis key and the rest are ranked by chroma alone, so their confidences are not comparable, and hits are rule-based detections. Do not use it for loudness (audio_loudness), a single pitch track (audio_pitch) or raw spectral features (audio_features); symbolic files go to midi_read and theory_analyze. Example: {"path": "song.wav", "aspects": ["tempo", "key", "chords"], "chords_seventh": true}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "audio_analyze"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list | No | Which list 'offset' pages through: beats, onsets, chords, tempoCurve or hits. Omit it when only one of these lists is requested; the other lists start at their first item and obey 'limit'. | |
| path | Yes | Audio file to analyze (wav, mp3, flac, ogg, opus, aiff, m4a). | |
| limit | No | Maximum items per paged list (beats, onsets, chords, tempoCurve, hits), 1-1000. | |
| range | No | Analyze only this window ({start_sec, end_sec}, in seconds); times in the result stay on the file's own timeline. Omit for the whole file. | |
| detail | No | 'concise' returns the summary and the most useful fields; 'full' returns all. | concise |
| offset | No | First item to return of the list chosen by 'list'; past the end returns an empty list and its total. | |
| aspects | No | What to report: tempo, beats, onsets, meter, key, chords, sections, melody, tuning, timbre, dynamics, rhythm, hits (percussive events with strength). Defaults to tempo, meter, key, chords, sections. | |
| genre_hint | No | Genre prior for the key estimate: auto, edm, electronic, dance, pop, classical or jazz. See key_profile for how it changes the ranking. | |
| resolution | No | Time-series density: none returns summary statistics only; coarse 0.5, medium 1 and fine 4 points per second return a list of points with time_sec and the measured value. With the melody aspect it returns melody_contour. | none |
| key_profile | No | Key-profile table for the key estimate: krumhanslSchmuckler, temperley, shaath, faraldoEdmt, faraldoEdma, faraldoEdmm or bellmanBudge. Giving it or genre_hint ranks the keys by chroma alone; omit both for the full analysis key. | |
| chords_seventh | No | Name seventh/extended chords (Cmaj7, G9); false reduces chords to triads. | |
| chords_functions | No | Add each chord's roman numeral and harmonic function (tonic, subdominant, dominant, ...) relative to the reported key. | |
| n_key_candidates | No | How many ranked key candidates to return (1-24). | |
| compute_tempo_curve | No | Also return the local tempo at every beat, for material whose tempo moves. | |
| chords_chroma_method | No | Chroma the chord detector reads: stft, nnls or cqt. Giving this or chords_min_duration_sec runs the standalone chord detector instead of the full analysis (its default is cqt); omit both for the analysis chords. | |
| chords_min_duration_sec | No | Shortest chord kept, in seconds (standalone detector; its default is 0.3). | |
| detect_chord_inversions | No | Detect inversions and write slash chords (C/E). |