Building the chord finder section

Now that we have had a glimpse of working with JSON files, this should be easy. Let's take a look at the first few lines of the chords.json file from the json directory:

{ "Major" : [0, 4, 7], "Minor" : [0, 3, 7], "Sus4" : [0, 5, 7], "5" : [0, 4, 6], "Diminished" : [0, 3, 6], ...}

This is very similar to the scales structure. Let's say we want to figure out what the C# major chord would look like. So we start with the C# key, which is 0. Then we look at the list of major chords, which read: [0, 4, 7]. So starting at C# the next key to highlight is 4 semitones above and the next is 7 semitones above C#. So the final chord structure for the C# major chord would be:

C#, (C# + 4 semitones) , (C# + 7 semitones) ...

Get Tkinter GUI Application Development Blueprints - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.