The Sound of Music

See all articles from ZX-Appeal Dec 89
Author(s): Frederic Huynh
Publication: ZX-Appeal
Pub Details: ZX-Appeal Dec 89
Date: December 1989
Pages: 19

INCREASE the sensitivity of your eardrums and set the hills alive with a musical game for the QL by Frederic Huynh of Paris in France.

The Sound of Music plays a tune of eight notes and asks you to duplicate if from memory. At the end of the game you will be given a score based on the number of notes correct, and the computer will play both versions for comparison.

QL users may also find the numerical values for a scale useful, as the QL manual does not provide any information on the subject itself.

100 REMark DOREMI v.2-1
110 MODE 8
120 OPEN #4,scr_:WINDOW #4,442,200,38,16
130 PAPER #1,0:PAPER #2,0:CLS:CLS #0
140 start
150 RESTORE :CLS
160 initialisation
170 CSIZE #0,3,1
180 octave
190 PAUSE 100: ecoute
200 PAUSE 100:CLS# 0: hasard
210 entree
220 CLS #0:compare
230 fin
240 IF ans=1 THEN PAUSE 10:PAUSE 10:PAUSE 10:RUN
250 END IF
260 PAUSE 5:PAUSE 5:CSIZE #0,2,0:CLS:CLS#0:STOP
20000 DEFine PROCedure initialisation
20010 RANDOMISE
20020 DIM a(9):DIM b(9):DIM resulta(9):DIM h(9):r=1:bon=0
20030 col=-30
20040 FOR i=1 TO 8
20050 READ a(i),b(i)
20060 END FOR i
20070 DATA 33,90,28,80,24,70,22,60,18,50,15,40,12,30,11,20
20080 RETurn
20090 DEFine PROCedure octave
20100 AT #0,1,2:PRINT #0;" Listen to the scale"
20110 x=20
20120 FOR i=1 TO 8
20130 BLOCK 30,b(i),x,100-b(i),i:x=x+50
20140 BEEP 10000,a(i):PAUSE 20
20150 END FOR i
20160 RETurn
20170 DEFine PROCedure ecoute
20180 AT #0,1,4:PRINT #0;" One more time "
20190 FOR i=1 TO 8
20200 BEEP 10000,a(i):PAUSE 20
20210 END FOR i
20220 RETurn
20230 DEFine PROCedure hasard
20240 AT#0,1,4:PRINT #0;" Now ,Listen to the score"
20250 FOR i=1 TO 8
20260 h(i)=INT(RND(1 TO 8))
20270 BEEP 10000,a(h(i)):FOR z=1 TO 200:NEXT z
20280 END FOR i
20290 PAUSE 100:AT #0,1,0:PRINT #0;" Last audition ! "
20300 FOR i=1 TO 8
20310 BEEP 10000,a(h(i)):FOR z=1 TO 200:NEXT z
20320 END FOR i
20330 RETurn
20340 DEFine PROCedure entree
20350 INK #0,3:AT #0,1,0:PRINT #0;" Enter your solution ":INK #0,7
20360 y=20
20370 BLOCK 30,5,y,100,2
20380 IF KEYROW(1)=16 AND y<370 THEN y=y+50:BLOCK 30,5,y-50,100,0:BLOCK 30,5,y,100,2
20390 IF KEYROW(1)=2 AND y>20 TH

[The rest of the listing (from line 20390 on) is not in the scan; the printed page ends mid-line.]

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.