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

  1. Scale scale = Scale.of(Note.C);
  2. System.out.println("Scale of C : " + scale);
  3.  
  4. Scale mode = Mode.IONIAN.of(scale);
  5. System.out.println("Scale of C in "+Mode.IONIAN+" mode : " + mode);
  6.  
  7. Scale chord = Chord.major(mode);
  8. System.out.println("Major chord : " + chord);
  9.  
  10. 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 !