1 'TOY PIANO by Glen Monnett 2 'October 2, 1984 Ver.2 3 'Updated version by Don Sandor April 23, 1985 There are two variables in line 4 '15 which can be changed to suit 5 'your own taste. X is any whole 6 'number; the larger the number, the 7 'longer the sound after you press a 8 'key. Y is any number between 1 9 'and 5. Whole numbers for Y will 10 ' result in the actual pitches 11 ' indicated by the "piano" keyboard 12 ' on the screen. Rational numbers 13 ' for Y will put you in another key. 14 ' This updated version allows the 15 ' user to change Y while playing by hitting the numbers 1-5 16 ' 18 DIMS(5,13),D(13),P(13):I$="zsxdcvgbhnjm," 19 X=7:Y=1 20 FORI=1TO13:READD(I):NEXTI 30 FORY=1TO5:FORI=1TO13:S(Y,I)=INT(D(I)/Y):NEXTI:NEXTY:Y=3 40 GOSUB300:PRINT@0,Y; 50 FORY=1TO13:READP(Y):NEXTY:Y=3 100 S$=INKEY$:IFS$=""THEN100 110 I=INSTR(1,I$,S$):IFI>0THEN240 120 S=VAL(S$):IFS>0ANDS<6THENY=S:PRINT@0,Y;:GOTO 100 130 GOTO100 240 PRINT@P(I),"*";:SOUND S(Y,I),X 250 PRINT@P(I),S$;:GOTO100 300 CLS:LINE(23,20)-(23,52):LINE(23,52)-(43,52):LINE(43,52)-(43,36):LINE(35,20)-(55,36),1,BF 310 LINE(47,36)-(47,52):LINE(47,52)-(67,52):LINE(67,52)-(67,36):LINE(59,20)-(79,36),1,BF 320 LINE(71,36)-(71,52):LINE(71,52)-(91,52):LINE(91,52)-(91,20) 330 LINE(95,20)-(95,52):LINE(95,52)-(115,52):LINE(115,52)-(115,36):LINE(107,20)-(127,36),1,BF 340 LINE(119,36)-(119,52):LINE(119,52)-(139,52):LINE(139,52)-(139,36):LINE(131,20)-(151,36),1,BF 350 LINE(143,36)-(143,52):LINE(143,52)-(163,52):LINE(163,52)-(163,36):LINE(155,20)-(175,36),1,BF 355 REM LINE TOY PIANO,(C)1984 BY GLEN MONNETT 2 360 LINE(167,36)-(167,52):LINE(167,52)-(187,52):LINE(187,52)-(187,20) 370 LINE(191,20)-(191,52):LINE(191,52)-(211,52):LINE(211,52)-(211,36):LINE(211,36)-(203,36):LINE(203,36)-(203,20) 390 PRINT@205,"z":PRINT@209,"x":PRINT@213,"c":PRINT@217,"v":PRINT@221,"b":PRINT@225,"n":PRINT@229,"m":PRINT@233,"," 395 PRINTCHR$(27);"p":PRINT@127,"s":PRINT@131,"d":PRINT@139,"g":PRINT@143,"h":PRINT@147,"j":PRINTCHR$(27);"q" 400 RETURN 2000 DATA9394,8866,8368,7900,7456,7032,6642,6269,5918,5586,5272,4976,4697 2010 DATA 205,127,209,131,213,217,139,221,143,225,147,229,233