Classic Computer Magazine Archive ANTIC VOL. 4, NO. 3 / JULY 1985

Guess that Song

How many notes do you bid?

by KARL E. WIEGERS

A musical quiz show emceed by your Atari. How many notes do you bid to Guess That Song? This BASIC program runs on all Atari computers of any memory size, with disk or cassette.

Now, in the privacy of your own home, you can experience the thrills and suspense of being a contestant on one of the classic television quiz shows. Just type in Listing 1, check it with TYPO II, SAVE a copy and get ready to play Guess That Song against your friends!
   With this program, your Atari can perform the first ten notes of 40 songs-rock, classical, TV/movie themes, and general.
   After entering the names of the contestants, each opponent bids to see who thinks they can identify the song from the fewest number of notes.
   The bidding starts at 10 notes and ends when someone presses [P] to pass. Players alternate bidding and each bid must be lower than the previous one.
   The computer will play the number of notes bid. You can press [R] for a repeat playing of the notes (don't press [RETURN]).

BIG CHANCE
Here's your big chance! Now is the time to guess the mystery song. When you think you have it, press [A] to see the correct answer. Then you must tell the computer if you identified the song correctly. Press [Y] if you got it right, or [N] if not. Use your judgement to determine how accurately a song's title must be stated to be considered correct.
   If you won the bid and guessed the song correctly, your score will increase by 11-minus the number of notes in the bid.
   For example, a song successfully identified from four notes gives that player seven points. The fewer the notes, the more points awarded for a correct identification.
   However, if the guessing player misses the song, then the score decreases by the number of notes in the bid. When prompted, press any key to go on to another song. The player who passed on the previous song gets the first chance to bid on the next one. Fifty points wins the game.
   Correctly guessed songs won't reappear in the current game. A missed tune might pop up again later, though.

ADDING SONGS
You can replace any of the tunes in "Guess That Song!" with your own selections. You must construct a DATA to replace one already in the program, using the same line number. Lines 4000-4090 are the rock songs, 4 100- 4190 are classical, 4200-4290 are theme songs, and general songs live from 4300-4390.
   The DATA statement for each song has five factors. First is the relative tempo (speed) at which the song is played. Smaller tempo numbers play faster.
   Second factor is separation of the notes in the song. Increasing this number gives a more staccato character to the tune, as well as slowing it slightly. Third comes a string of 10 funny looking characters-which will be explained later.
   Fourth is a string of 10 letters, which represent the relative duration that each note is to be played. For example, if the letter A represents an eighth note, then B represents a quarter note, D is a half note, and H a whole note. Finally, the title of the song completes the DATA statement.
   Write down the notes in the song and their relative durations. Check Table 1 and look up the keystrokes corresponding to that note. The pitch values for the SOUND command are also shown. The ten-character string in the third position of each DATA statement is the sequence of keystrokes you found in the table for the first 10 notes of your song.

TRYING NEW TUNES
To try out your new tune, replace one of the DATA statements in Guess That Song with the entries for your song. It will take some experimenting to get the song to sound right, so let's use a quick way to test the new selection. Add this line to the Guess That Song program:

2255 GRAPHICS 0: LN=????: LIST LN: PRINT "GOTO 2255"

   Replace the ???? with the line number you are using for your new song. Now type RUN, then press [SYSTEM RESET] without entering player names. Now type GOTO 2255.
   The screen will clear, your new DATA line will be listed on the screen along with a GOTO 2255 line, and you'll hear the song. Disregard the error message which appears. To change any part of your DATA statement, edit the line shown using the cursor keys, and press [RETURN] twice.
   Repeat this procedure for all your new songs until they are just right. Then, type 2255 and press [RETURN] to delete line 2255, and SAVE the modified program. SAVE it with a different filename than used for the original Guess That Song so you can keep both versions.

SAMPLE SONG
As an example, let's do "Red River Valley" in the key of E The notes are: C F A A A A G A G F. Table 1 tells us to type, in inverse Video: s 6 [CTRL] P [CTRL] P [CTRL] P [CTRL] P "[CTRL] P " 6. The complete data statement might look like this:
DATA statement

PROGRAM TAKE-APART
50-80      Initializations
110-150    Call subroutines for main parts of program
160-220    Decide whether to continue, play again, or quit
800-820    Subroutine to make error sound
900        Subroutine to get a keypress
1000-1150  Subroutine to get player names
1500-1540  Subroutine to show players and scores, select next song, show category
2000-2120  Subroutine for bidding on number of notes
2200-2260  Play specified number of notes of current song
2270-2310  Let user play again or see the answer
2500-2550  Play the song
2800-2840  Let user indicate whether guess was correct
2850-2890  If correct: increase score, play all ten notes, set flag so song isn't played again this game
2900-2910  If wrong, decrease score
3000-3010  Get keypress and go on with game
3100       Subroutine to make sound when score goes up
3500-3680  Judge if there is a winner, play tune if yes
4000-4090  Data for rock songs
4100-4190  Data for classical songs
4200-4290  Data for theme songs
4300-4390  Data for general songs
5000       Data for song played when someone wins

Table 1
Pitch values and Keystrokes for Notes. ([INV] stands for Inverse Video key.)
 
Note Value Keystroke
C 243 [INV]s
C#/Db 230 [INV]f
D 217 [INV]Y
D#/Eb 204 [INV]L
E 193 [INV]A
F 182 [INV]6
F#/Gb 173 [INV]-
G 162 [INV]"
G#/Ab 153 [INV][CTRL]Y
A 144 [INV][CTRL]P
A#/Bb 136 [INV][CTRL]H
B 128 [INV][CTRL],
C 121 Y
C#/Db 114 r
D 108 l
D#/Eb 102 f
E 96 [CTRL].
F 91 [
F#/Gb 85 U
G 81 Q
G#/Ab 76 L
A 72 H
A#/Bb 68 D
B 64 @
C 60 <
C#/Db 57 9
D 53 5
D#/Eb 50 2
E 47 /
F 45 -
F#/Gb 42 *
G 40 (
G#/Ab 37 %
A 35 #
A#/Bb 33 !
B 31 [ESC][CTRL]*
C 29 [ESC][CTRL]=

Listing 1     GUESSIT.BAS Download