home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Set of Apple II Hard Drive Images
/
eric.hdv
/
BSMW
/
FILE.READER.BAK.bas
< prev
next >
Wrap
BASIC Source File
|
2020-08-13
|
4KB
|
96 lines
1 DIM BIT(8)
2 NO$ = "CBAGFEDCBAGFEDCBAGFEDCBAGFEDC"
3 DIM SQ(6),BS(6):: FOR I = 1 TO 6:BS(I) = 24576 +256 *(I -1):SQ(I) = BS(I): NEXT
4 FOR I = 1 TO 6: POKE SQ(I),128: POKE SQ(I) +1,0:SQ(I) = SQ(I) +2: NEXT
5 DIM L(30),K(30),A(30): REM TABLES TO TRANSLATE LINE NUMBERS TO MIDI NOTE NUMBERS
6 FOR L = 1 TO 29: READ L(L):K(L) = L(L):A(L) = L(L): NEXT
7 FOR S = 1 TO 7: READ S(S): NEXT
8 FOR F = 1 TO 7: READ F(F): NEXT
9 DIM PT(6),PN(6),TT(6)
10 BUF = 8192
100 FOR I = 0 TO 18
150 PRINT "POSN "I
200 FOR P = 1 TO 6
250 PRINT P":";
300 STS = PEEK(BUF +(P -1) *38 +I)
400 DTA = PEEK(BUF +(P -1) *38 +I +19)
450 IF STS = 0 AND DTA = 0 THEN 700
500 IF STS = 0 OR DTA = 160 THEN GOSUB 10000: GOTO 700
505 IF STS = 9 THEN PRINT "PIANO";: GOTO 550
506 IF STS = 11 THEN PRINT "FORTE";: GOTO 550
510 NUM = STS: GOSUB 1000: REM CONVERT NUMBER TO BIT ARRAY
514 DS = STS - INT(STS/8) *8
515 DU = 7.5 *2 ^DS
520 IF BIT(7) THEN PRINT "TRIPLET ";:DU = DU *2/3
521 TY = 0: IF BIT(6) THEN PRINT "TIED ";:TY = 1
522 IF BIT(5) THEN PRINT "DOTTED ";:DU = DU *3/2
523 PRINT MID$ ("????????32ND16TH8TH QTR HALFWHOL",(STS - INT(STS/8) *8) *4 +1,4);
524 PRINT " DUR="DU" ";:TT(P) = TT(P) +DU
525 L = DTA - INT(DTA/32) *32
526 IF BIT(4) THEN PRINT "NOTE ";:RE = 0
527 IF NOT BIT(4) THEN PRINT "REST ";:RE = 1
528 IF BIT(3) THEN PRINT "STEM UP ";
529 IF NOT BIT(3) THEN PRINT "STEM DOWN ";
530 NUM = DTA: GOSUB 1000
531 OU = 0: IF BIT(7) THEN PRINT "OCTAVE UP ";:OU = 1
532 IF NOT BIT(6) AND BIT(5) THEN PRINT "NATURAL ";:A(L) = L(L)
533 IF BIT(6) AND NOT BIT(5) THEN PRINT "FLAT ";:A(L) = L(L) -1
534 IF BIT(6) AND BIT(5) THEN PRINT "SHARP ";:A(L) = L(L) +1
535 MN = NOT (RE) *(A(L) +12 *OU)
540 PRINT "LINE #"L;" MIDI NOTE:"MN" ";
545 PRINT " "; MID$ (NO$,L,1);
550 REM
600 IF PT(P) AND PN(P) = MN THEN POKE SQ(P),0: POKE SQ(P) +1,0: POKE SQ(P) +2, INT(DU/128) +128: POKE SQ(P) +3,DU - INT(DU/128) *128:SQ(P) = SQ(P) +4: GOTO 670
610 POKE SQ(P),PN(P): POKE SQ(P) +1,0
620 POKE SQ(P) +2,128: POKE SQ(P) +3,0
630 POKE SQ(P) +4,MN: POKE SQ(P) +5,64
640 POKE SQ(P) +6, INT(DU/128) +128: POKE SQ(P) +7,DU - INT(DU/128) *128
650 SQ(P) = SQ(P) +8
660 PN(P) = MN
670 PT(P) = 0: IF TY THEN PT(P) = 1
700 PRINT : NEXT : PRINT : NEXT
710 GOSUB 10100: GOSUB 10050
800 FOR Q = 1 TO 6: PRINT CHR$(4)"BSAVE /RAMAEPC/T"Q -1",A"BS(Q)",E"SQ(Q) -1",B"BY(Q)
810 NEXT Q
850 FOR Q = 1 TO 6:BY(Q) = BY(Q) +SQ(Q) -BS(Q): NEXT
860 FOR Q = 1 TO 6:SQ(Q) = BS(Q): NEXT
870 IF PEEK(BUF +254) < >0 OR PEEK(BUF +255) < >0 THEN BUF = BUF +256: GOTO 100
999 END
1000 FOR BT = 7 TO 0 STEP -1
1005 BIT(BT) = 0
1010 IF NUM > = 2 ^BT THEN BIT(BT) = 1:NUM = NUM -2 ^BT
1020 NEXT
1030 RETURN
10000 IF DTA = 0 THEN PRINT "-";
10005 IF DTA < >160 THEN 10020
10007 CT = STS - INT(STS/8) *8
10008 FOR Q = 1 TO 30:K(Q) = L(Q): NEXT
10010 IF DTA = 160 THEN PRINT "KEY CHANGE: ";:NUM = STS: GOSUB 1000: PRINT STS - INT(STS/8) *8;" ";: PRINT MID$ ("SHFL",BIT(3) *2 +1,2);
10012 IF BIT(3) = 0 THEN FOR Q0 = CT TO 1 STEP -1: FOR Q = S(Q0) TO 30 STEP 7:K(Q) = L(Q) +1: NEXT : NEXT
10014 IF BIT(3) = 1 THEN FOR Q0 = CT TO 1 STEP -1: FOR Q = F(Q0) TO 30 STEP 7:K(Q) = L(Q) -1: NEXT : NEXT
10020 IF DTA = 128 THEN PRINT "BAR ";
10025 FOR Q = 1 TO 30:A(Q) = K(Q): NEXT
10030 IF DTA = 192 THEN PRINT "LRPT ";
10035 IF DTA = 224 THEN PRINT "RRPT ";
10040 IF DTA = 136 THEN PRINT "1ST END ";
10045 IF DTA = 232 THEN PRINT "2ND END ";
10049 RETURN
10050 FOR Q = 1 TO 6: IF DF(Q) = 0 THEN 10090
10060 DW = ( PEEK(SQ(Q) -2) -128) *128 + PEEK(SQ(Q) -1)
10070 DW = DF(Q)
10080 POKE SQ(Q),0: POKE SQ(Q) +1,0:SQ(Q) = SQ(Q) +2
10085 POKE SQ(Q), INT(DW/128) +128: POKE SQ(Q) +1,DW - INT(DW/128) *128:SQ(Q) = SQ(Q) +2
10090 NEXT Q
10099 RETURN
10100 MX = 0: FOR Q = 1 TO 6: IF TT(Q) >MX THEN MX = TT(Q)
10110 NEXT Q
10120 FOR Q = 1 TO 6: IF TT(Q) <MX THEN DF(Q) = MX -TT(Q)
10130 NEXT Q
10140 RETURN
20000 DATA 84,83,81,79,77,76,74
20010 DATA 72,71,69,67,65,64,62
20020 DATA 60,59,57,55,53,52,50
20030 DATA 48,47,45,43,41,40,38
20040 DATA 36
20050 DATA 5,1,4,7,3,6,2
20055 DATA 2,6,3,7,4,1,5