CURTIS S. SMITH, P.G.







Project Description

"Find a project that aligns with your interests."

This is a common piece of advice given to any new programmers; it can be difficult for concepts to truly sink in when just doing homework or working on datasets that spark no personal creativity.

Enter this project.

I've played guitar for about 5 years, but recently started getting into music theory; while reading The Idiot's Guide to Guitar Theory, I began to realize that notes, scales, and chords are all just math (well, like 95% anyways... There always seems to be room for some creative dissonant sounds). I figured creating a program to that would tell me what chord I was playing would help tremendously when learning all of the patterns necessary to build up the foundation for understanding music theory.

How this project works: the user input fret numbers get converted into notes by looking up their value in a dictionary. As there are only 12 notes in the chromatic scale, the dictionary only needs to be 12 items long; however, as there are more than 12 frets for any given string, "12" is subtracted until the input notes are between null and 12 (null for a muted string) - so this code could work for a guitar with any length of neck.

The converted notes are then run through some funtions to calculate the respective chords for the input root note (the note played on the lowest string). For example: if the input root note is "G", the program calculates the degrees of the G Major scale (e.g., the root, minor third, perfect fifth, major seventh, etc.). Using those calculated degrees, a large number of chords can be constructed. The G Minor chord is comprised of the root, minor third, and perfect fifth degrees. As all the degrees are calculated, the degrees are run through functions that return the correct degree.

This resuts in an output displaying the chord entered (if any; there are definitely combinations of frets that do not correspond to any chord structure). Additinionally, the chord structures for the entered root note are returned.

Lastly, this is a stepping stone for the more useful, and ambitious, project that will sort of do the reverse of this project: inputting the key you want to play in and outputting the chords (and fret positions) for the input key.

LinkedIn || GitHub

curtis.smith.geo@gmail.com