O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required