# Get Chord Name From a Given Set of Notes

I am trying to come up with an algorithm that gets the proper chord name given certain Notes, user may or may not inform which from the notes is the root.

I suppose that the process in recognizing a chord name differs for how many notes are given, so maybe there should be an algorithm for triads, one for 4 note chords, and another for 5+ notes? Or is there a general way of approaching this? maybe chord patterns?

• You could transform every pitch class set to its prime form, and then use that as a key for a chord dictionary. This answer contains information about how to find the prime form: music.stackexchange.com/questions/82120/… Also check out en.wikipedia.org/wiki/Set_theory_(music) Commented Jul 20, 2019 at 18:14
• What in your opinion is a proper chord name? Even the proper chord name...? Can you give an example of an improper chord name? Commented Jul 20, 2019 at 21:11
• @YourUncleBob this is pretty interesting, I did not knew about Set Theory, I think I'll get a book. Commented Jul 21, 2019 at 21:17
• Actually, the prime form of a pitch-class set in set theory is found through rotation and mirroring, which means e.g. that a major and minor triad both have prime form (0,3,7). For your use case, you should use only rotation, not mirroring, so that you get (0,4,7) for major triads. Commented Jul 21, 2019 at 21:38
• You haven't said what your input or output data will be. Commented Jul 22, 2019 at 13:41

• `N6` versus `Db` is analysis (identifying function in a key) versus naming (identifying root and chord quality.) Commented Jul 22, 2019 at 13:39