10 'fm(opm) sound test
20 DEFINT A-Z:CH=0:OCT=3:LR=3:KC=&HC:KF=0 'o4c
30 READ AL,FB,WF,SY,SPD,PMD,AMD,PMS,AMS
40 REG=&H18:DAT=SPD:GOSUB 460
50 REG=&H19:DAT=&H80+PMD:GOSUB 460
60 REG=&H19:DAT=AMD:GOSUB 460
70 REG=&H1B:DAT=WF:GOSUB 460
80 REG=&H20+CH:DAT=LR*64+FB*8+AL:GOSUB 460
90 REG=&H38+CH:DAT=PMS*16+AMS:GOSUB 460
100 OP=0:GOSUB 370:OP=2:GOSUB 370:OP=1:GOSUB 370:OP=3:GOSUB 370
110 '
120 REG=&H28+CH:DAT=OCT*16+KC:GOSUB 460
130 REG=&H30+CH:DAT=KF*4:GOSUB 460
140 REG=&H8:DAT=&H78+CH:GOSUB 460
150 PRINT"PUSH SPACE TO KEYOFF"
160 IF INP(9)<>191 THEN 160
170 REG=&H8:DAT=CH:GOSUB 460
180 END
370 'write fm parameter to (op)
380 READ AR,DR,SR,RR,SL,TL,KS,ML,DT1,DT2,AME
390 REG=&H40+CH+OP*8:DAT=DT1*16+ML:GOSUB 460
400 REG=&H60+CH+OP*8:DAT=TL:GOSUB 460
410 REG=&H80+CH+OP*8:DAT=KS*64+AR:GOSUB 460
420 REG=&HA0+CH+OP*8:DAT=AME*128+DR:GOSUB 460
430 REG=&HC0+CH+OP*8:DAT=DT2*64+SR:GOSUB 460
440 REG=&HE0+CH+OP*8:DAT=SL*16+RR:GOSUB 460
450 RETURN
460 'write fm register
470 OUT &HC8,REG
480 OUT &HC9,DAT
490 RETURN
500 ' AL FB WF SY SPD PMD AMD PMS AMS
510 DATA 2, 7, 2, 1,220, 0, 4, 1, 1
520 ' AR DR SR RR SL TL KS ML DT1 DT2 AME
530 DATA 31, 5, 7, 4, 9,37, 1, 1, 5, 0, 0
540 DATA 22, 0, 4, 5, 4,62, 1, 5, 2, 0, 0
550 DATA 29, 0, 4, 5, 4,77, 1, 1, 7, 0, 0
560 DATA 31, 7, 6, 5, 4, 0, 2, 1, 1, 0, 1
|