具有按键指示功能的颤音演奏程序
N=39:A=15:B=.2617992#
DIM F(N,24),L(N),O(36),Q(N)
SCREEN 0,1:WIDTH 40:COLOR 15,1,1:CLS
COLOR 15,0
FOR I=0 TO 15:FOR J=0 TO 8
LOCATE 5+J,5+I*2:PRINT CHR$(219);CHR$(221);
NEXT:NEXT
FOR I=0 TO 12:FOR J=0 TO 4
IF I=2 OR I=6 OR I=9 OR I=13 THEN GOTO QQ
LOCATE 5+J,8+I*2:PRINT CHR$(32);CHR$(222);
QQ:NEXT:NEXT
FOR J=0 TO 9
LOCATE 4+J,4:COLOR 4,0:PRINT CHR$(221);
LOCATE 4+J,36:COLOR 15,0:PRINT CHR$(221);
COLOR 4,1:PRINT CHR$(221);NEXT
COLOR 4,1:LOCATE 4,4
FOR I=0 TO 32:PRINT CHR$(219);:NEXT
PRINT CHR$(221);:LOCATE 13,4
FOR I=0 TO 32:PRINT CHR$(219);:NEXT
PRINT CHR$(221);:COLOR 0,7
O(0)=100:O(11)=5:O(12)=7:O(13)=8:O(14)
=9
O(15)=10:O(16)=11:O(17)=13:O(18)=14
O(19)=15:O(20)=16:O(21)=17:O(22)=18
O(23)=19:O(24)=21:O(25)=22:O(26)=23
O(27)=24:O(28)=25:O(29)=27:O(30)=28
O(31)=29:O(32)=30:O(33)=31:O(34)=32
O(35)=33:O(36)=35
FOR I=1 TO N:READ J,L(I):Q(I)=O(J)
F(I,0)=36.8*(2^((J+22)/12))
FOR K=1 TO 24:F(I,K)=F(I,0)+A*SIN(B*K)
NEXT:NEXT
FOR I=1 TO N
IF Q(I)=100 THEN SOUND 32767,L(I):GOTO JJ
IF Q(I)=0 THEN Q(I)=1:GOTO PP
IF SCREEN(5,Q(I))<>32THEN COLOR 0,7
LOCATE 11,Q(I):PRINT CHR$(14);
COLOR 15,0:GOTO PP
COLOR 15,0:LOCATE 7,Q(I):PRINT CHR$(14):
COLOR 0,7
PP:SOUND F(I,0),.2*L(I)
FOR P=1 TO L(I).8/3.6
FOR J=1 TO 24;SOUND F(I,J),.15
NEXT:NEXT
SOUND 32767,1.5
IF SCREEN(5,Q(I))=32 THEN COLOR 15,0
LOCATE 7,Q(I):PRINT CHR$(32);:GOTO JJ
COLOR 15,0:LOCATE 11,Q(I):PRINT CHR$(219);
JJ:NEXT
KK:IF INKEY$<>""THEN GOTO KK
END
DATA 9,4.5,12,4.5,16,4.5,12,4.5,14,9,12,4.5
DATA 11,4.5,16,9,14,9,9,18,12,4.5,16,4.5
DATA 19,4.5,19,4.5,21,9,19,4.5,17,4.5,16,18
DATA 18,9,20,9,23,4.5,21,4.5,16,9,0,4.5,11,9
DATA 9,4.5,16,4.5,14,4.5,17,9,17,4.5,0,4.5
DATA 19,4.5,17,4.5,16,9,14,4.5,12,4.5,16,9
DATA 14,9,9,18