Where it came from
I wanted to learn to play any song, and the tool that solved it, Chordify, charges for transposing, capo or MIDI export. Before paying, I did the reverse exercise: list what it does, what it charges for and what it really costs to build each piece.
The problem
Chord apps charge for features that, technically, are simple transformations over an analysis that's already been done. Only one thing is hard: detecting chords and meter correctly from the audio, on an ordinary machine with no GPU.
The solution
A Python pipeline that runs once per song: beats and meter with `beat_this`, chords with beat-synchronized chroma, harmonic templates and Viterbi, and notes with `basic-pitch`. Everything ends up in an `analysis.json`; transposing, capo, simplifying or exporting are derived from that file instantly. Then it looks up the transcription on LaCuerda and the lyrics on LRCLIB, and keeps the one that best matches the audio.
What's solved
- Separation between analysis (slow, once) and use (instant):
analysis.jsonis the single source of truth. - Custom chord recognizer: per-beat chroma, weighted templates and two-pass Viterbi decoding with a key prior.
- Source chosen by agreement with the audio, not by title similarity; it detects transcriptions written in another key.
- Synced sheet: player, current and next chord, lyrics that follow the audio, speed 0.5×–1.5× without changing pitch.
- Harmonic analysis: key, cycle in scale degrees, cadences, out-of-key chords and suggested capo.
- Output in HTML, ChordPro, MusicXML, MIDI and ASCII tablature.
- Respects
robots.txt(LaCuerda's Crawl-delay) and doesn't disguise itself as a browser to get around a 403.
Evidence
- Analysis document of the reference product with a feature matrix, free/paid plan and difficulty of each one (
docs/analisis-chordify.md). - 99.8% time-weighted exact chord accuracy in validation with synthetic G–Em–C–D audio.
- Against four human transcriptions, transition precision went from 0.44 to 0.74 between version 0.1 and 0.2.
- A 4-minute song is analyzed in ~80 s on a 2016 Intel MacBook Pro, without a GPU.
- REA analysis of Chordify's public pages: transposition and tempo are handled on the client, over data already shipped with the page.
The hard parts
- The hardware defined the architecture: an Intel Mac without a GPU forces
torch==2.2.2and Python 3.11, and means the analysis runs offline, not in real time. - A triad with a weak fifth loses to the triad a third above (E → G#m). Raising the weight of the fifth in the templates was the highest-impact change.
- Online transcriptions come in another key, under another name or in a different version. Choosing by agreement with the audio solved most cases.
What I learned
- Six of the reference product's seven paid features are transformations over a JSON file. The value is in the analysis, not in the premium features.
- A well-calibrated classic recognizer can outperform a large model that can't be installed on the available machine.
- Measuring against human transcriptions changed the priorities: what mattered most was when the chord changes, not its exact name.
Next steps
- A-B loop, tuner and track separation with Demucs to play along.
Other products
Applied learnings