Guess That Song!
- Type
- Game
- Category
- Two-player music quiz
- Author
- Karl E. Wiegers
- Published in
- Antic, July 1985 (Vol. 4, No. 3)
- Year
- 1985
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit computer, any memory size, Atari BASIC; disk or cassette
- Tags
- antic, music, quiz, two-player, sound, data-statements, party-game, 1985
About the program
The format of the TV quiz show Name That Tune ("I can name that tune in three notes!") made a natural party game for a computer with four sound channels. Karl E. Wiegers' Guess That Song! appeared in Antic in July 1985. Your Atari acts as host and band, and it knows the first ten notes of 40 songs in four categories. There are ten rock songs (from "Sunshine of Your Love" to "Ebony and Ivory"), ten classical pieces, ten TV and film themes (Star Wars, Star Trek, Mission Impossible) and ten general songs, ending with "Seventy-Six Trombones".
Typing it in
Lines 4000–4390 are where the work is. Each tune is written as a string of ten characters, many of them inverse or control characters, because each character's ATASCII code is the pitch value passed to SOUND. Type them exactly. {inv} … {/inv} means press the Atari (inverse) key before and after. {CTRL-P} means hold CTRL and press P. {CTRL-.} and {CTRL-,} are CTRL with the full stop and comma keys. {UP} in line 2075 is ESC then CTRL-minus. One wrong character only gives you a sour note, so listen to each tune as you check it. Antic printed TYPO II checksums beside each line of the magazine listing. They are not part of the program.
How to play
Enter both players' names. The program picks a random song and shows its category. The players then take turns to bid. Starting from 10, each bid must be lower than the last ("I can guess that song in…"), until somebody types P to pass. The winner of the bidding hears that many notes and can press R to hear them again. Pressing A shows the title, and you then press Y or N to say whether the guess was right. A correct guess scores 11 minus the bid, so naming a tune from four notes earns 7. A wrong guess loses as many points as the bid. The first player to 50 wins and is rewarded with a fanfare.
How it works
Each DATA line holds a tempo, a gap between notes, the ten pitch characters, ten duration letters (A = 1 unit, B = 2 and so on, so if A is an eighth note then D is a half note) and the title. The routine at 2500 does a RESTORE to the song's line number (LN=3990+SONG*10), READs the line and plays each note with SOUND 0,ASC(P$(I,I)),10,8 in a loop whose length is the tempo multiplied by the duration. Lines 1510–1520 alter the GRAPHICS 0 display list to put a strip of big mode-6 text at the top for the names and scores. DONE$ marks songs that have been guessed so that they don't come up again.
Adding your own songs
Wiegers explained how to replace a tune. Write out its first ten notes and their lengths, look up the character for each pitch (the magazine gave a table of keystrokes and SOUND values), and put the new DATA line in place of an old one. To test a tune quickly, add 2255 GRAPHICS 0:LN=4000:LIST LN:PRINT "GOTO 2255" (using your line number), RUN, press RESET, then type GOTO 2255. The line is listed and the tune plays, so you can edit the line and try it again.
Listing
10 REM GUESS THAT SONG!
20 REM BY KARL E. WIEGERS
30 REM (c) 1985, ANTIC PUBLISHING
50 DIM PLYR1$(8),PLYR2$(8),NAME$(40),CAT$(44),DONE$(40),P$(11),D$(11),BID$(2),BL$(38),WHO$(8),S(2)
60 NAME$=" ":NAME$(40)=NAME$:NAME$(2)=NAME$:DONE$=NAME$:BL$=NAME$(3)
70 CAT$=" rock classical theme songs general "
80 S(1)=0:S(2)=0:LAST=2:OLDBID=11
90 GOSUB 1000:REM GET PLAYER NAMES
110 GOSUB 1500:REM GET CATEGORY
120 GOSUB 2000:REM DO BIDDING
130 GOSUB 2200:REM PLAY SONG
140 GOSUB 2800:REM JUDGE ANSWER
150 GOSUB 3500:REM SEE IF THERE'S A WINNER YET
160 IF A=78 OR A=110 THEN END
170 IF A=89 OR A=121 THEN 60
180 FOR I=1 TO 40:IF DONE$(I,I)=" " THEN 110
190 NEXT I
200 GRAPHICS 17:? #6;"SORRY, OUT OF SONGS"
210 ? #6:? #6;" PRESS ANY KEY TO":? #6;" PLAY AGAIN"
220 GOSUB 900:GOTO 60
800 FOR I=1 TO 15:SOUND 0,96,10,10:NEXT I
810 FOR I=1 TO 15:SOUND 0,128,10,10:NEXT I
820 SOUND 0,0,0,0:RETURN
900 OPEN #1,4,0,"K:":GET #1,A:CLOSE #1:RETURN
1000 GRAPHICS 18:TRAP 1000:POKE 65,0
1010 POSITION 2,0:? #6;"{inv}guess{/inv} that SONG!"
1020 POSITION 1,4:? #6;"{inv}WHO IS PLAYER 1?{/inv}"
1030 POSITION 5,5:? #6;"?":Y=5:GOSUB 1100
1040 PLYR1$=NAME$(1,I-1)
1050 POSITION 1,8:? #6;"{inv}WHO IS PLAYER 2?{/inv}"
1060 POSITION 5,9:? #6;"?":Y=9:GOSUB 1100
1070 PLYR2$=NAME$(1,I-1)
1080 TRAP 40000:RETURN
1100 OPEN #1,4,0,"K:"
1110 FOR I=1 TO 14:GET #1,A
1120 IF A=155 THEN 1150
1130 POSITION I+5,Y:PUT #6,A
1140 NAME$(I,I)=CHR$(A):NEXT I
1150 CLOSE #1:RETURN
1500 GRAPHICS 0:POKE 752,1:POKE 708,88:POKE 710,18
1510 DL=PEEK(560)+256*PEEK(561)
1520 POKE DL+3,70:FOR I=6 TO 10:POKE DL+I,6:NEXT I
1530 POSITION 1,0:? #6;PLYR1$:POSITION 11,0:? #6;PLYR2$
1540 POSITION 3,1:? #6;S(1):POSITION 13,1:? #6;S(2)
1550 SONG=INT(100*RND(0)):IF SONG<1 OR SONG>40 THEN 1550
1560 IF DONE$(SONG,SONG)="1" THEN 1550
1570 CA=INT((SONG+9)/10):LN=3990+SONG*10
1580 POSITION 20,2:? #6;"CATEGORY:";CAT$(11*CA-10,11*CA)
1590 RETURN
2000 OLDBID=11
2005 TRAP 40000:IF LAST=1 THEN WHO$=PLYR2$
2010 IF LAST=2 THEN WHO$=PLYR1$
2020 POSITION 2,6:? WHO$;", you can guess that song in":? "how many notes..."
2030 POSITION 20,7:INPUT BID$
2035 IF BID$="0" THEN OB=2:GOTO 2071
2036 IF BID$<>"1" THEN 2040
2037 IF LAST=2 THEN LAST=1:GOTO 2039
2038 IF LAST=1 THEN LAST=2
2039 BID$="P":OLDBID=1:POSITION 10,4:? "CURRENT BID = ";OLDBID;" "
2040 IF BID$="P" OR BID$="p" THEN 2110
2050 TRAP 2070:NUBID=VAL(BID$)
2060 IF NUBID<OLDBID AND NUBID>0 THEN 2090
2070 OB=OLDBID
2071 GOSUB 800:? :? "MUST BE FROM 1 TO ";OB-1;", OR {inv}P{/inv} TO PASS":FOR TIM=1 TO 500:NEXT TIM
2075 ? "{UP}Please try again. ":FOR TIM=1 TO 500:NEXT TIM
2077 ? "{UP} "
2080 POSITION 20,7:? " ":GOTO 2030
2090 OLDBID=NUBID:LAST=1+(LAST=1):POSITION 10,4:? "CURRENT BID = ";OLDBID;" "
2100 POSITION 1,6:? BL$:? BL$:? BL$:? BL$:GOTO 2005
2110 IF OLDBID=11 THEN OLDBID=10
2120 RETURN
2200 POSITION 1,6:? BL$:? BL$:? BL$:? BL$
2210 IF LAST=1 THEN WHO$=PLYR1$
2220 IF LAST=2 THEN WHO$=PLYR2$
2230 POSITION 2,6:? "Okay, ";WHO$;", here are your ";OLDBID;" notes."
2240 ? "For ";11-OLDBID;" point";:IF OLDBID<10 THEN ? "s";
2245 ? ", {inv}GUESS THAT SONG!!{/inv}"
2250 FOR I=1 TO 300:NEXT I
2260 GOSUB 2500
2270 POSITION 2,10:? "Press {inv}A{/inv} for answer, {inv}R{/inv} to play again"
2280 GOSUB 900
2290 IF A=82 OR A=114 THEN 2260
2300 IF A<>65 AND A<>97 THEN GOSUB 800:GOTO 2280
2310 RETURN
2500 RESTORE LN:READ TEMPO,PAUSE,P$,D$,NAME$
2510 FOR I=1 TO OLDBID
2520 FOR J=1 TO TEMPO*(ASC(D$(I,I))-64)
2530 SOUND 0,ASC(P$(I,I)),10,8:NEXT J
2540 FOR J=1 TO PAUSE:SOUND 0,0,0,0:NEXT J
2550 NEXT I:SOUND 0,0,0,0:RETURN
2800 POSITION 2,10:? "The title of this song is: ":? :? NAME$
2810 POSITION 2,15:? "Did ";WHO$;" get the title correct?"
2820 GOSUB 900
2830 IF A=78 OR A=110 THEN 2900
2840 IF A<>89 AND A<>121 THEN GOSUB 800:? :? " PRESS {inv}Y{/inv} FOR YES OR {inv}N{/inv} FOR NO":GOTO 2820
2850 FOR I=1 TO 11-OLDBID:S(LAST)=S(LAST)+1:POSITION 3+(LAST=2)*10,1:? #6;S(LAST);" "
2860 GOSUB 3100:NEXT I
2870 DONE$(SONG,SONG)="1"
2880 POSITION 2,15:? "Here are the first ten notes.... ":OLDBID=10:GOSUB 2500
2890 GOTO 3000
2900 FOR I=1 TO OLDBID:S(LAST)=S(LAST)-1:POSITION 3+(LAST=2)*10,1:? #6;S(LAST);" "
2910 POKE 53279,1:FOR J=1 TO 20:NEXT J:NEXT I
3000 POSITION 7,20:? "{inv} PRESS ANY KEY TO CONTINUE {/inv}"
3010 GOSUB 900:RETURN
3100 FOR J=8 TO 0 STEP -1:SOUND 0,53,10,J:FOR K=1 TO 4:NEXT K:NEXT J:RETURN
3500 IF S(1)>=50 THEN WHO$=PLYR1$:GOTO 3530
3510 IF S(2)>=50 THEN WHO$=PLYR2$:GOTO 3530
3520 A=0:RETURN
3530 GRAPHICS 18
3540 POSITION 3,4:? #6;WHO$;" {inv}wins{/inv}!!"
3550 FOR I=40 TO 230:POKE 708,I:NEXT I
3560 LN=5000:OLDBID=11:GOSUB 2500
3570 POSITION 4,8:? #6;"{inv}PLAY AGAIN?{/inv}"
3580 GOSUB 900:IF A=78 OR A=89 OR A=110 OR A=121 THEN RETURN
3600 POSITION 4,10:? #6;"PRESS Y OR N":GOTO 3580
3999 REM SONG DATA
4000 DATA 15,8,llyl{inv}{CTRL-P}{CTRL-Y}"Y6Y{/inv},AAABBBBABA,"Sunshine of Your Love"
4010 DATA 10,4,{inv}{CTRL-P}{CTRL-H}{/inv}y{inv}{CTRL-P}"{CTRL-P}6{CTRL-P}{CTRL-P}"{/inv},BAHABAIBAB,"Yellow Submarine"
4020 DATA 16,4,{inv}"66{CTRL-P}{CTRL-,}{/inv}rl{CTRL-.}[{CTRL-.},AAHAAAAAAB,"Yesterday"
4030 DATA 6,5,ylf[fly{inv}{CTRL-H}{/inv}y{inv}{CTRL-H}{/inv},CCOCCCBBPC,"The Age of Aquarius"
4040 DATA 16,3,{CTRL-.}{CTRL-.}@@@UQU{CTRL-.}@,DBACBCABHB,"Scarborough Fair"
4050 DATA 13,4,{CTRL-.}U{CTRL-.}l{CTRL-.}{CTRL-.}U{CTRL-.}l{inv}{CTRL-,}{/inv},AAAALAAACL,"California Dreaming"
4060 DATA 4,6,{inv}A{CTRL-P}{/inv}<@H{inv}A{CTRL-P}{/inv}HQH,BFFCHBFFCH,"Happy Together"
4070 DATA 25,4,{inv}{CTRL-P}{/inv}y{CTRL-.}H@{CTRL-.}y@<Q,AAAAAAAAAA,"Stairway to Heaven"
4080 DATA 12,6,{inv}6{CTRL-Y}{/inv}ffrf[yyf,CCFBABAHAB,"Close to You"
4090 DATA 20,5,{inv}{CTRL-P}"{CTRL-P}{/inv}y{inv}{CTRL-H}{/inv}y[QHH,AABBBACAAA,"Ebony and Ivory"
4100 DATA 28,3,{inv}"{/inv}yf{inv}"{/inv}yf{inv}"{/inv}yf{inv}"{/inv},AAAAAAAAAA,"Moonlight Sonata"
4110 DATA 21,4,{inv}"6{CTRL-H}{/inv}y[ly[l{inv}{CTRL-H}{/inv},BBBAABAABB,"Pictures at an Exhibition"
4120 DATA 12,4,<@<5<@H<<H,LAAAAAABAA,"Ravel's Bolero"
4130 DATA 20,7,{inv}YY-{CTRL-P}{CTRL-P}{/inv}HHUU{inv}Y{/inv},AAAABABABA,"The Blue Danube"
4140 DATA 6,5,{inv}"""L666Y""{/inv},CCCNCCCLBB,"Beethoven's Fifth Symphony"
4150 DATA 20,3,{inv}{CTRL-P}{CTRL-P}{/inv}y{inv}{CTRL-P}{CTRL-P}{/inv}y{inv}{CTRL-P}{/inv}y[{CTRL-.},AADAADAABC,"Brahms' Lullaby"
4160 DATA 23,4,{CTRL-.}yl{CTRL-.}Q[[HQQ,AAAAAAAAAA, "Jesu Joy of Man's Desiring" (Bach)
4170 DATA 20,3,{CTRL-.}U{CTRL-.}lrl{inv}{CTRL-,}{CTRL-,}{/inv}rl,ABABAACAAB,"Carnival of Venice"
4180 DATA 4,8,llll{CTRL-.}{CTRL-.}Ul{CTRL-.}l,FAAAFFFFME,Marche Miniature from "The Nutcracker"
4190 DATA 15,8,{inv}"{CTRL-P}{CTRL-H}{/inv}yl{inv}{CTRL-H}{/inv}lr{inv}{CTRL-P}{/inv}r,AAAAAABAAB,"In the Hall of the Mountain King"
4200 DATA 28,3,{inv}"{/inv}yflyfyly{inv}{CTRL-Y}{/inv},AAAAAAAAAA,"The Godfather"
4210 DATA 5,4,{inv}"{CTRL-P}{/inv}yl{CTRL-.}yyyl{CTRL-.},DBDBGDZDBD,"All in the Family"
4220 DATA 15,4,{inv}A{/inv}{CTRL-.}r{inv}{CTRL-,}A{/inv}{CTRL-.}{inv}{CTRL-,}{CTRL-P}{CTRL-P}{/inv}H,BCAJBCAJBC,"Tara's Theme" (Gone With the Wind)
4230 DATA 15,5,[flflflyly,BBACBBAGAA,"MASH" ("Suicide is Painless")
4240 DATA 8,5,{inv}A{CTRL-P}{/inv}{CTRL-.}lr{inv}{CTRL-,}{/inv}H{CTRL-.}lr,DGGAAAGDAA,"Star Wars"
4250 DATA 14,4,QHQ[{CTRL-.}ly{inv}{CTRL-,}{CTRL-P}{CTRL-,}{/inv},BBAAFAABBD,"The Sound of Music"
4260 DATA 12,4,{inv}"{CTRL-Y}{CTRL-P}{/inv}[{inv}{CTRL-P}{/inv}[{inv}{CTRL-P}{/inv}[[Q,AAABABAFAA,"The Sting"
4270 DATA 6,20,{inv}""{CTRL-H}{/inv}y{inv}""6-""{/inv},CCBBCCBBCC,"Mission Impossible"
4280 DATA 10,5,{inv}A{CTRL-P}{/inv}lr{inv}{CTRL-P}-{CTRL-,}{/inv}{CTRL-.}{CTRL-.}L,CAFBAAAFAJ,"Star Trek"
4290 DATA 10,5,D[fly{inv}{CTRL-H}{/inv}y[[{CTRL-.},MAAAAABBAA,"Oklahoma!"
4300 DATA 10,7,{CTRL-.}{CTRL-.}{CTRL-.}[{CTRL-.}ly{CTRL-.}{CTRL-.}Q,CBABABAKAB,"Raindrops Keep Falling on My Head"
4310 DATA 9,5,{inv}"AsA"{/inv}y{CTRL-.}ly{inv}A{/inv},BACCCFBACC,"The Star-Spangled Banner"
4320 DATA 14,3,l[QH@HQ{CTRL-.}yl,BDBCABDBCA,"Greensleeves"
4330 DATA 10,5,{inv}{CTRL-P}{CTRL-P}{CTRL-Y}{CTRL-P}{CTRL-,}{CTRL-P}{CTRL-,}{CTRL-P}{CTRL-,}{CTRL-P}{/inv},DCAAGABAAB,"Beer Barrel Polka"
4340 DATA 11,5,lQl{inv}{CTRL-,}"{/inv}{CTRL-.}l{inv}{CTRL-,}{/inv}l{inv}{CTRL-P}{/inv},BBBBCAAABI,"How Much is That Doggy in the Window?"
4350 DATA 30,3,{inv}A-"{/inv}y{inv}YA-{CTRL-,}{CTRL-,}s{/inv},AAAEAAABCA,"Autumn Leaves"
4360 DATA 30,4,{inv}A{/inv}{CTRL-.}lr{inv}{CTRL-H}{CTRL-,}{/inv}U{inv}{CTRL-Y}{/inv}LU,AAAAAABAAA,"When You Wish Upon A Star"
4370 DATA 21,4,{inv}"{/inv}ylfQ{inv}{CTRL-P}{/inv}l{inv}{CTRL-,}{CTRL-Y}"{/inv},AAAAAFBFBH,"The Shadow of Your Smile"
4380 DATA 13,4,{inv}6{CTRL-P}{/inv}yl{inv}{CTRL-P}{/inv}l[Qy[,DBBCADDBBH,"Anchors Aweigh"
4390 DATA 3,8,yl{CTRL-.}[y{inv}{CTRL-P}"6A{/inv}l,BBBGGGDBDB,"Seventy-Six Trombones"
5000 DATA 6,4,lrl{inv}{CTRL-,}{/inv}l{CTRL-.}[UQLH,DCABDBBBBBD,WINNER
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: GUESSIT.BAS.
Credits
- Program listing: Guess That Song! — program listing (Antic, July 1985 (Vol. 4, No. 3)) — Karl E. Wiegers
- Picture: Entering the contestants' names. — Karl E. Wiegers (program); screenshot by the site
- Antic, July 1985 - Vol. 4 No. 3: article (atarimagazines.com) — Karl E. Wiegers, 1985
- Antic disk, July 1985 - Vol. 4 No. 3: GUESSIT.BAS (detokenized listing) — AtariMagazines.com (Kevin Savetz), 1985
