Developers behind a real-time MIDI chord identifier faced an unexpected slowdown. Their app, WhatChord, listens to notes played on a keyboard and suggests accurate names for often ambiguous harmonies. The process works well enough for simple triads. Yet the final ranking step consumed 99 percent of the compute time on cache misses.
The team detailed their efforts in a technical post published this week. They set out in June 2026 to accelerate the ranking without altering results. What they uncovered reveals limits in how even straightforward musical logic maps onto code. (WhatChord)
WhatChord treats chord naming as a ranking problem rather than a lookup. A voicing — the precise set of notes and their bass — can match multiple legitimate names. C-E-G-A might read as C6 or Am7. The engine generates every plausible candidate, scores each for musical fit, then orders them according to what a musician would expect.
Standard sorting fails here. The comparator that decides which candidate comes first is not transitive. Hard rules can promote a lower-scoring name regardless of the gap. Near-tie heuristics kick in when scores sit within 0.20 points. Those overrides create cycles. A beats B, B beats C, C beats A. No clean total order exists.
Instead the code linearizes the preference graph. It builds a full n-by-n matrix of pairwise decisions. For 75 candidates, the median in its adversarial test set, that demands more than 5,000 comparator calls. Each call once scanned 21 hard rules. The work scales quadratically with candidate count. A seven-note dense voicing spawns 131 candidates.
Early wins came from gating the rule checks. Most rules apply only to specific candidate pairs. The team precomputed a bitmask per candidate marking eligible rules. A bitwise AND then limits checks to the few that could fire. The change proved output-identical. Tests passed. Runtime on the oracle corpus fell 27 percent. Everyday voicings ran 1.2 to 1.7 times faster. Still quadratic, but cheaper constants.
Attempts to shrink the candidate list before ranking stumbled. The tie-breaker uses a global Copeland win count borrowed from voting theory. Remove any candidate and every other candidate’s win total shifts. The resulting order can change. Only proven Condorcet losers — candidates that lose to all others with no hard-rule rescue — can safely drop. Finding them requires the full matrix the team hoped to avoid.
A redesign that seeded with a cheap score-based sort and checked only for violations also disappointed. Profiling showed the pairwise matrix build ate 97 percent of ranking time. The fast path that hoped to return the seed order untouched never triggered. Every voicing in the test set contained at least one near-tie that forced fallback. The added detection work produced a net loss.
The article stops short of a final breakthrough. It frames the piece as work in progress. The hidden requirement the team questioned — the need for a global view — still stands. Yet the transparency offers value to anyone building similar preference-based rankers in audio, recommendation or decision systems.
Chord identification sits at the intersection of music theory and computation. Recent research shows large language models also wrestle with these tasks. A March 2025 paper tested GPT-4o, Claude 3.5 Sonnet and Gemini 1.5 Pro on Royal Conservatory of Music Level 6 theory questions. Without context the models scored below 60 percent. Even with in-context learning and chain-of-thought prompting, chord questions saw limited gains.
“questions related to chords showed limited improvement, suggesting that the LLMs struggled with the multi-step sequential nature of these problems,” the authors wrote. Claude reached 75 percent overall with MEI encoding, but chord subscores lagged. ChatGPT improved from 16.7 percent to 35 percent on chords in one format. The gap between knowledge recall and multi-step analysis persists. (arXiv)
That academic benchmark echoes the practical hurdles in WhatChord. Both efforts confront the same reality. Music theory resists reduction to isolated facts. Context, overrides and global consistency matter. LLMs may list chord names fluently. Turning those names into musically sensible rankings at interactive speed demands careful engineering.
Commercial chord apps have multiplied. Chord ai uses audio listening and claims reliable detection. WhatChord focuses on live MIDI input and educational exploration of harmony. Its GitHub repository went public days ago, inviting contributions. The quadratic ranking post now serves as both documentation and invitation to tackle the remaining bottlenecks. (GitHub)
Leaderboards that rank frontier models on general reasoning show continued progress. Claude variants top several 2026 indexes, followed by GPT and Gemini descendants. Yet specialized musical benchmarks remain sparse. The RCM study and WhatChord’s oracle corpus point toward a narrower but revealing test bed. Success here could inform better prompting strategies or hybrid symbolic-neural systems.
One lesson stands out. Sometimes the obvious optimization, fewer candidates or early sorting, breaks subtle invariants. The global nature of the Copeland count acted as a hidden requirement. Questioning it opened new avenues even if full resolution waits. The team’s reproducible benchmark, tracking exact operation counts rather than wall-clock time, kept every change honest.
Musicians using the app today see faster responses after the gating improvement. The ranking still scales poorly with complex voicings. Future work may explore approximate methods, incremental updates or learned comparators that preserve musical priorities. For now the post stands as a clear-eyed account of trading theoretical elegance for practical speed inside a quadratic loop.
And the broader field watches. Audio software, music education tools and even generative systems that output chord progressions all face similar ranking decisions. Get the order wrong and the suggestion feels off. Get it right under tight latency and the experience sings. The difference often hides in a matrix of pairwise beats that no standard library can sort.


WebProNews is an iEntry Publication