Simple Python Guitar Script (SPGS?!)
After school had finished yesterday I gave guitar lessons like every day. Then this on student asked me: "Wouldn't it be awesome to have a program ask you what chord you want and then just spit it out ?!" I told him that there are lots of flash programs out there that do that and that it would be much easier to just look at a chord table. That night it was raining and I had nothing to do. Totally bored I read through a few tutorials on how to program python online, since it could be useful someday. This all happend on Friday.
Now I present you with the ULTIMATE python script (SPGS?!). To tell the truth it is more than simple and stupid, but maybe someone sees a use for it. Here is the code:
print
print "~Chord directory~"
print " Press Ctrl+D to quit"
C = "032010"
Cm = "x35543"
D = "000232"
Dm = "xx0231"
D7 = "xx0212"
F = "003211, 133211"
Fm = "133111"
G = "320003, 355433"
Gm = "355333"
B = "024442"
Bm = "113321"
E = "022100"
Em = "022000"
A = "003330"
Am = "x02210"
while True:
print
x = input("Which chord are you looking for? ")
print x
P.S. I always wanted to paste code somewhere.
Comments
YOU DONT MEMORIZE THEM!
You learn what scales they are derived from and build them, simple as that, even more you don't even have to learn the scales you can just learn the root and the steps to the kind of scale you want and viola!
Major scales: whole-step, whole-step, half-step, whole-step, whole-step, whole-step, half-step.
Minor scales: whole-step, half-step, whole-step, whole-step, half-step, whole-step, whole-step.
You build chords by combining three or more notes at the same time, usually a simple chord is the first third and fifth notes on a scale.
I don't feel like explaining anymore since it's so simple.
Learn music theory people!
Also, your program doesn't take into consideration every chord there is. There are more than just major and minor chords, and there are also different inversions of those chords.
If you need to find a chords, look it up on the internet, buy a book, or learn to build them from scales like I did. If you want to learn your chords, I think the way to do it is the way I forced myself to. I decided played guitar in my high school jazz band my senior year, and it forced me to learn a lot more than I would have ever learned on my own. I also had to take into consideration inversions, where on the guitar the chord was, what octave it sounded better in, did I want to repeat notes in the chord, and a lot more. A music theory class was helpful too, but not as much. Playing jazz really humbled me as a guitar player and was a great learning experience.
I been playing music since I can remember, and I have a minor on music theory.
I have played for orchestras, bands, symphonies I dedicate my life to music.
A chord book is pretty much a lazy man's excuse to learn chords.
Jazz is fun to play, i remember being in my school's jazz band for four consecutive years (from 7th to 10th grade.)
Yes I never went to a public school, bite me.
Have you notice that this forum gets off topic really easily?
#!/usr/bin/python
START = "\n~Chord directory~\nPress Ctrl+D to quit\n"
PROMPT = "Which cord are you looking for? "
chord = { 'C':'032010', 'Cm':'x35543', 'D':'000232', 'Dm':'xx0231', 'D7':'xx0212', 'F':'003211, 133211', 'Fm':'133111', 'G':'320003, 355433', 'Gm':'355333', 'B':'024442', 'Bm':'113321', 'E':'022100', 'Em':'022000', "A":'003330', 'Am':'x02210' }
print START
while True:
print chord[raw_input(PROMPT)]
BTW, I had 7 years of guitar lessons and with that music theory. I do a agree with The wired. I was just bored and looking for goal which I would be able to accomplish with python. Don't take it to serious.
Edit: If you (The wired.) have time you could maybe right something about how chords work. I haven't been able to teach my pupils without them starting to cry.
The first thing one should know about building chords is the difference between whole-tones and semi-tones, a semi-tone is the distance from on fret to the next such as from B to C or from A to A#. Whole-tones are a two fret distance on a guitar, such as from A to B.
Part 2: Scale formulas.
Scales follow a simple formula which anyone can memorize, as an example I'll use a key of C, just because there's only natural notes.
C D E F G A B C
| | | | | | | |
1 2 3 4 5 6 7 1
R
O
O
T
There's a pattern there which will be repeated on every single major scale.
Whole-tone, whole-tone, semi-tone, whole-tone, whole-tone, whole-tone, semi-tone.
That's it, that's that pattern that's followed on a major scale, it's pretty much the backbone of music to make an analogy.
Start on any key, C,B,D#, you name it! and if you follow the pattern than you will see you just made a major scale!
The pattern for the minor scales is as follows: whole-tone, semi-tone, whole-tone, whole-tone, semi-tone, whole-tone, whole-tone.
Part3:chords
Many people ask "what does scales have to do with chords?" the answer is: everything.
Chords are basically segments of scales!
Get any scales, let's use C again, and play the first, third and fifth notes in it. You will probably notice that makes a chord!
Tell me how this part is so I can continue....
Do you mind if I translate it to German?
I will post the other part in the new thread.