- Introduced by
- Christopher Harte
- Year
- 2005
- Type
- Harmonic audio analysis
- Family
- Feature extraction
What does it do?
Chord recognition is the task of automatically labelling the chords sounding in a musical recording and estimating when the chord changes occur.
The output is a time-stamped sequence of chord labels, such as C major or A minor. It is used in music transcription, music analysis and music information retrieval.
The intuition behind the method
A chord is a group of pitches sounding at the same time. Harmonic content can be captured with a compact chromatic pitch representation, a 12-bin pitch-class histogram (chromagram), which maps all pitches into one octave regardless of register. Comparing each frame's chromagram with templates for chord types such as major, minor or seventh gives a candidate chord label. Hidden Markov models are one way to favour smooth, plausible chord transitions over frame-by-frame label changes.
History
Harte et al. (2005) proposed extensions to the HarmO ontology for the symbolic representation of musical chords, a reference for chord representation rather than for audio chord recognition itself. MacGregor and Wiggins (2009) used duration-explicit hidden Markov models for chord recognition.
When to use it
Choose chord recognition when you need chord labels and their timings from recorded polyphonic music with clear tonal harmony, for example for song structure analysis, chord charts or harmonic studies. It is most suitable when the audio is of reasonable quality and the musical style is close to the data used to train or tune the system. Avoid it for atonal or highly dissonant music, dense polyphony where the root is ambiguous, heavily effects-processed or synthesized audio, and genres far from the training data, such as jazz, unless the system is retrained on suitable annotated material. Before comparing published scores, check that the chord vocabulary, matching rule and test genre are the same, because these settings change the reported accuracy.
Limitations and considerations
- Chord labelling conventions differ across genres and notational systems, so annotated ground truth is not uniform and scores are hard to compare.
- Inversions and voicings can shift the energy in the chromagram away from the root, which causes label confusion between related chords.
- The chromagram discards octave and voicing information, so open and closed voicings of the same chord cannot be distinguished.
- Performance is reduced on heavily processed or electronically synthesized audio, where the pitch-class content is less clear.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Outputs chord labels and timings that musicians can read and check, unlike raw pitch-class vectors.
- The chromagram is octave-invariant, so chord identity does not depend on the register in which notes are played.
- Temporal decoding discourages implausible frame-to-frame chord changes and reduces flickering in the output.
- The template-based approach can be extended to any chord types present in the training annotations.
Applications
- Automatic chord chart generation from audio for educational and transcription purposes.
- Music-style transfer and cover-song analysis based on harmonic similarity.
- Harmonic content-aware music recommendation and playlist generation.
- Interactive music creation and accompaniment generation in digital audio workstations.
- Musicological research on harmonic language, compositional style, and historical trends.
How it works
How it works
Compute a chromagram (a 12-dimensional pitch-class histogram) most often from a constant-Q transform or a short-time Fourier transform, folding spectral energy into 12 pitch classes. Each frame is summarised independently of octave. Mel-spectrogram inputs are possible but need their own pitch-folding step.
Learn a template vector for each chord type (major, minor, seventh and so on) and transition probabilities from training audio with chord annotations. Hidden Markov models or neural networks can represent the smoothness constraints between chords.
Assign each frame a chord label by comparing its chromagram with the chord templates, or with the output of a trained classifier. Then apply temporal decoding to enforce coherent transitions: Viterbi decoding over the state sequence for an HMM, or the corresponding inference procedure for other sequence models. The exact frame classifier depends on the implementation.
Measure accuracy as the fraction of frames whose predicted chord matches the ground-truth annotation. Some protocols also accept a parent chord when only the chord sub-type disagrees. When reporting results, state the chord vocabulary (for example major and minor only, or including sevenths), the matching rule (exact or relaxed), the frame or segment metric, and the test dataset and genre, since scores are not comparable across these settings.
Common pitfalls
- Confusing chord recognition with harmonic analysis. Chord recognition outputs labels; harmonic analysis interprets function (tonic, dominant and so on) and requires music-theoretic interpretation.
- Restricting the vocabulary to major and minor only. Sevenths, extensions and alterations are then forced into the wrong labels, which lowers measured accuracy.
- Applying a model trained on one genre, such as pop, to another with different harmonic vocabulary and transition patterns, such as jazz, without checking performance on that genre.
Frequently asked questions
Is chord recognition the same as pitch detection?
No. Pitch detection finds individual pitches; chord recognition groups pitches into harmonic labels. Chord recognition typically uses pitch information but abstracts it into chords.
Can chord recognition distinguish inversions?
Standard chord recognition often classifies only root-position chords or merges inversions into one label. Some advanced systems model inversions explicitly, but many standard systems treat C major, C/E and C/G as the same chord.
What is a chromagram and why is it useful?
A chromagram maps all pitches to one octave (12 pitch classes: C, C#, D, ..., B), creating a 12-bin representation of harmonic content. This makes chord recognition octave-invariant and robust to octave doubling.
How does chord recognition handle non-tonal music or jazz?
Jazz and atonal music require larger chord vocabularies and different transition models. Standard systems trained on pop may struggle, and retraining on genre-specific annotated data may be necessary.
Related methods
Sources
Harte, C., Sandler, M. B., Abdallah, S. A., & Gómez, E. (2005). Symbolic representation of musical chords: Proposed extensions to the HarmO ontology. In Proceedings of the International Society for Music Information Retrieval Conference.
Open publication referenceMacGregor, R. D., & Wiggins, G. A. (2009). Chord recognition using duration-explicit hidden Markov models. In Proceedings of the International Society for Music Information Retrieval Conference.
Open publication referenceBigo, L., Buffa, A., & Roeb, M. (2017). Singing voice separation using spectral features and bidirectional long short-term memory networks. In Proceedings of the International Society for Music Information Retrieval Conference.
Open publication reference