home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Set of Apple II Hard Drive Images
/
eric.hdv
/
SEQ:CLASSICAL:BACH
/
MAKE.MIDI.FILE.bas
< prev
next >
Wrap
BASIC Source File
|
2020-08-13
|
4KB
|
116 lines
5 TE$ = "BACHIN14.MID"
10 H$ = "MThd":H1$ = "MTrk"
11 FM = 1
12 NT = 3
13 DV = 240
25 T$ = "BACH INV 14"
30 C$ = "(C)???"
40 MM = 72
50 TP = INT(62914560/MM)
60 NN = 4:DD = 2
70 CC = 24
75 BB = 8
80 SF = -2
90 MI = 0
91 I$(1) = "GUITAR"
92 I$(2) = "BASS"
93 I$(3) = "DRUMS"
100 HOME : PRINT "MIDI FILE PARAMETERS:"
104 PRINT
105 PRINT "FILE TO CREATE = "TE$
107 PRINT
110 PRINT "FORMAT "FM" "NT" TRACKS"
120 PRINT
140 PRINT "TITLE="T$
150 PRINT "COPYRIGHT="C$
152 PRINT
160 PRINT "TEMPO = "TP" ("MM" QN PER MIN)"
165 PRINT DV" DELTA TIME = QN"
170 PRINT
180 PRINT "TIME SIG = "NN"/"2 ^DD
185 PRINT
205 IF MI = 0 THEN PRINT "MAJOR";
206 IF MI = 1 THEN PRINT "MINOR";
207 PRINT " ";
210 PRINT "KEY SIG = " ABS(SF)" ";
220 IF SF > = 0 THEN PRINT "SHARPS"
230 IF SF <0 THEN PRINT "FLATS"
235 PRINT
240 PRINT CC" CLOCKS PER METRONOME TICK"
250 PRINT BB" 32ND NOTES PER QTR NOTE"
270 PRINT : PRINT
300 INPUT "PRESS RETURN TO USE THESE PARAMETERS:";RT$
310 PRINT "GENERATING HEADER..."
320 PRINT
1000 BAS = 8192
1005 FOR I = 1 TO 4: POKE BAS +I -1, ASC( MID$ (H$,I,1)): NEXT
1007 BAS = BAS +4
1008 POKE BAS,0: POKE BAS +1,0: POKE BAS +2,0: POKE BAS +3,6
1009 BAS = BAS +4
1010 POKE BAS, INT(FM/256): POKE BAS +1,FM - INT(FM/256) *256
1012 BAS = BAS +2
1014 POKE BAS, INT(NT/256): POKE BAS +1,NT - INT(NT/256) *256
1016 BAS = BAS +2
1018 POKE BAS, INT(DV/256): POKE BAS +1,DV - INT(DV/256) *256
1019 BAS = BAS +2
1020 FOR I = 1 TO 4: POKE BAS +I -1, ASC( MID$ (H1$,I,1)): NEXT
1022 BAS = BAS +4: POKE BAS,0: POKE BAS +1,0: POKE BAS +2,0: POKE BAS +3,0:LL = BAS +2:BAS = BAS +4
1023 POKE BAS,0:BAS = BAS +1
1025 POKE BAS,255: POKE BAS +1,3: POKE BAS +2, LEN(T$)
1027 BAS = BAS +3
1030 FOR I = 1 TO LEN(T$): POKE BAS +I -1, ASC( MID$ (T$,I,1)): NEXT
1032 BAS = BAS + LEN(T$)
1035 POKE BAS,0:BAS = BAS +1
1037 POKE BAS,255: POKE BAS +1,2: POKE BAS +2, LEN(C$)
1038 BAS = BAS +3
1040 FOR I = 1 TO LEN(C$): POKE BAS +I -1, ASC( MID$ (C$,I,1)): NEXT
1042 BAS = BAS + LEN(C$)
1050 POKE BAS,0:BAS = BAS +1
1055 POKE BAS,255: POKE BAS +1,5 *16 +1: POKE BAS +2,3:BAS = BAS +3
1057 POKE BAS, INT(TP/65536):BAS = BAS +1
1058 TP = TP - PEEK(BAS -1) *65536
1059 POKE BAS, INT(TP/256):BAS = BAS +1
1060 TP = TP - PEEK(BAS -1) *256
1061 POKE BAS,TP:BAS = BAS +1
1070 POKE BAS,0:BAS = BAS +1
1075 POKE BAS,255: POKE BAS +1,5 *16 +8: POKE BAS +2,4: POKE BAS +3,NN: POKE BAS +4,DD: POKE BAS +5,CC: POKE BAS +6,BB:BAS = BAS +7
1080 POKE BAS,0:BAS = BAS +1
1084 IF SF <0 THEN SF = 256 +SF
1085 POKE BAS,255: POKE BAS +1,5 *16 +9: POKE BAS +2,2: POKE BAS +3,SF: POKE BAS +4,MI:BAS = BAS +5
1089 POKE BAS,0: POKE BAS +1,255: POKE BAS +2,2 *16 +15: POKE BAS +3,0:BAS = BAS +4
1092 L0 = BAS -LL -2: POKE LL, INT(L0/256): POKE LL +1,L0 - INT(L0/256) *256
1100 PRINT CHR$(4)"BSAVE "TE$",A$2000,E"BAS -1
1200 BY = BAS -8192
1300 BAS = 8192
2000 FOR TK = 2 TO NT
2010 PRINT "TRACK "TK" ";: INPUT "FILE TO LOAD:";F$
2020 PRINT CHR$(4)"VERIFY "F$
2030 IF LEN(F$) < >15 THEN F$ = F$ + MID$ (" ",1,15 - LEN(F$))
2050 PRINT CHR$(4)"PREFIX": INPUT PF$
2060 PRINT CHR$(4)"OPEN"PF$",TDIR": PRINT CHR$(4)"READ"PF$
2065 INPUT LI$
2070 IF F$ < > MID$ (LI$,2,15) THEN 2065
2075 PRINT CHR$(4)"CLOSE"
2080 LN = VAL( MID$ (LI$,66,6))
2082 REM ?"LENGTH="LN
2100 FOR I = 1 TO 4: POKE BAS +I -1, ASC( MID$ (H1$,I,1)): NEXT
2102 BAS = BAS +4
2105 POKE BAS,0:BAS = BAS +1
2110 PRINT CHR$(4)"BLOAD "F$",A$2008"
2111 REM GET RID OF SPEED IF STORED IN FILE
2112 IF PEEK(8192 +8) = 0 AND PEEK(8192 +9) > = 144 AND PEEK(8192 +9) <160 AND PEEK(8192 +10) = 0 THEN POKE 8192 +11,0
2115 REM RECALCULATE LENGTH BASED ON ACTUAL END OF TRACK EVENT
2120 LP = 8192 +8 +LN -1
2130 IF PEEK(LP) < >47 THEN LP = LP -1: GOTO 2130
2140 LN = LP -8192 -6
2207 L1 = LN
2210 POKE BAS, INT(L1/65536):BAS = BAS +1
2220 L1 = L1 - PEEK(BAS -1) *65536
2230 POKE BAS, INT(L1/256):BAS = BAS +1
2240 L1 = L1 - PEEK(BAS -1) *256
2250 POKE BAS,L1:BAS = BAS +1
2300 PRINT CHR$(4)"BSAVE "TE$",A$2000,L"LN +8",B"BY
2400 BY = BY +LN +8
2500 BAS = 8192
2600 NEXT TK
2999 END