Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chord detection algorithms?

I am developing software that depends on musical chords detection. I know some algorithms for pitch detection, with techniques based on cepstral analysis or autocorrelation, but they are mainly focused on monophonic material recognition. But I need to work with some polyphonic recognition, that is, multiple pitches at the same time, like in a chord; does anyone know some good studies or solutions on that matter?

I am currently developing some algorithms based on the FFT, but if anyone has an idea on some algorithms or techniques that I can use, it would be of great help.

like image 263
Nemeth Avatar asked Dec 02 '10 16:12

Nemeth


People also ask

What is the fastest way to identify chords?

When reading a chord quickly, read the root/lowest note and then the intervals above it and place them in the key. With experience you will be able to recognize common voicings by shape alone.

Is there an app that can detect chords?

- Voicings & Positions recognition: Chord ai is the world's first app capable of recognizing not only chords, but also their specific voicing. This means that Chord ai can tell you more precisely which notes, including their octaves, are played on the piano, or which guitar/ukulele positions match best with the song.

What are the 4 chord qualities?

There are 4 types of qualities: major, minor, diminished, and augmented. In their simplest form, a chord is made up of 3 notes known as a triad, and the quality of the chord is determined by the intervals between the notes.


4 Answers

This is quite a good Open Source Project: https://patterns.enm.bris.ac.uk/hpa-software-package

It detects chords based on a chromagram - a good solution, breaks down a window of the whole spectrum onto an array of pitch classes (size: 12) with float values. Then, chords can be detected by a Hidden Markov Model.

.. should provide you with everything you need. :)

like image 183
pianissimo Avatar answered Oct 17 '22 17:10

pianissimo


The author of Capo, a transcription program for the Mac, has a pretty in-depth blog. The entry "A Note on Auto Tabbing" has some good jumping off points:

I started researching different methods of automatic transcription in mid-2009, because I was curious about how far along this technology was, and if it could be integrated into a future version of Capo.

Each of these automatic transcription algorithms start out with some kind of intermediate represenation of the audio data, and then they transfer that into a symbolic form (i.e. note onsets, and durations).

This is where I encountered some computationally expensive spectral representations (The Continuous Wavelet Transform (CWT), Constant Q Transform (CQT), and others.) I implemented all of these spectral transforms so that I could also implement the algorithms presented by the papers I was reading. This would give me an idea of whether they would work in practice.

Capo has some impressive technology. The standout feature is that its main view is not a frequency spectrogram like most other audio programs. It presents the audio like a piano roll, with the notes visible to the naked eye.


(source: supermegaultragroovy.com)

(Note: The hard note bars were drawn by a user. The fuzzy spots underneath are what Capo displays.)

like image 44
John Kugelman Avatar answered Oct 17 '22 16:10

John Kugelman


There's significant overlap between chord detection and key detection, and so you may find some of my previous answer to that question useful, as it has a few links to papers and theses. Getting a good polyphonic recogniser is incredibly difficult.

My own viewpoint on this is that applying polyphonic recognition to extract the notes and then trying to detect chords from the notes is the wrong way to go about it. The reason is that it's an ambiguous problem. If you have two complex tones exactly an octave apart then it's impossible to detect whether there are one or two notes playing (unless you have extra context such as knowing the harmonic profile). Every harmonic of C5 is also a harmonic of C4 (and of C3, C2, etc). So if you try a major chord in a polyphonic recogniser then you are likely to get out a whole sequence of notes that are harmonically related to your chord, but not necessarily the notes you played. If you use an autocorrelation-based pitch detection method then you'll see this effect quite clearly.

Instead, I think it's better to look for the patterns that are made by certain chord shapes (Major, Minor, 7th, etc).

like image 8
the_mandrill Avatar answered Oct 17 '22 17:10

the_mandrill


See my answer to this question: How can I do real-time pitch detection in .Net?

The reference to this IEEE paper is mainly what you're looking for: http://ieeexplore.ieee.org/Xplore/login.jsp?reload=true&url=/iel5/89/18967/00876309.pdf?arnumber=876309

The harmonics are throwing you off. Plus, humans can find fundamentals in sound even when the fundamental isn't present! Think of reading, but by covering half of the letters. The brain fills in the gaps.

The context of other sounds in the mix, and what came before, is very important to how we perceive notes.

like image 5
Brad Avatar answered Oct 17 '22 16:10

Brad