8-Bit Software Online Conversion

Musical Keyboard Program - Listing

10 REM KEYBOARD MUSIC MAKER 20 REM by CARL WHEAT 30 MODE 5:VDU 23;8202;0;0;0; 40 DIM P%(17),K%(22):E%=1 50 ENVELOPE 1,1,0,0,0,0,0,0,126,-1,0, -1,126,0:REM BELL 60 ENVELOPE 2,1,1,-1,0,1,1,200,126,-2 ,-1,-20,126,60:REM PIANO 70 ENVELOPE 3,1,0,0,0,0,0,0,50,0,0,-5 0,126,126:REM ORGAN 80 ENVELOPE 4,1,1,-1,0,1,1,0,40,0,0,- 40,120,120:REM WOODWIND 90 ENVELOPE 5,1,1,-1,1,1,2,1,30,0,0,- 30,126,126:REM ELECTRONIC 100 FOR N=1 TO 17:READ P%(N):NEXT 110 FOR N=1 TO 22:READ K%(N):NEXT 120 PROCkeyboard:PROCtitles 130 : 140 REPEAT:FOR N=1 TO 22 150 IF INKEY(-K%(N))=-1 PROCsound 160 NEXT N:UNTIL 0 170 : 180 DEFPROCsound 190 IF N>17 THEN PROCinst:ENDPROC 200 SOUND &1011,0,0,0 210 SOUND 1,E%,P%(N),5 220 ENDPROC 230 : 240 DEFPROCinst:E%=N-17 250 IF E%=1 THEN PRINT" BELL " 260 IF E%=2 THEN PRINT" PIANO " 270 IF E%=3 THEN PRINT" ORGAN " 280 IF E%=4 THEN PRINT" WOODWIND " 290 IF E%=5 THEN PRINT"ELECTRONIC" 300 ENDPROC 310 : 320 DEFPROCkeyboard:VDU5 330 PLOT4,20,10:PLOT1,1200,0 340 PLOT1,0,250:PLOT1,-1200,0 350 FOR N=0 TO 9:READ K$ 360 PLOT1,0,-250 370 MOVE 50+120*N,60:PRINT K$ 380 MOVE 140+120*N,260:NEXT 390 MOVE 100,260 400 FOR N=1 TO 9:READ B% 410 IF B%=0 THEN PLOT0,120,0:NEXT 420 PLOT0,0,-125:PLOT81,80,125 430 PLOT81,0,-125:PLOT0,40,125:NEXT 440 GCOL0,0 450 FOR N=0 TO 8:READ K$ 460 IF K$=" " THEN NEXT 470 MOVE 110+120*N,200:PRINT K$:NEXT 480 ENDPROC 490 : 500 DEFPROCtitles:VDU4 510 VDU 28,1,12,17,2:COLOUR 129:CLS 520 PRINT'" f0 - BELL" 530 PRINT'" f1 - PIANO" 540 PRINT'" f2 - ORGAN" 550 PRINT'" f3 - WOODWIND" 560 PRINT'" f4 - ELECTRONIC" 570 VDU 28,1,17,19,16:COLOUR 128 580 PRINT"INSTRUMENT PLAYING" 590 VDU 28,5,20,15,19:PRINT" BELL" 600 ENDPROC 610 : 620 DATA 52,56,60,64,68,72,76,80,84,88 ,92,96,100,104,108,112,116 630 DATA 98,82,67,51,83,100,84,101,85, 86,70,102,103,87,104,88,105 640 DATA 33,114,115,116,21 650 DATA "Z","X","C","V","B","N","M"," ,",".","/" 660 DATA 1,1,0,1,1,1,0,1,1 670 DATA "S","D"," ","G","H","J"," "," L",";"