[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference napalm::guitar

Title:GUITARnotes - Where Every Note has Emotion
Notice:Discussion of the finer stringed instruments
Moderator:KDX200::COOPER
Created:Thu Aug 14 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3280
Total number of notes:61432

174.0. "program to print chords/scales on neck" by CSSE::CLARK (every day I have the blues) Thu Feb 20 1986 19:37

    I have written a FORTRAN program for drawing chords and scales. It should
    run underjust about any version of VMS (or TOPS-20). It produces a
    diagram of the neck of the guitar, showing where all the notes in a 
    given chord (or scale) are. Inputs to the program are:

1. the key you are interested in
2. the number of notes in the scale
3. the notes making up the chord

To run this program, you have to:

1. have your keyboard in caps lock mode
2. set your terminal width to 132

Some conventions the program uses are:

1. Flat signs are replaced by - signs, so B flat is B-
2. notes of the chord follow the standard chordal notation, so a chord
     like Cm9 would be spelled R -3 5 -7 9. Note that 'R' denotes the
     root tone (the key).

to run this program, extract this note into a file called chord.for,
     strip off the first 2 pages (leaving only the program), then 
    (after you have exited VMS) do

@for chord
@link chord
 
and then  @run chord every time you want to run the program.


the following are 2 examples. In the first one, I plot the notes in the C major chord. In the second, I 
I plot the notes in an A harmonic minor #4 scale ( a' la' WJB!). 

@RUN CHORD
enter key
C
ENTER THE NUMBER OF NOTES IN THE CHORD
3
ENTER THE NOTES
R
3
5


\
 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R 
   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 
 5 ___   ___   ___   ___   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R ___   ___   ___   
   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   
   ___   ___   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R ___   ___   ___   ___ 3 ___   
 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R ___   ___   ___   ___ 3 ___   ___   ___ 5 ___   ___   ___   ___   ___ R 
/                  .           .           .           .                 :                 .           .           .  

PRINT ANOTHER? (Y/N)
Y
enter key
A
ENTER THE NUMBER OF NOTES IN THE CHORD
7
ENTER THE NOTES
R
2
-3
+4
5
-6
7


\
 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 
 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   
   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 
   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   
 R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 
 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 ___   ___   ___+4 ___ 5 ___-6 ___   ___   ___ 7 ___ R ___   ___ 2 ___-3 
/                  .           .           .          .                  :                 .           .           .
PRINT ANOTHER? (Y/N)
N
@
      CHARACTER*1 Y
      CHARACTER*2 KEY
      Character*3 note,pos(6,21),npos(12)
      DIMENSION IVAL(5)
      DATA IVAL/-5,-9,-2,-7,0/
      DATA NPOS,POS/138*'   '/
    2 type*,'enter key'
      accept 1000,key
 1000 format(a2)
      if(key.eq.'E')KPOS=1
      if(key.eq.'F')KPOS=2
      if(key.eq.'F#')KPOS=3
      if(key.eq.'G-')KPOS=3
      if(key.eq.'G')KPOS=4
      if(key.eq.'G#')KPOS=5
      if(key.eq.'A-')KPOS=5
      if(key.eq.'A')KPOS=6
      if(key.eq.'A#')KPOS=7
      if(key.eq.'B-')KPOS=7
      if(key.eq.'B')KPOS=8
      if(key.eq.'C')KPOS=9
      if(key.eq.'C#')KPOS=10
      if(key.eq.'D-')KPOS=10
      if(key.eq.'D')KPOS=11
      if(key.eq.'E-')KPOS=12
      IF(KEY.EQ.'D#')KPOS=12
      TYPE*,'ENTER THE NUMBER OF NOTES IN THE CHORD'
      ACCEPT*,NNOTES
      TYPE*,'ENTER THE NOTES'
      DO 1,K=1,NNOTES
      ACCEPT 1003,NOTE
 1003 FORMAT(A3)
      IF(NOTE.EQ.'R')NPOS(1)=' R '
      IF(NOTE.EQ.'-2')NPOS(2)='-2 '
      IF(NOTE.EQ.'2')NPOS(3)=' 2 '
      IF(NOTE.EQ.'9')NPOS(3)=' 9 '
      IF(NOTE.EQ.'-3')NPOS(4)='-3 '
      IF(NOTE.EQ.'+9')NPOS(4)='+9 '
      IF(NOTE.EQ.'3')NPOS(5)=' 3 '
      IF(NOTE.EQ.'4')NPOS(6)=' 4 '
      IF(NOTE.EQ.'11')NPOS(6)=' 11'
      IF(NOTE.EQ.'+4')NPOS(7)='+4 '
      IF(NOTE.EQ.'+11')NPOS(7)='+11' 
      IF(NOTE.EQ.'-5')NPOS(7)='-5 '
      IF(NOTE.EQ.'5')NPOS(8)=' 5 '
      IF(NOTE.EQ.'+5')NPOS(9)='+5 '
      IF(NOTE.EQ.'-6')NPOS(9)='-6 '
      IF(NOTE.EQ.'6')NPOS(10)=' 6 '
      IF(NOTE.EQ.'--7')NPOS(10)='--7'
      IF(NOTE.EQ.'13')NPOS(10)=' 13'
      IF(NOTE.EQ.'+6')NPOS(11)='+6 '
      IF(NOTE.EQ.'-7')NPOS(11)='-7 '
      IF(NOTE.EQ.'+13')NPOS(11)='+13'
   1  IF(NOTE.EQ.'7')NPOS(12)=' 7 '
      DO 10 K=1,21
      KE=K+1-KPOS
      IF(KE.LE.0)KE=KE+12
      IF(KE.GT.12)KE=KE-12
      POS(1,K)=NPOS(KE)
  10  CONTINUE
      DO 11 J=2,6
      DO 11 K=1,21
      KX=K+IVAL(J-1)
      IF(KX.LE.0)KX=KX+12
      IF(KX.GT.12)KX=KX-12
      POS(J,K)=POS(1,KX)
   11 CONTINUE
      TYPE 8888
 8888 FORMAT(//,' \')
      DO 666 K=1,6
 666  TYPE 9999,(POS(K,J),J=1,21)
 9999 FORMAT(2X,20(A3,'___'),A3)
      TYPE 7777
 7777 FORMAT(' /',T22,'.',T34,'.',T46,'.',T58,'.',
     1T76,':',T94,'.',T106,'.',T118,'.',T130,'.')
      TYPE*,'PRINT ANOTHER? (Y/N)'
      ACCEPT 1001,Y
 1001 FORMAT(A1)
      IF(Y.EQ.'Y')THEN
            DO 20 J=1,6
            DO 20 K=1,21
   20       POS(J,K)='   '
            DO 21, K=1,12
   21       NPOS(K)='   '
            GO TO 2
      END IF
      END

T.RTitleUserPersonal
Name
DateLines
174.1praise the fortran master!VOYAGE::DDAVIESAlligator crawlin round my cabin floorTue Sep 08 1987 20:433
    Very nice Dave!
    
    Derek (from grateful)
174.2Another happy customer...CSC32::G_HOUSEFri Oct 09 1987 00:018
	This is GREAT!  I've been meaning to write something like this
	for about a year (you know how personal projects get pushed to
	the background).

	Thanks much,
	Greg

174.3PNO::HEISERDon't Bb, B# and you'll look #Mon Apr 24 1989 17:314
    I'm having trouble running this under VMS V5, anyone update the
    program for V5?
    
    Mike
174.4DEMING::CLARKEverybody wants all of my timeMon Apr 24 1989 18:519
    re .3
    
    works fine for me in V5; 
    
    with V5 I notice that you have to type in "fort filename" instead
    of just "for filename" to get it to compile. Maybe that's your
    problem.
    
    -Dave (guitar software maintainability engineer)
174.5who said musicians are brain dead? :-)PNO::HEISERCold Rock The GrooveFri Jun 02 1989 22:5950
    I've recently taken on the task of re-writing this program.  I had
    2 reasons for doing this.  First of all, I don't have any theory
    background and thought it would help me with scales.  Secondly,
    I've also been looking for an excuse to fool around with GKS calls.
    
    I find the calculations (in music) interesting but, my version isn't 
    displaying the same scale on the output as .0 with the same exact inputs.
    With all the math involved in music, you would think they would
    teach it in elementary schools as a math supplement!
    
    These sections of code are executed after the key and chord notes are
    entered.  
    
>      DO 10 K=1,21
>      KE=K+1-KPOS
>      IF(KE.LE.0)KE=KE+12
>      IF(KE.GT.12)KE=KE-12
>      POS(1,K)=NPOS(KE)
>  10  CONTINUE
    
    In the example of the key of C, KPOS = 9 because C is the 9th note
    in the chromatic scale, right?  KE then becomes the counter (K)
    plus 1 - KPOS.  KE is then used to determine whether to add or subtract
    12.  In the key of C (first time through the loop), KE=1+1-9 or
    -7.  I realize that this is done for 21 frets but why add the counter
    (K) and the +1?  Also what is the purpose for adding or subtracting
    12 depending on KE?  I'm sure it is something to do with the chromatic
    scale, other than that I'm lost.  Then the results are written into
    an array, no problem.
    
>      DO 11 J=2,6
>      DO 11 K=1,21
>      KX=K+IVAL(J-1)
>      IF(KX.LE.0)KX=KX+12
>      IF(KX.GT.12)KX=KX-12
>      POS(J,K)=POS(1,KX)
>   11 CONTINUE
    
    More questions here.  Why start the counter (J) at 2, or better
    yet, why do you only want to use IVAL(2) through IVAL(6)?  I know
    it has to do with the notes on each string but the values in IVAL
    through me off.  What are we doing by adding the counter to
    IVAL after substracting one?  The answer to adding and subtracting
    12 is probably the same here as above.  Then they're stored in the
    array.
    
    Any help on how these scales are calculated would be appreciated!
    
    Thanks,
    Mike
174.6no documentation'll getcha every time6171::CLARKroots, wings, and oat branMon Jun 05 1989 12:478
    re .-1
    
    send me mail and we'll talk about the internals of the code offline.
    I know there was a reason for what I did when I wrote the code,
    and it works, but (of course) it never occured to me to DOCUMENT
    what I did, so it's kind of fuzzy to me.
    
    -Dave
174.7PNO::HEISERCold Rock The GrooveTue Jun 06 1989 16:225
    Dave,
    
    I can't seem to reach you at 6171::, do you have another node?
    
    Mike
174.86171::CLARKroots, wings, and oat branTue Jun 06 1989 18:233
    re .7:
    
    deming::clark
174.9BASIC versionPNO::HEISERbash-n-the codeTue Jul 18 1989 20:13111
    Here is a BASIC version of Mr. Clark's program.  It is exactly the
    same except this one will accept mixed case (upper or lower) and
    it sets your terminal to 132 columns for you (and back to 80 when
    done).  I'm now working on a graphics display for the guitar neck
    using GKS.
    
    In case your not familiar with these things, do the following:
    
    Notes> extract/noheader chord.bas
    $ basic chord
    $ link chord
    $ run chord
--------------------------------------------------------
program chord
map (str_var) string chord_key = 2, note = 3, position(6,21) = 3, npos(12) = 3
declare integer ival(5), kpos, nnotes, n, j, k, ke, kx
external long function lib$spawn
ival(1) = -5
ival(2) = -9
ival(3) = -2
ival(4) = -7
ival(5) = 0
call lib$spawn ("set terminal/width=132",,,,,,,,,,,)
beginning:
mat position = nul$(6,21)
mat npos = nul$(12)
input "Enter key"; chord_key
chord_key = edit$(chord_key,32)
if chord_key = "E"  then kpos = 1 end if
if chord_key = "F"  then kpos = 2 end if
if chord_key = "F#" then kpos = 3 end if
if chord_key = "G-" then kpos = 3 end if
if chord_key = "G"  then kpos = 4 end if
if chord_key = "G#" then kpos = 5 end if
if chord_key = "A-" then kpos = 5 end if
if chord_key = "A"  then kpos = 6 end if
if chord_key = "A#" then kpos = 7 end if
if chord_key = "B-" then kpos = 7 end if
if chord_key = "B"  then kpos = 8 end if
if chord_key = "C"  then kpos = 9 end if
if chord_key = "C#" then kpos = 10 end if
if chord_key = "D-" then kpos = 10 end if
if chord_key = "D"  then kpos = 11 end if
if chord_key = "E-" then kpos = 12 end if
if chord_key = "D#" then kpos = 12 end if
input "Enter the number of Notes in the Chord/Scale"; nnotes
for n = 1 to nnotes
    input "Enter Note"; note
    note = edit$(note,32)
if note = "R"   then npos(1) = " R" end if
if note = "-2"  then npos(2) = "-2" end if
if note = "2"   then npos(3) = " 2" end if
if note = "9"   then npos(3) = " 9" end if
if note = "-3"  then npos(4) = "-3" end if
if note = "+9"  then npos(4) = "+9" end if
if note = "3"   then npos(5) = " 3" end if
if note = "4"   then npos(6) = " 4" end if
if note = "11"  then npos(6) = "11" end if
if note = "+4"  then npos(7) = "+4" end if
if note = "+11" then npos(7) = "+11" end if
if note = "-5"  then npos(7) = "-5" end if
if note = "5"   then npos(8) = " 5" end if
if note = "+5"  then npos(9) = "+5" end if
if note = "-6"  then npos(9) = "-6" end if
if note = "6"   then npos(10) = " 6" end if
if note = "--7" then npos(10) = "--7" end if
if note = "13"  then npos(10) = "13" end if
if note = "+6"  then npos(11) = "+6" end if
if note = "-7"  then npos(11) = "-7" end if
if note = "+13" then npos(11) = "+13" end if
if note = "7"   then npos(12) = " 7" end if
next n
for k = 1 to 21
    ke = k + 1 - kpos
    if ke <= 0 then ke = ke + 12 end if
    if ke > 12 then ke = ke - 12 end if
    position(1,k) = npos(ke)
next k
for j = 2 to 6
    for k = 1 to 21
        kx = k + (ival(j - 1))
        if kx <= 0 then kx = kx + 12 end if
        if kx > 12 then kx = kx - 12 end if
        position(j,k) = position(1,kx)
     next k
next j
print " \"
for k = 1 to 6
    for j = 1 to 20
    if edit$(position(k,j),4) = "" then
       print "   ___";
    else
       print edit$(position(k,j),4); "___";
    end if
    next j
    print edit$(position(k,21),4)
next k
print " /"; tab(19); "."; tab(31); "."; tab(43); "."; tab(55); "."; tab(73); &
      ":"; tab(91); "."; tab(103); "."; tab(115); "."; tab(127); "."
print
input "Run Again? [Y] "; again$
if again$ = "Y" or again$ = "y" or again$ = "" then
   goto beginning 
else
   goto finish
end if

finish:
call lib$spawn ("set terminal/width=80",,,,,,,,,,,)
end program
174.10NECK diagramPNO::HEISERCold Rock the Groove!Wed Aug 09 1989 22:13446
174.11S I X E L POBOX::KALLEVIGBOnward through the Fog...Wed Aug 16 1989 16:508
    Hey Mike,
    
    What is the print control command for LN03 to get it to print SIXEL
    is it through DECPAGE?

    Thanks,
    
    BJ
174.12PNO::HEISERCold Rock the Groove!Wed Aug 16 1989 22:113
    BJ, just use the print command and send it to an LN03 queue.
    
    Mike
174.13didn't know where else to put thisZEMI::HEISERJCM 900 rules!Mon Apr 29 1991 23:264
    Anyone have some nice guitar related GIF images they would like to
    share? 
    
    Mike
174.14scale programFRETZ::HEISERmaranathaTue Mar 24 1992 21:01252
/****************************************************************************
 *
 *	Fretted instrument chord and scale plotter.
 *
 *     Notes:
 *     
 *     Program functions:
 *
 *     1. Print fretboard
 *        - prints the fret board with the current chord/scale in the
 *          current tuning.  Defaults: major chord and std. guitar.
 *     2. Enter chord or scale
 *        - enter new chord/scale. Intervals are relative to the previous
 *          note in the scale; e.g. a major seventh would be entered as
 *          4,3,4. The root is implied.  A blank line ends the entry.
 *          The maximum number of notes is currently 12.
 *     3. Enter tuning
 *        - enter a new tuning.  Similar to entering a chord.  The
 *          maximum number of strings is 8.
 *     4. Output to file
 *        - direct output to a file as well as to stdout.
 *     5. Print std. six chords
 *        - print major, minor, maj7, min7, dim and aug.
 *
 ****************************************************************************/
#include <stdio.h>

#define MAX_NOTES 12
#define MAX_FRETS 18
#define MAX_STRINGS 8

static char int_names[24][5] =
{
  "---R","--b2","---2","--b3","---3","---4","--b5","---5","--b6","---6","--b7","---7",
  "---R","--b9","---9","--#9","---3","--11","-#11","---5","-b13","--13","--b7","---7"
  };

static char instr_name[40] = {"Std. Guitar"};
static char chord_name[40] = {"Major Chord"};

static int tuning[MAX_STRINGS] = {0, 5, 10, 15, 19, 24, 0, 0};

static int chord[MAX_NOTES] = {0, 4, 7, 0, 0, 0, 0};

static int nstring=6, nnote=3, nfret=MAX_FRETS;

static int fretbd[MAX_STRINGS][MAX_FRETS];



static FILE *outfile=NULL;

void print_fretbd();
void fret_chord();
void std_six();
void set_chord(char *name, int n, int *interval);
void get_chord();
void get_tuning();
void open_file();

main()
{
  char cmd[10];
  
  for(;;)
    {
      printf("1. Print fretboard\n");
      printf("2. Enter chord or scale\n");
      printf("3. Enter tuning\n");
      printf("4. Output to file\n");
      printf("5. Print std. six chords\n");
      gets(cmd);
      if (cmd[0] == NULL) break;
      if (cmd[0] == '1')
	{
	  fret_chord();
	  print_fretbd();
	}
      else if (cmd[0] == '2')
	{
	  get_chord();
	}
      else if (cmd[0] == '3')
	{
	  get_tuning();
	}
      else if (cmd[0] == '4')
	{
	  open_file();
	}
      else if (cmd[0] == '5')
	{
	  std_six();
	}
    }
}

void std_six()
{
  int interval[6];
  
  interval[0] = 0; interval[1] = 4; interval[2] = 3;
  set_chord("Major Chord", 3, interval);
  fret_chord();
  print_fretbd();
  
  interval[0] = 0; interval[1] = 3; interval[2] = 4;
  set_chord("Minor Chord", 3, interval);
  fret_chord();
  print_fretbd();
  
  interval[0] = 0; interval[1] = 4; interval[2] = 3; interval[3] = 3;
  set_chord("Seventh Chord", 4, interval);
  fret_chord();
  print_fretbd();
  
  interval[0] = 0; interval[1] = 3; interval[2] = 4; interval[3] = 3;
  set_chord("Minor Seventh Chord", 4, interval);
  fret_chord();
  print_fretbd();
  
  interval[0] = 0; interval[1] = 3; interval[2] = 3; interval[3] = 3;
  set_chord("Diminished Chord", 4, interval);
  fret_chord();
  print_fretbd();
  
  interval[0] = 0; interval[1] = 4; interval[2] = 4;
  set_chord("Augmented Chord", 3, interval);
  fret_chord();
  print_fretbd();
  
}

void set_chord(char *name, int n, int *interval)
{
  int i;
  
  sprintf(chord_name, "%s", name);
  nnote = n;
  for(i = 1,chord[0]=0; i<n; i++)
    {
      chord[i] = chord[i-1] + interval[i];
    }
}

void open_file()
{
  char filename[40];
  
  printf("Enter file name->");
  gets(filename);
  if((outfile = fopen(filename,"w")) == NULL)
    {
      fprintf(stderr, "Can't open %s\n");
    }
}

void get_chord()
{
  char line[20];
  int interval;
  
  printf("Enter chord name-->");
  gets(chord_name);
  
  for(nnote = 1,chord[0]=0; ;nnote++)
    {
      printf("Enter interval %d-->", nnote);
      gets(line);
      if(sscanf(line, "%d", &interval) != 1) break;
      chord[nnote] = chord[nnote-1] + interval;
    }
}


void get_tuning()
{
  char line[20];
  int interval;
  
  
  printf("Enter name-->");
  gets(instr_name);
  
  for(nstring=1,tuning[0]=0; ;nstring++)
    {
      printf("Enter interval %d-->", nstring);
      gets(line);
      if(sscanf(line, "%d", &interval) != 1) break;
      tuning[nstring] = tuning[nstring-1] + interval;
    }
}

void fret_chord()
{
  int istr, inote, ifret;
  
  for(istr=0; istr<nstring; istr++)
    for(ifret=0; ifret<MAX_FRETS; ifret++)
      fretbd[istr][ifret] = -1;
  
  for(istr=0; istr<nstring; istr++)
    {
      for(ifret=0; ifret<nfret; ifret++)
	{
	  for(inote=0; inote<nnote; inote++)
	    {
	      if(((tuning[istr] + ifret) % 12) == (chord[inote] % 12))
		{
		  fretbd[istr][ifret] = chord[inote] % 24;
		  break;
		}
	    }
	}
    }
}

void print_fretbd()
{
  int istr, inote, ifret;
  
  printf("\n\n%s --- %s\n\n", instr_name, chord_name);
  for(istr=nstring-1; istr>=0; istr--)
    {
      for(ifret=0; ifret<nfret; ifret++)
	{
	  if(fretbd[istr][ifret] == -1)
	    printf("---+");
	  else
	    printf("%s", int_names[fretbd[istr][ifret]]);
	}
      printf("\n");
    }
  printf("\n\n");
  
  if(outfile != NULL)
    {
      fprintf(outfile, "\n\n%s --- %s\n\n", instr_name, chord_name);
      for(istr=nstring-1; istr>=0; istr--)
	{
	  for(ifret=0; ifret<nfret; ifret++)
	    {
	      if(fretbd[istr][ifret] == -1)
		fprintf(outfile, "---+");
	      else
		fprintf(outfile, "%s", int_names[fretbd[istr][ifret]]);
	    }
	  fprintf(outfile, "\n");
        }
      fprintf(outfile, "\n");
    }
}
174.15How's it work?GOES11::G_HOUSENow I'm down in itWed Mar 25 1992 13:403
    Where's the instructions, dude?
    
    gh
174.16what kind of propeller head are ya?!FRETZ::HEISERmaranathaWed Mar 25 1992 13:454
    The instructions are in the comment field.  Just compile it and run it.
    It's pretty neat, even handles alternate tunings.
    
    Mike
174.17GOES11::G_HOUSENow I'm down in itWed Mar 25 1992 13:505
    I did, man, but I couldn't figure out what format it wanted the
    intervals in when inputting a chord formula.  I put in m3 for minor 3rd
    and it just went back to it's little menu thing.
    
    gh
174.18its programmed in "semis" or half steps,.. numerically onlySTAR::SALKEWICZIt missed... therefore, I am Wed Mar 25 1992 14:3214
    Well,. form his example,.. a major 7th being 4,3,4..
    
    It must be number of half steps or semi-tones in each interval:
    
    Major seventh chord:
    
    1 3 5 7
    
    4 semis between root and second note (1,3)
    3 semis between second note and third note (3,5)
    4 semis between third note and fourth note (5,7)
    
    							/Bill
    
174.19FRETZ::HEISERmaranathaWed Mar 25 1992 19:094
    Slash-Bill is right.  For a minor chord, you type MINOR, then enter
    your intervals.  
    
    Mike
174.20Glazzed Hammmmmm.Chocolate covered raisinsCSLALL::PLAFONDDRILL O' DOOMTue Mar 31 1992 10:496
     Hay guy's I can't seem to get any of these to work!
    At the dollar sign I do $@for chord or $for chord and none of them
    work, I just about had it! I'm dying to see just one!
    			can someone HELP ME!!!!!
    				I would be so thankful
    Pierre who has tried everything in the book.
174.21FRETZ::HEISERmaranatha!Tue Mar 31 1992 13:055
    The program is in C.  You have to compile like this:
    
    $ CC chord
    $ LINK chord
    $ RUN chord
174.22reposted - there was a bugDPE::STARRCrazy for tryin', and crazy for cryin'Fri Jun 05 1992 19:06224
/* I found this posted on the USENET, and it works pretty well!		     */
/* Note: I changed the 24 frets to 21, so that it fits on a 132-char window. */
/*       That'll work fine for all the Strat players!  8^)                   */
/* 					- Alan				     */

/*
Article 4924 of alt.guitar:
From: huston@mksol.dseg.ti.com (william a huston)
Subject: guitar_scales.c -- corrected version!
Organization: Texas Instruments
Date: Fri, 5 Jun 1992 18:47:42 GMT

 
 BUG ALERT!  The previous posting of this program had a small error.
 If you asked for a C dorian, you'd get a D dorian. All other modes
 were shifted too. Here is the correct version:

 -------------------------------------------------------------------

 Here's a nifty little program I wrote to help guitar players learn
 their scales.
 
 You specify the starting note and the mode (Ionian,Lydian, etc), and
 it produces two diagrams.
 
   o  The first is just a picture of the guitar neck showing where the all
      of the notes are.
 
   o  The second shows you where the notes are for the particular tonic/mode
      that you desire.
 
 My Ibanez has 24 frets, but if you have fewer, you can easily modify
 the program (just change MAXFRETS).
 
 You can also easily modify the program to produce scales for different
 tunings by changing the "guitar" array. EX: for the King's X/Pearl
 Jam/Sound Garden/Neil Young "D" tuning, set it to {4,11,7,2,9,2}
 
 With a little doing, you should be able to modify for instruments
 with different number of stings (change MAXFRETS and fix draw_bound()
 where it draws the "pearl inlays" on the neck).
 
     BE FOREWARNED! This can produce W I D E output!
     columns required = 6 + 6 * MAXFRETS
     Example: 6 + 6 * 24 frets = 150 columns needed.
 
 Good luck!

--------------------------------------------------------------------

*/

#include <stdio.h>

/* Version 1.1   C dorian was really a D dorian, etc.   */

/* guitar_scales.c                                      */
/* By William A. Huston                                 */
/* huston@ap040.ti.com or  huston@mksol.dseg.ti.com     */

/* Submitted to the alt.guitar 3 Jun 92                 */

/* You are free to use/copy/modify, as long as you keep */
/* all of these comments intact. Thanks and enjoy!      */

/* change this to be the number of frets desired.       */
/* BE FOREWARNED! This can produce W I D E output!      */
/* columns required = 6 + 6 * MAXFRETS                  */
/* Example: 6 + 6 * 24 frets = 150 columns needed       */

#define MAXFRET 24
#define STRING 6

char *note_text[12] =
     { "  C  ",               /*   0   */
                "C#/Db",      /*   1   */
       "  D  ",               /*   2   */
                "D#/Eb",      /*   3   */
       "  E  ",               /*   4   */
       "  F  ",               /*   5   */
                "F#/Gb",      /*   6   */
       "  G  ",               /*   7   */
                "G#/Ab",      /*   8   */
       "  A  ",               /*   9   */
                "A#/Bb",      /*   10   */
       "  B  " };             /*   11   */


/* change the following if you use a non-standard tuning */
char guitar[STRING] = {4,11,7,2,9,4} ;     /* E=4 (hi), B=11, G,D,A,E (lo) */

char mode_start[7] = {0,2,4,5,7,9,11}  ;   /* intervals relative to tonic for ionian */

char *mode_text[7] = {"Ionian","Dorian","Phrygian",
                      "Lydian","Mixolydian","Aeolian","Locrian"};
char note_value[12];

void draw_bound(int string)
{
  int fret;
      printf("\n     ");
      for (fret =1; fret <= MAXFRET; fret ++)
        {
         if (((string == 2) && ((fret == 3 ) || (fret == 5 ) || (fret == 7 ) || (fret ==9 ) ||
                                (fret == 15) || (fret == 17) || (fret == 19) || (fret ==21)
                               )
             ) ||
             (((string == 1) || (string == 3)) &&
              ((fret == 12)  || (fret == 24))
             )
            )
             printf("|=(*)=");        /* a pearl inlay! */
         else
             printf("|=====");
        }
    printf("|\n");

}


/* draw the top line */

void draw_first()
{
  int fret;
  printf("\n\n     ");
  for (fret =1;fret <=MAXFRET;fret++)
      printf("|=====");
  printf("|\n");

}


main(argc,argv)
int argc;
char *argv[];
{
  static int tonic = -1;
  static int mode = -1;
  char junk[100];

  int k,x,i,string,fret,crap;

  if (argc == 3)
    {
      sscanf(argv[1],"%d",&tonic);
      sscanf(argv[2],"%d",&mode);
    }

  while (tonic <0 || tonic >11)
    {
      for (x=0;x<12;x++)
         printf ("\t\t%3d : %s\n",x,note_text[x]);
      printf("\n  What tonic?  ");
      gets(junk);
      sscanf(junk,"%d",&tonic);
      if (tonic <0 || tonic >11)
          printf("*** %d is an invalid input!\n",tonic);
        else
          printf("The tonic you selected was %d (%s)\n",tonic,note_text[tonic]);
    }

  while (mode <0 || mode >6)
    {
      for (x=0;x<7;x++)
         printf ("\t\t%3d : %s\n",x,mode_text[x]);
      printf("\n  What mode?  ");
      gets(junk);
      sscanf(junk,"%d",&mode);
      if (mode <0 || mode >11)
        printf("*** %d is an invalid input!\n",mode);
    }

  printf("\nYou have picked a %s %s scale.\n\n",note_text[tonic],mode_text[mode]);

  k = mode_start[mode];

  for (x=0;x<7;x++)
  {
    i = mode_start[(x+mode) % 7]; 
    printf("%2d: %s\n",x+1,note_text[(tonic+i-k+12) % 12]);
    note_value[(tonic+i-k+12) % 12] = x + 1 ;
  }

   /* print neck all notes */

  draw_first();
  for (string =0; string <STRING; string++)
    {
      for (fret =0;fret <=MAXFRET;fret++)
           printf("%s|",note_text[(guitar[string]+fret) % 12]);
      draw_bound(string);
    }
  printf("\n\n     ");

  for (fret =1;fret <=MAXFRET ;fret++)
      printf("  %2d  ",fret);
  printf("\n");

  /* print scale on neck */

  draw_first();
  for (string = 0; string <STRING; string++)
    {
      for (fret =0;fret <=MAXFRET;fret++)
        {
          if ( note_value[ (guitar[string]+fret) % 12 ])
              printf("%3d  |",note_value[ (guitar[string]+fret) % 12 ]);
            else
              printf("     |");
        }
      draw_bound(string);
    }

}

/*

-- 
Bill Huston      214-480-4610 
Texas Instruments (Dallas/Forest Ln), ICC
MSG: ZAPA    email: huston@ap040.csc.ti.com

*/