&dA &dA &dA &d@ Program to Create a Set of Midi files for shipping &dA &dA #define LIC_ADD1 46 #define LIC_ADD0 82 str music.1000000,file.100,line.100,outfile.100,outdisk.100 str inlib1.100,inlib2.100,infile.100,line2.100,curlicense.7 str licen.7,temp.100 str sourcelib.100,sublibs.100(50) int i,j,k,size int a,b,c,d,e int format,subcnt,copies int listx(500),listcnt,nout,list_size table L(5000) putc Program to create a set of MIDI files for shipping putc putc It is assumed that you are running this program from the library putc &dA/RELEASE/MIDI-OUT/PROGS&d@. The program will fail at some point in putc the process if this is not true. putc putc Listed below is a list of the disks that have been prepared for putc release. Please type the number of the disk you want to prepare putc for shipment. putc open [1,1] "C:/RELEASE/MIDI-OUT/PROGS/LIST" loop for i = 1 to 5000 getf [1] line if line{1} <> " " ++listcnt listx(listcnt) = i putc .t4 ~line end tput [L,i] ~line repeat eof1: list_size = i - 1 close [1] open [1,1] "C:/RELEASE/MIDI-OUT/PROGS/LICENSE" getf [1] curlicense close [1] Q1: putc putc Number? getc k if k < 1 or k > listcnt goto Q1 end Q2: putc putc You may create multiple output copies at one time. How many would putc you like to create in this session? getc nout if nout < 1 goto Q2 end if nout > 99 putc Sorry! 99 is the maximum. goto Q2 end putc putc Output copies will be stored in the library &dA/RELEASE/MIDI-OUT/TEMP&d@ putc putc &dAYou should make certain that this library is currently empty before putc &dAproceeding further putc putc Type to continue getc a = listx(k) tget [L,a+2] sourcelib sourcelib = trm(sourcelib{2..}) tget [L,a+1] .t2 copies loop for i = 1 to nout j = int(curlicense{2..}) ++j temp = chs(j) curlicense{2..7} = "000000"{1,6-len(temp)} // temp ++copies if i < 10 outdisk = "0" // chs(i) else outdisk = chs(i) end outdisk = "C:/RELEASE/MIDI-OUT/TEMP/D" // outdisk putc Making output copy to ~outdisk createdir outdisk inlib1 = "C:/RELEASE/MIDI-OUT/" // sourcelib // "/DATA" open [2,1] inlib1 loop getf [2] line if line con "MID" and mpt = 10 infile = trm(line{1,8}) // ".MID" outfile = outdisk // "/" // infile infile = inlib1 // "/" // infile perform add_license end repeat eof2: close [2] tget [L,a+3] line subcnt = int(line{3..}) if subcnt > 0 loop for j = 1 to subcnt tget [L,a+j+3] line2 line2 = trm(line2{3..}) inlib2 = inlib1 // "/" // line2 open [3,1] inlib2 b = 0 loop getf [3] line if line con "MID" and mpt = 10 if b = 0 b = 1 temp = outdisk // "/" // line2 createdir temp end infile = trm(line{1,8}) // ".MID" outfile = outdisk // "/" // line2 // "/" // infile infile = inlib2 // "/" // infile perform add_license end repeat eof3: close [3] repeat end &dA &dA &d@ Transfer OTHER material &dA inlib1 = "C:/RELEASE/MIDI-OUT/" // sourcelib // "/OTHER" open [4,1] inlib1 subcnt = 0 loop getf [4] line line = line // pad(20) if line con "" and mpt = 14 ++subcnt sublibs(subcnt) = trm(line{1,8}) else if line{1} <> " " infile = trm(line{1,8}) if line{10} <> " " infile = infile // "." // trm(line{10,3}) end outfile = outdisk // "/" // infile infile = inlib1 // "/" // infile perform transfer end end repeat eof4: close [4] if subcnt > 0 loop for j = 1 to subcnt line2 = sublibs(subcnt) inlib2 = inlib1 // "/" // line2 temp = outdisk // "/" // line2 createdir temp open [5,1] inlib2 loop getf [5] line line = line // pad(40) if line{1} <> " " infile = trm(line{1,8}) if line{10} <> " " infile = infile // "." // trm(line{10,3}) end outfile = outdisk // "/" // line2 // "/" // infile infile = inlib2 // "/" // infile perform transfer end repeat eof5: close [5] repeat end repeat open [1,2] "C:/RELEASE/MIDI-OUT/PROGS/LICENSE" putf [1] ~curlicense close [1] tput [L,a+1] .t2 ~copies copies released open [1,2] "C:/RELEASE/MIDI-OUT/PROGS/LIST" loop for i = 1 to list_size tget [L,i] line line = trm(line) putf [1] ~line repeat close [1] stop &dA &dA &d@ &dA P R O C E D U R E S &dA procedure add_license int i open [6,5] infile size = sze len(music) = sze read [6,1] music close [6] &dA &dA &d@ Determine whether MIDI0 or MIDI1 &dA format = ors(music{10}) &dA &dA &d@ Find location of license number &dA if format = 0 i = ors(music{LIC_ADD0}) else i = ors(music{LIC_ADD1}) end music{i,7} = curlicense open [7,6] outfile write [7] music close [7] return procedure transfer open [6,5] infile size = sze len(music) = sze read [6,1] music close [6] open [7,6] outfile write [7] music close [7] return &dA &dA &d@ &dA P R O C E D U R E S &dA run