Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Perl proggy for making guitar neck diagrams of scales

created by Big Willy

(thing) by Big Willy (4.2 y) (print)   ?   1 C! I like it! Wed Jan 10 2001 at 22:17:47

January 10, 2001 v 0.1

This perl program is cool for those guitar/stringed instrument players who like a little bit o' help when it comes to rememeber scale positions. I always have a problem with some of the last major positions and it always helped me to look at the scales on a diagram. Enter this guy:

#!/usr/bin/perl -w

use strict;

my %octave = ('A', '-', 'A#', '-', 'B', '-', 'C', '-', 
              'C#', '-', 'D', '-', 'D#', '-', 'E', '-', 
              'F', '-', 'F#', '-', 'G', '-', 'G#', '-');
my @strings = ('G', 'D', 'A', 'E');
my @notes = @ARGV;
my $note;

foreach $note (@notes) {
        $note = uc($note);
        if($note =~ /^([A-G])B$/) {
                if($1 eq "A") { $note = "G#"; }
                else { $note = chr(ord($1) - 1) . "#"; } 
        }

        $octave{$note} = $note;
}

my @octave_old = sort keys %octave;
my @octave_new = ();
foreach (@octave_old) {
        push(@octave_new, $octave{$_});
}

print "   0    1    2    3    4    5    6    7    8    9   10   11   12\n";
foreach $note (@strings) {
        while ($note ne $octave_old[0]) {
                push(@octave_new, shift(@octave_new));
                push(@octave_old, shift(@octave_old));
        }
        
        foreach $note (@octave_new) {
                print "| $note ";
                if ($note !~ /[#]/) {
                        print " ";
                }
        }
        print "| $octave_new[0]\n";
}
So if I want to print out a diagram of major scale in C (C, D, E, F, G, A, B), this little jewel works great. Just type this on your console and out pops your diagram:

neckdia.pl C D E F G A B

   0    1    2    3    4    5    6    7    8    9   10   11   12
| G  | -  | A  | -  | B  | C  | -  | D  | -  | E  | F  | -  | G
| D  | -  | E  | F  | -  | G  | -  | A  | -  | B  | C  | -  | D
| A  | -  | B  | C  | -  | D  | -  | E  | F  | -  | G  | -  | A
| E  | F  | -  | G  | -  | A  | -  | B  | C  | -  | D  | -  | E

Boom, I got a major C diagram over one octave on my neck. I've got this setup for standard tuning on a four string bass, but it's easy to change that. Not far from the top of the program is a line that says

my @strings = ('G', 'D', 'A', 'E');
If I want a standard guitar tuning I just change this line of code to

my @strings = ('E', 'B', 'G', 'D', 'A', 'E');
Or if I want drop D tuning on my bass (who would want that, honestly?), bang:

my @strings = ('G', 'D', 'A', 'D');

This is pretty basic right now. I just whipped this up the other day out of frustration. Please note that if you enter flats on the command line that they will be switched to the appropriate shrap for simplicity sake. DO NOT put flats in the @strings array. That will produce unruly behavior.

I want to develop it some more. Perhaps I will add a little text file of scales and labels so I don't have to remember all the notes or a feature that will allow me to enter major C and tell it to shit the scale down to major A even if I dont know the notes in major A. Lot's of stuff. Watch the date and version number at the top of the writeup for these juicy details...

printable version
chaos

Guide to Chord Formation Exotic Scales Musical scales deCSS
Python program to help train fretboard fluency Five modes of minor pentatonic for guitar E2 piecemaker proxy Pre/Trans fallacy
Words of Advice for Young People #include Diatonic scale cuatro
vi Delft Richard P. Feynman butt
japh E2 HTML tags : Chapter 1 January 10, 2001 guitar
Perl slug proggy sequencing
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
The best nodes of all time:
Thomas Shadwell
Chaos theory
Everything: In the Beginning
Black beans and rice
National Negro Business League
I had forgotten the bear's name, and could not find my way home to the Thousand Acre wood
Aerosmith
In Defense and Exhortation of E2 Fiction
Parable of the Good Samaritan
Middle English
Pius IX
Hell hath no fury like a woman scorned
Scottie
New Writeups
VergilKint
Aye, Wormwood(fiction)
badme
Basque(personal)
niruena
George Chapman(person)
Whiskeydaemon
May 18, 2008(log)
Junkill
Saci(idea)
Scientist
futureme.org(thing)
cryforhelp
Why I love Everything2(idea)
Jet-Poop
Uncle Sam(person)
nailbiter
direct marketing(thing)
Ouzo
Existential Dilemmas(personal)
shaogo
Robert Mondavi(person)
Ouzo
Goodwill Hunting, Thrift Store(ies)(log)
Pandeism Fish
How conatus compels divine ketosis through a radical kenosis(essay)
cryforhelp
Major dictionaries of the world(review)
Glowing Fish
The Uncanny X-Men and the New Teen Titans(thing)
This page courtesy of The Everything Development Company