Take the 2-minute tour ×
Music: Practice & Theory Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

I'm searching for chord recognition algorithms that will assign a chord name(s) to a group of notes, and related literature.

Sometimes known as reverse chord identification, where you feed notes to the algorithm, and it will produce a list of possible names.

An example: If we give the algorithm the notes C, E, G, the algorithm should name that group of notes as "C major triad in root position".

share|improve this question
1  
Are you looking for something more than the answers you got on this SO question? –  Ben Miller Oct 18 '13 at 15:24
    
@BenMiller Yes I am. I'm specially interested in methodology and/or literature and/or research on the subject. I'm also interested in the input from musicologists, in contrast with the input of software engineers that SO provides. –  JCPedroza Oct 18 '13 at 16:03

5 Answers 5

In addition the to answers already made, you should be aware that using the algorithmic-generated chord names can be "musically inaccurate" in the context of an harmonic analysis.

Depending of the context, you can have for instance BDF ("B dim") play the role of GDBF ("G Major 7"). If it's resolving to a C Major, you'll want to see BDF as a rootless dominant 7, not as a B diminished triad.

Rootless voicings is only an example : a software will have a difficult time with these little nice "implicit/ambiguous" things that make music an art :)

share|improve this answer

A while back I worked on a Python module that performs similar tasks.

Take a look at the –triadType flag.

share|improve this answer

Perhaps you can contact the developer of "Chords"... the android app that is almost, ...almost... all anyone ever needs in chord naming, inversions, locations on the fretboard etc.

https://play.google.com/store/apps/details?id=com.rabugentom.chord&hl=en

share|improve this answer

Lilypond is open source and has the ability to give chord names from tones. So it must be somewhere in the code base.

share|improve this answer

First issue would be deciding what the root note is, otherwise as kurto says you'll get several answers for one set of note letters.

Would the order of the letters matter? Maybe you could adopt a rule that the first letter is always the root ?

Assuming you tackle that somehow (or just accept several answers), you could ...

Assign a number to each letter (presumably you're accepting sharps and flats too?) and use that to calculate the interval between the notes, in semitones eg what we calla 4th = from A to D is actually 5 semitones.

You could then use the intervals to match a set of known chord patterns against the root note:

C E G as in your example, in semitones = 1-4-7 = [rootnote] major = the relative pattern for a major triad.

C Eb G = 1-3-7 = pattern for minor chord.

1-4-7-10 = Cmaj 7

Each time you're just reporting the root note with a comment about how the rest of the notes are arranged. The limitation would be where a chord is percieved but the root note is missing - but that could be interpreted as some other chord anyway.

The more pattern templates you identify, the better it'll become but you only need to define them relative to a root note in semitone numbers.

If somenthing fits noneof the patterns (perhaps you haven't set one up for chord A4) then you just write the return the root note with extra note number (not semitone number).

So you need

  • a way to convert all letters (sharps and flats) to numbers = a lookup table / associative array
  • a way to identify the root note
  • a way to identify the intervals of all letters from the root note = turn into numbers and subtract the root note number. Modulus by 13 to keep it within 1 octave (or not if you want to get more advanced and handle negative intervals, for notes beneath the root note)
  • a way to define pattern templates for known chords, with name text associated
  • a way to compare semitone numbers to patterns (= an array comparison)
  • a way to turn semitone intervals into note numbers (eg 5 semitones = 4th note on scale) so that you can return things like A4

If you wanted to return all possibilities for a set of notes then you could return the result for your routine, using each note in the chord as the root, in turn.

I'm thinking on my feet here but I think that's how I'd go about it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.