I just wanted to chime in and say that Databases are designed for items that are subject to change. Chords, Notes, Keys, etc don't change. So last thing you want in any music application is latency. Computers are built on mathematics, and so is Music Theory, so they get along quite well. Midi Messages are byte arrays.. And computers love bytes, they take very little space, and can be processed/streamed with minimal latency. I believe these things should be hardcoded as the computer can process millions of these types of instructions per second with no latency. A trip to the database will cost you milliseconds that add up.
So the only thing to begin is to describe each element as a class. For each element we want to keep them simple but avoid writing the same code twice. I'm building a midi application from scratch with no knowledge of music theory, and learning some music theory along the way.
Basically you just need a list of notes, each chord is made up of notes a certain distance from each other. This makes it easy to describe as a integer array
(List<int>)Notes.Add(new Note { Name="A", Pitch = 1, AltName="A" };
(List<int>)Notes.Add(new Note { Name="Bb", Pitch = 2, AltName="B Flat" };
Notice the Notes know nothing about Scales, or Chords.
Now we describe a scale
Scales.Add(new Scale { Name = "DIATONIC_MINOR_SCALE", Data= new int[] { 0, 2, 3, 5, 7, 8, 10 } });
Scales.Add(new Scale { Name = "AEOLIAN_SCALE", Data= new int[] { 0, 2, 3, 5, 7, 8, 10 } });
Scales.Add(new Scale { Name = "DORIAN_SCALE", Data= new int[] {0, 2, 3, 5, 7, 9, 10 } });
The numbers describe the distance from the root (notice the scale doesn't care nothing about a root note)
And finally a chord (you could do progressions using this same format)
Chords.Add(new Chord { Name = "DIMINISHED_SEVENTH", Data= new int[] { 4, 6, 9 } });
Chords.Add(new Chord { Name = "SEVENTH_FLAT_FIFTH", Data= new int[] { 4, 6, 10 } });
Chords.Add(new Chord { Name = "MINOR_SEVENTH_FLAT_FIFTH", Data= new int[] { 3, 6, 10 } });
Notice how the chord doesn't care about root notes, or scale.
I believe this is a good start for anyone looking to work with music theory in software engineering.
So im not smart enough to know how to find which chord the user typed, but since these are all list of integers. I think you can now know the root note, chord(s), and scale of any input. I think you could just brute force and find many possible chords. You could just store the users notes as a byte array in the database (the root note is assumed to be the first) and leave the "thinking" stuff to the compiler.