sept.
2010
Become a Guitar Hero with The Coder's Breakfast !
I'm in the process of learning scales, modes and chords for the guitar, but these aren't easy to remember. Being a developer, I thought I could write a small program to help me understand how they are built, and where I can find the related notes on the guitar neck.
So I spent a couple of hours on it tonight (mainly to find documentation on music theory) and here it is : a small companion program that can calculate and display any chord in any mode and key.
The API is very compact and ultra-easy to understand :
(A "Scale" is basically a collection of Notes. It is used to contain notes for whole Scales, Chords, etc.)
Scale scale = Scale.of(Note.C); System.out.println("Scale of C : " + scale); Scale mode = Mode.IONIAN.of(scale); System.out.println("Scale of C in "+Mode.IONIAN+" mode : " + mode); Scale chord = Chord.major(mode); System.out.println("Major chord : " + chord); Guitar.display(chord, Guitar.STANDART_TUNING, 12); // 12 frets
And here is the result :
Scale of C : [C, C#, D, D#, E, F, F#, G, G#, A, A#, B] Scale of C in IONIAN mode : [C, D, E, F, G, A, B] Major chord : [C, E, G] 3 5 7 9 12 --E --||------|------|--G --|------|------|------|------|--C --|------|------|------|--E --| ------||--C --|------|------|------|--E --|------|------|--G --|------|------|------|------| --G --||------|------|------|------|--C --|------|------|------|--E --|------|------|--G --| ------||------|--E --|------|------|--G --|------|------|------|------|--C --|------|------| ------||------|------|--C --|------|------|------|--E --|------|------|--G --|------|------| --E --||------|------|--G --|------|------|------|------|--C --|------|------|------|--E --|
The source code is available for download just below.
This ain't rocket science but hey, I thought It might be cool to share it with you :)
Comments and suggestions welcome !
Commentaires
Nice little program :)
Super, je teste ça ce soir.
Manque un peu de commentaires, mais très sympas
Merci !
Effectivement ça aurait pu être mieux commenté, mais j'ai développé ça rapidement hier soir, juste pour voir... Au final, je suis quand même plutôt content du résultat, puisque ça marche et c'est utile.
Wahh moi qui compris rien au solfège, je trouve ton programme génial et bien écrit !
Je vais m'en servir pour apprendre les notes sur le manche.
MERCI !!
Heureux que ça te serve :)