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 :)
music.stackexchange.com/users/7047/kurto
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
music.stackexchange.com/users/7240/kelly johnson
A while back I worked on a Python module that performs similar tasks.
Take a look at the –triadType flag.
music.stackexchange.com/users/820/grimmdude
Lilypond is open source and has the ability to give chord names from tones.
So it must be somewhere in the code base.
music.stackexchange.com/users/8682/Meaningful Username
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.
music.stackexchange.com/users/7337/user2808054
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 ".
Looking for letter-based chord identification algorithms, and related literature
music.stackexchange.com
<theory><chords><chord-progressions><chord-theory><diatonic-harmony>
music.stackexchange.com/questions/12341
music.stackexchange.com/users/7218/Von Huffman
Lilypond is open source and has the ability to give chord names from tones. Lilypond might be suitable software to perform this task.
Lilypond might be suitable software to perform this task.