1

I realise there are a fair few questions on here already with regard to chord detection algorithms; however, most of these seem to be relating more to interpreting songs into sets of chords or chord transcription. My problem ought to be a lot simpler as I am only interested in recording a single strum of a guitar chord and then analysing this to return the chord that was played. And, if this proves to be too difficult, it would be somewhat adequate to simply be able to tell if a particular chord is being played correctly or not, e.g. a user is presented with a chord to attempt to play and, after strumming, the application will tell them whether or not they played the correct chord (something of a memory game). I would think this second option would be easier since the application would already know what chord to expect.

I am already using an FFT and the Harmonic Product Spectrum for a guitar tuner as part of the same application and would really like some advice on how I could analyse the frequency spectrum output by the FFT to recognise guitar chords. I am also open to any other suggestions on the matter and would really appreciate any help I can get.

Thanks

Matthieu Brucher
  • 21,634
  • 7
  • 38
  • 62
nihilo90
  • 109
  • 1
  • 9
  • I implemented several techniques here: https://gist.github.com/fasiha/957035272009eb1c9eb370936a6af2eb as a response to [this question](https://stackoverflow.com/a/39234337/500207). – Ahmed Fasih Feb 17 '18 at 05:09

4 Answers4

1

You could try fingerprinting the most common chords, and then looking for the closest matching normalized spectrum within your set of fingerprints. e.g. Treat it as a pattern matching problem in the frequency domain.

hotpaw2
  • 70,107
  • 14
  • 90
  • 153
  • Thanks for the answer. Could you elaborate at all on how to use the fingerprinting method? Would it be a fairly simple matter of identifying the peaks for different chords and then using some kind of maximum likelihood algorithm? – nihilo90 Feb 26 '12 at 22:51
  • Fingerprinting won't work since different guitars have different timbres. – Björn Lindqvist May 06 '20 at 03:15
  • Nothing to keep one from fingerprinting a very large variety of guitars. When testing my guitar tuner, I visited over a dozen guitar stores, and tuned several hundred different guitars, from cheap student toys to quite expensive ones. Not sure why, but the store staff never bothered me or asked me what I was doing. – hotpaw2 May 06 '20 at 05:01
0

Though its too late to reply , i hope this will help you..

If you are programming for electronic or MIDI Guitar or any other MIDI instrument then there is a very effective Java package JFugue for these stuffs, like detecting the chords notes etc..for any instrument and there is a lot more functionality in this package. i suggest you to have a look at it Jfugue.org

appdroid
  • 573
  • 7
  • 18
0

I myself found it hard at first to identify a whole chord using FFT. But as far as my experiment went, I was able to make a guitar chord identifier using FFT as the basic algorithm for obtaining frequencies of a single sound data. The problem of FFT tuners is that they only detect the root note of a sound. Whilst my experiment proved that you can take all the notes of the strings being played and use the identified notes to tell what chord was being played. As for now, my research was still limited to detecting Major Guitar Chords and some minor chords like Em and Am for further study.

0

For anyone wondering how to do this kind of thing, look into Harmonic Product Spectrum and Pitch Class Profiles / Chroma Vectors. A combination of these is the key. Also, using the search terms "multiple F0 estimation" as opposed to "chord detection" will warrant much better results :)

nihilo90
  • 109
  • 1
  • 9