&dA
&dA
&dA &d@ Program to compile a set of midi files
&dA &d@ 3-09-95
&dA
str line.80,temp1.80,outlib.80,inlib.80,temp1a.80
str temp2.80,temp3.80,temp4.80,temp5.80
str revtemp.80,temp11a.80
int cnt
putc Output library (must exist)
getc outlib
getc inlib
open [1,1] inlib
*xamine
loop for cnt = 1 to 10
getf [1] temp1
if temp1{1} = " "
goto E1
end
temp1 = temp1 // pad(18)
if temp1{14,5} = "
"
temp1a = temp1{1,8}
temp1a = trm(temp1a)
temp1 = inlib // "/" // temp1{1,8}
temp1 = trm(temp1)
open [2,1] temp1
loop
getf [2] temp2
putc ~temp2
if temp2{1} = " "
goto E2
end
temp2 = temp2 // pad(18)
if temp2{14,5} = "" and temp2{1,7} = "DISTRIB"
temp2 = temp1 // "/" // temp2{1,8}
temp2 = trm(temp2)
putc X ~temp2
open [3,1] temp2
loop
getf [3] temp3
if temp3{1} = " "
goto E3
end
temp3 = temp3 // pad(18)
if temp3{14,5} = "" and temp3{1,5} = "MIDIP"
temp3 = temp2 // "/" // temp3{1,8}
temp3 = trm(temp3)
open [4,1] temp3
loop
getf [4] temp4
if temp4{1} = " "
goto E4
end
temp4 = temp4 // pad(18)
temp4 = temp4{1,8}
temp4 = trm(temp4)
temp11a = temp1a // "-" // temp4 // ".mid"
temp4 = temp3 // "/" // temp4
temp4 = trm(temp4)
temp4 = temp4 // ".mid"
perform filetrans
repeat
E4:
close [4]
end
repeat
E3:
close [3]
end
repeat
E2:
close [2]
end
repeat
E1:
putc Done!
procedure filetrans
str big.1000000
int i,j
str xxx.100
&dA
&dA &d@ Actual transfer
&dA &d@
xxx = outlib // "/" // temp11a
putc ~temp4 ~xxx
open [7,5] temp4
len(big) = sze
read [7,1] big
close [7]
open [8,6] xxx
write [8] big
close [8]
return
run