Classic Computer Magazine Archive ANTIC VOL. 4, NO. 6 / OCTOBER 1985

BANJO PICKER

Play bluegrass music like a bionic Earl Scruggs!

by RICHARD K. LINDGREN

Program your Atari to make sounds like an automated five-string banjo.  Then just press two keys and you'll be strumming bluegrass rhythms like a bionic Earl Scruggs.  Banjo Picker is a BASIC program that works on all Atari computers of any memory size.

Even if your manual dexterity is so bad that you can barely type with two fingers at  a time, your Atari and the Banjo Picker program will enable you to pick fancy banjo chords at a speed and accuracy rivaling Earl Scruggs...or at least Steve Martin.
   All you need to do is type in Listing 1, check it with TYPO II, and SAVE it.

WHAT IT DOES
Banjo Picker uses the Atari's four sound generators to simulate the style of a five-string banjo. Each string in the sequence starts out at high volume, then reduces volume by steps as the successive strings are played. By the time the fifth string in the sequence is played, the first has reached zero volume level, and can be sounded again.
   The program can play 11 different 8-note patterns for 13 chords. When you RUN Banjo Picker, you'll see the current chord and pattern numbers displayed at the top of the screen. Below this line, you'll see a diagram of the banjo neck. A bouncing ball follows each string as it is played in sequence.
   At the bottom of the screen is a display showing which Atari keys control the chords and picking patterns.

PICKIN' YOUR ATARI
   You'll see a helpful diagram of the Banjo Picker operating keys in Figure 1.
   The chords are arranged in "autoharp" fashion on the left side of the keyboard, four rows of four keys each. The four related chords in a musical key are found in each row.
   For instance, the top row contains the Key of C, with keyboard numbers 1 through 4 controlling the subdominant chord (F), the tonic (C), the dominant seventh (G7), and the relative minor (Am), respectively.
   The next row contains the corresponding chords for the Key of G, the most popular Key for bluegrass music. The Key of D and Key of A chords are on the two rows below. Three chords (C,G,D) are duplicated on the keyboard in order for the rows to be arranged consistently.
   At the right side of the Atari keyboard, the 11 picking patterns are controlled by the 7, 8, 9 and 0 keys in the top row, the U, I, O and P keys in the row below, and the J, K and L keys in the next row down.
   Use the [START] key to start and stop playing. Initially the "G" chord and the first pattern are played. The [OPTION] key speeds up your picking and the [SELECT] key slows it down.

Banjo Picker operating keys

MAKING MUSIC
Hundreds of simple folk-type songs can be played with as few as three adjacent chords. Place the middle finger of your left hand on the W key (the G chord), with the first and third fingers on E and Q, respectively. Bring the playing up to a comfortable speed with the [OPTION] key and try accompanying "Comm' Round the Mountain" using only these three fingers.
   Next, try different picking patterns with your right hand and listen for the rhythm. Each pattern has eight notes, so it is best to change as the eighth note is played. When you are trying to change the chord and pattern each time, press the chord key slightly before the pattern key

PROGRAM TAKE-APART
Lines 60-140 contain the heart of the program. The program sequentially steps through the frequencies represented by the five strings. The banjo's distinctive sound comes from the shortened fifth "drone" string, which usually has a frequency higher than the other strings.
   The program rotates these five frequencies through four calls to a machine language routine which quickly POKEs the appropriate SOUND parameters with decreasing volume for each frequency The pick pattern determines the order in which the strings are selected, and POKEs a diamond at the appropriate screen location.
Lines 160-250 check for new keyboard selections. The position in array KB corresponding to the internal code of the key pressed contains either a chord number, if positive, a pattern number if negative, or a zero for a "dead" key.
   Lines 260-300 handle the special function keys. The speed is decreased by an addition to the delay variable, but increased by halving it, which allows you to quickly get any desired speed.
   The initial display is handled in lines 310-370, after which the sound POKE routine and frequency values are read into arrays. Next, the chords and pick patterns are read in, along with the internal code for the corresponding keyboard position.

TUNING YOUR BANJO
In line 580, you can alter the initial chord played (variable P), the initial pick pattern (PP), and the speed (W). Variables Cl through C4, initialized in line 570, control the tone type and volume. The volume fade can be altered by changing these variables, adding 160 to the volume level (0-15) for each sound generator. The total volume should not exceed 32.
   The chord data is composed of the internal keyboard code, followed by the appropriate positions in the frequency array (PL) for each of the five strings and the chord name.
   These can be changed to create new chords or to place them on different keyboard keys. The key's internal code is not the same as its ASCII code. To find the internal code for any key, use the one-line program below. The code for each key will be displayed as it is pressed.

10 PRINT PEEK(764) : GOTO 10

   Likewise, the pick patterns consist of the keyboard code followed by the numbers of the strings in the eight-note sequence. These patterns and others can be found in Bluegrass Banjo by Peter Wernick (Oak Publications, 1974).

KEY VARIABLES
SC(22)      The array containing the scale values for 22 notes.
PK(1l,8)    The eleven eight-note picking patterns.
PL(13,5)    The scale values for each string for thirteen chords.
SIMUL$(16)  The sound poke routine.
A$(30)      A string for reading and displaying the banjo picture.
CN$(39)     A string containing 3-character chord names for each chord.
KB(63)      The array which contains the chord or pattern numbers for each keyboard key.
ST1         The screen address next to the string being played.
Fl-F4       The current poke values for frequency.
Cl-C4       The current poke values for tone and volume.
U           The address of the sound poke routine.
LST         The last key pressed.
P1,P2       Positions in string CN$ containing the chord name.
W           The speed delay value.
P           The current chord being played.
PP          The current pick pattern.
 

Richard K Lindgren is a CPA and a business professor at Graceland College in Lamoni, Iowa. He is author of a new Antic APX Classic two-program disk, Real Estate Cash Flow Analysis and Strategic Financial Ratio Analysis. When finance gets dull, he picks a homemade, left-handed banjo.

Listing 1  BANJO.BAS Download