chordotomy

Dissect a song's harmony. Give it a recording (mp3, wav, flac or ogg) and it recognizes the chords on the beat, finds the key and its changes, labels the chords with Roman numerals, and points out the moves worth noticing (the secondary dominant, the borrowed chord). An agent skill writes the chords out for you and adds a short note on why each move works.
It analyzes; it doesn't transcribe. There is no staff notation, on purpose.
Yes, chordotomy is also a spinal surgery. This one cuts chords.
The analysis runs locally, and your audio never leaves your machine. The agent skills send a model text only: the chord timeline, and in the opt-in precision mode the transcribed notes, the melody included (see Agent skills).

The viewer on a synthesized progression in C major, analyzed with --engine dsp. The current chord is a borrowed Fm (iv); earlier, E7/G♯ is the secondary dominant of Am (V⁶₅/vi).
What it does
- Chords on the beat. Major, minor, dominant 7th, major 7th, minor 7th, half-diminished 7th, diminished 7th, sus4, 7sus4, augmented, diminished triad, sus2 and minor 6th, with
N for no chord. The model calls all of them but minor 6th; the DSP all but sus2 and 7sus4. Corrections can also enter add9 and minor add9, which neither engine calls.
- Two engines. The lv-chordia model (Jiang, Chen, Li and Xia, ISMIR 2019) when its optional extra is installed, chordotomy's DSP front end otherwise. The model engine's beats come from Beat This!, the DSP's from librosa, and both share the same harmonic analysis.
- Key and Roman numerals. Key changes are found from the chords, and each passage is analyzed in its own key. Secondary dominants, secondary leading-tone chords and borrowed chords are labeled and highlighted; the viewer adds figured bass for inversions.
- The bass note and inversion of each chord where a bass is heard, so slash chords (C/E, D/F♯) come out as such. A weak bass outside the chord is shown at root position instead of as a doubtful slash chord.
- A viewer that plays the recording with its chords, plays the chords themselves to check them by ear, and lets you correct and enter chords.
- Agent skills for Claude Code, Codex, Cursor and other agents:
extract-chords, which writes out the chords of a recording or a YouTube link and explains the highlighted moves, and read-chords, for the precision mode below.
- Precision mode, opt-in. If you already have a transcription MIDI of the recording, an agent can read the chords from its notes, on the analyzer's beats, and
chordotomy apply checks them and writes a timeline the viewer and extract-chords read like any other. It costs tokens and sends the transcribed notes to the model as text; see Agent skills.
Quick start
uv tool install "chordotomy[model]" # with the lv-chordia model (recommended), about 600 MB
chordotomy analyze song.mp3 # writes song.chords.json
Then open the viewer and drop song.mp3 and song.chords.json on the page. Without [model], uv tool install chordotomy, pipx install chordotomy or pip install chordotomy installs the DSP engine only.
Usage
chordotomy analyze song.mp3 # writes song.chords.json
chordotomy analyze song.mp3 -o out.json
chordotomy analyze song.mp3 --key A:min # analyze the whole song in A minor, with no key changes
chordotomy analyze song.mp3 --engine dsp # the DSP front end, even with the model installed
chordotomy analyze song.mp3 --source-url https://www.youtube.com/watch?v=… # record where the recording came from
chordotomy fetch-weights # model extra: download and verify Beat This!'s weights once
chordotomy notes song.mid song.chords.json -o notes.txt # precision mode: a transcription's notes, per beat, as text
chordotomy apply spans.txt song.chords.json # precision mode: an agent's chord spans, checked, into song.read-chords.json