It starts with a deceptively simple question
You press four notes on a keyboard. A computer reads four numbers. What chord is it?
The instinct is to say: look it up in a table. C major is C-E-G. Done. But that instinct breaks down quickly when you sit down with a real piece of music, even something straightforward, and start paying attention to what you are actually hearing versus what the notes technically spell out.
Chord naming is a form of musical interpretation, not just pattern matching. The same set of notes can legitimately be described in several different ways, and musicians navigate this ambiguity constantly through context, convention, and voice-leading intuition. Teaching that intuition to a computer requires encoding a surprising amount of musical knowledge.
WhatChord is built around that encoding. This article walks through the specific challenges it is designed to handle.
The same notes, different chords
Start with a simple example. Play the notes C, E♭, G♭, and A together. What chord is that?
It is a fully diminished 7th chord. That much is clear from the interval structure: four notes, each a minor third apart, stacking perfectly up the octave. But here is the catch: fully diminished 7th chords are symmetrical. Every voicing of this chord divides the octave into four equal parts. That means the same four piano keys can support four different diminished-7th readings.
Cdim7 = C - E♭ - G♭ - B♭♭ Adim7/C = A - C - E♭ - G♭ D♯dim7/C = D♯ - F♯ - A - C F♯dim7/C = F♯ - A - C - E♭
So which name is "right"? In isolation, none of them is more correct than the others. They are four enharmonic descriptions of identical musical content. The right answer depends on context: what key you are in, what chord came before, which note the bass instrument is playing, and where the progression is heading.
WhatChord resolves this using diatonic context. When you have set a key signature, the app prefers the diminished 7th reading that best fits the key, specifically the one whose root is a natural leading tone. In D♭ major, these same piano keys naturally point to Cdim7, the leading-tone diminished 7th that resolves to D♭. Without a key signature, it falls back to preferring root position: the interpretation where the bass note is named as the root, which is a clear default when no surrounding harmony is available.
Inversions: the bass note changes everything
Inversion is the most common reason a chord sounds like something else. When the third is in the bass instead of the root, a major chord starts to feel unstable, like it wants to resolve. When the fifth is in the bass, the chord floats ambiguously between two functions.
Classical theory calls these first and second inversion. Jazz and pop use slash notation: C/E (C major with E in the bass), C/G (C major with G in the bass). Either way, the relationship between the bass note and the chord tones above it matters, and it affects how the chord is named.
A MIDI keyboard tells WhatChord the pitch class of every sounding note, including the lowest one. The lowest note is treated as the bass note and scored separately from the upper structure. A chord where the bass is the root earns a higher score than the same chord with a bass that requires slash notation. Not because root position is "more correct," but because it is the more common interpretation and more informative to name explicitly as root position first.
This scoring matters for a subtle reason. Consider C, E, G, A played with C in the bass. Is that C6 or Am7/C? Both are completely valid readings: C6 is a major chord with an added 6th; Am7/C is an A minor 7th chord in first inversion. In real music, both readings show up. WhatChord's default is to show C6 as the primary interpretation, with the root in the bass and the 6th reading being structurally simpler, and Am7/C appears below the chord identity card as an alternative.
Extensions: when does an extra note become part of the chord?
A triad has three notes. A 7th chord has four. But jazz pianists regularly play voicings with five, six, or even seven distinct pitch classes and still call it a single chord.
The theory behind this is that tonal music organizes extensions in a stack: 7, 9, 11, 13. Each interval builds on the ones below it. A "real" major 9th chord (Cmaj9) contains the major 7th as well. The 9 is an extension of the 7th-family chord, not just a note tacked on. By contrast, Cadd9 skips the 7th entirely and adds the 9th on top of a basic triad. They are different sounds with different names, even though both contain C, E, G, and D.
WhatChord uses this distinction when labeling extensions. A 9 needs the 7th below it. An 11 or 13 needs both the 7th and the 9th, because those names imply a larger stack of chord tones. Without that support, the same notes are labeled as add tones: add9, add11, or add13. The rule is simple to state and surprisingly hard to get right in practice, because voicings often omit the 5th while keeping the tones that define the chord function.
Altered dominants: the most complicated single chord type
Dominant 7th chords (G7, C7, F7) are the workhorses of functional harmony. They create tension that resolves, and because jazz musicians spend so much time on them, dominant 7ths have accumulated more extensions and alterations than any other chord type.
The "altered scale," the seventh mode of melodic minor, provides a vocabulary of alterations that can be stacked on a dominant chord: flat 9, sharp 9, sharp 11, flat 13. A heavily altered dominant might look like G7♯9♯11♭13: G plus its major 3rd (B), its minor 7th (F), and three altered upper extensions. That is six distinct pitch classes in a single chord.
The G7♯9 is particularly famous, known popularly as the "Hendrix chord" for its prominence in "Purple Haze." It is a dominant 7th with a sharpened 9th: G, B, F, and A♯ in the upper structure. That A♯ is the same piano key as B♭, but the chord role is different: it is the raised 9th above G. Without musical context, a naive recognizer might call the same keys a diminished chord, a minor chord with a strange bass, or something else entirely. WhatChord recognizes the dominant shell (major 3rd + flat 7th) as the anchor, treats the sharp 9 as an alteration on that dominant function, and reports G7♯9 as expected.
This matters because dominant chords with alterations arise constantly in jazz, blues, and rock. Getting them wrong breaks trust with any musician who knows what they sound like.
Upper-structure voicings
Experienced jazz pianists often build dominant chord voicings using an "upper structure" technique: the left hand plays the shell tones (the 3rd and flat 7th of the dominant), and the right hand plays what sounds like a completely different chord, often a simple triad or 7th chord built on some other root. The result is a rich, modern color that resists simple labeling.
WhatChord handles this by looking for the dominant shell, specifically whether the major 3rd and flat 7th are both present, and treating notes above that shell as a coherent extended color rather than as competing chord roots. When the bass is itself a color tone (like the ♯11 of the dominant), it gets recognized as an intentional upper-structure voicing and spelled out accordingly.
Enharmonic spelling: C♯ versus D♭
C♯ and D♭ are the same key on a piano. They are the same MIDI note number. But they mean different things, and writing the wrong one in a chord symbol or lead sheet is a mistake that musicians notice immediately.
In the key of E major, the pitch C♯ is the sixth degree of the scale. Writing that same piano key as D♭ would be technically enharmonic but functionally wrong. In the key of A♭ major, the same piano key is D♭, the fourth degree of the scale.
Chord symbols follow the same logic. A dominant 7th built on G spells its minor 7th as F (four semitones below the octave), never E♯. A diminished 7th on B spells its top note as A♭, the diminished 7th above B, not G♯, even though they are identical pitches.
WhatChord uses both the key signature and the identified chord root to determine enharmonic spelling. When you have set the key signature to three flats (E♭ major or C minor), the app will favor flat spellings for chord tones and extensions throughout. When it identifies a dominant 7th on G, it spells the 7th as F regardless of key context, because that is what the chord quality demands. These two sources of context combine to produce spellings that look like what a professional musician or copyist would write.
Ambiguity is a feature, not a problem
Some voicings are genuinely ambiguous. Not because the algorithm failed, but because the music itself has multiple valid interpretations.
The classic example is the major 6th versus the relative minor 7th. C6 (C, E, G, A) and Am7/C (A, C, E, G with C in the bass) contain the exact same pitch classes. Both are common, both are correct, and which name you prefer depends entirely on harmonic context: are you at the end of a phrase resolving to tonic, or are you in the middle of a ii-V-I in G major? The notes do not tell you. The music around them does.
Rather than arbitrarily committing to one name, WhatChord shows both when scores are close. The primary result is the highest-ranked interpretation, displayed as the main chord name. Other plausible readings appear below the chord identity card. A musician looking at the screen gets the most likely reading immediately, but can see at a glance that another name is also in play.
This is the more honest representation of what the notes actually contain. Knowing that C7♯11/F♯ is the top interpretation, with F♯7♯9 as a plausible alternative, gives you more information than being confidently told the wrong one.
Where WhatChord fits
WhatChord is a real-time chord identifier optimized for speed and accuracy in the kinds of harmonic situations working musicians actually encounter: jazz voicings, extended chords, altered dominants, inversions, and the various ambiguous cases that sit between well-defined categories.
Today, each snapshot of sounding notes is evaluated independently, using the current key signature setting as context. Progressions, key changes, voice leading, and ensemble-aware interpretation are all interesting avenues for future development. That is the larger point: chord naming is harder than it looks because the notes are only the beginning.
If you want to see how that musical judgment is represented in code, the underlying algorithm is described in more technical depth in the companion article.