&dA &dA &dA &d@ Program to read a page-specific score file and produce &dA &d@ output for Leland Smith's SCORE program. &dA &dA &d@ rev 1.1 (3-16-93) &dA &dA &d@ Plan &dA &d@ ÄÄÄÄ &dA &d@ Leland organizes his data from the bottom of the page up. &dA &d@ We will have to read our page-specific file and setup a set of &dA &d@ pointers to various levels of data, so that when it comes time &dA &d@ to generate SCORE code, we can proceed in an orderly fashion. &dA &dA &d@ 1. The page-specific system gives data from the top down, &dA &d@ whereas Leland's system gives it from the bottom up. &dA &d@ Because it is easier to put out data in any order after &dA &d@ it has been constructed than it is to read data out of &dA &d@ order, our methed will be to determine what the output &dA &d@ for a score file should look like and then to arrange &dA &d@ an "ordering" parameter for putting out the lines. We &dA &d@ can then collect data in an orderly fashion from the page &dA &d@ specific files. &dA &d@ &dA &d@ 2. We will not use the stage2 files in this program. The reason &dA &d@ is that Leland's representation for pitch and duration is much &dA &d@ closer to the page-specific representation that the stage2 &dA &d@ representation. Specifically, Leland represents pitch in a &dA &d@ key sentive environment. &dA &dA &d@ 3. There are five passes to Leland's data entry system. They &dA &d@ are in order, pitch, duration, marks, beams, and slurs. &dA &d@ I describe below the process that is necessary to get this &dA &d@ information from the page-specific file. &dA &d@ &dA &d@ a) &dEPitch &dA &d@ &dA &d@ The page-specific system does not represent pitch directly; &dA &d@ One must infer this from the vertical position of the note &dA &d@ object on the staff lines. The current represenation uses &dA &d@ an interval of 14 dots between staff lines. The top staff &dA &d@ line is given the value 0 and the one below it 14. Clefs &dA &d@ are indicated by a "C" type object. The type of clef and &dA &d@ its position on the staff is given by the third parameter. &dA &d@ For the moment, clef changes (as well as all notes) occur &dA &d@ &dEin order in the file&d@. This being the case, we can infer &dA &d@ that the order of notes and the clefs that control them is &dA &d@ sequencial in the file. In fact, a more rigorous approach &dA &d@ (not needed now, but perhaps in the future) is to use the &dA &d@ x-coordinate of the object to determine order on the line. &dA &dA &d@ If a note has any sharps or flats, they will be contained &dA &d@ in the note's subobjects, which follow immediately the object. &dA &dA &d@ b) &dEDuration&d@ &dA &d@ &dA &d@ The page-specific system does not represent duration &dA &d@ directly. One must infer this from three things: the type &dA &d@ of note (field 3 of the object), any dots which might &dA &d@ follow the note (in the list of subobjects), and any grouping &dA &d@ information such as a triplet number, which might be attached &dA &d@ to the note. Grouping information is provided by the "X" &dA &d@ type super-object, with the tuple number being in field 5. &dA &dA &d@ c) &dEMarks&d@ &dA &dA &d@ At the moment, the program does not deal with marks. They are &dA &d@ for the most part attached to notes, and can therefore be found &dA &d@ in the list of subobjects following the note object. &dA &dA &d@ d) &dEBeams&d@ &dA &dA &d@ Beaming information for notes is provided by the "B" type super- &dA &d@ object. The procedure for reading super-objects is essentially the &dA &d@ same, whether we are trying to find beaming information, tie or &dA &d@ slur information, or tuplet information. The object record does &dA &d@ not specify the type of superobjects connected with it, only the &dA &d@ super-object number. The program must seek out each superobject &dA &d@ and check to see if it is relevant to the information being &dA &d@ gathered for the note. For ties, beams, and slurs, I suggest &dA &d@ that an array system be set up to collect this information, while &dA &d@ the program is determining pitch and duration. This way, when &dA &d@ the reading of the line is complete, the information for passes &dA &d@ 4 and 5 will already have been collected. &dA &dA &d@ One wrinkle to deal with is ties and slurs that either start or &dA &d@ end at at system boundary. In these cases, one of the end points &dA &d@ will be an "M" type object (rather than a note). &dA &dA &d@ e) &dESlurs&d@ &dA &dA &d@ See beams above. &dA table Y(10000),Z(100000) str temp.100,rec.1000,temp2.100,temp3.100 str rec1.100,rec2.100 str sclib.100,scfile.100 str pglib.100,pgfile.100 str pass.1000(5) label TYPE(11) label JTYPE(12) int i,j,k,n,h int a,b,c,d int qq int pagenum,pfz int sys_number,line_number,sys_count int lines_per_system(16) int scorelinepnt(400,17) int ypnt,zpnt int notenum str jtype.1,htype.1,rtype.1 str longest_dur.10(10) int hnum,dots int jcode,jhorz,jvert,jpcode,jscnt,s(8) int middle_c,wflag int tupleflag,tuplenum int superdata(40,3),supercnt int score_cnt real x1,x2,x3 &dA &dA &d@ I. Get page specific library &dA putc Library for page-specific files getc pglib pglib = trm(pglib) getdir temp pglib = temp // "\" // pglib open [1,1] pglib putc Library for SCORE output files getc sclib sclib = trm(sclib) getdir temp sclib = temp // "\" // sclib temp2 = rev(sclib) loop for i = 1 to 20 if temp2{i} in ['\','/'] temp3 = temp2{1,i-1} temp2 = temp2{i+1..} i = 20 end repeat temp2 = rev(temp2) temp3 = rev(temp3) open [2,1] temp2 loop getf [2] temp2 temp2 = temp2{1,8} temp2 = trm(temp2) if temp2 = temp3 goto G2 end if temp2 = "" createdir sclib goto G2 end repeat G2: close [2] &dA &dA &d@ II. Big loop &dA loop for i = 1 to 400 loop for j = 1 to 17 scorelinepnt(i,j) = 0 repeat repeat tupleflag = 0 treset [Z] zpnt = 1 sys_count = 0 loop for pagenum = 1 to 100 getf [1] pgfile pgfile = pgfile // pad(5) pgfile = pgfile{1,5} pgfile = trm(pgfile) if pgfile = "" goto WRITE end pgfile = pglib // "\" // pgfile open [3,1] pgfile treset [Y] &dA &dA &d@ 1. get page specific data &dA sys_number = 0 loop for k = 1 to 10000 getf [3] rec if rec{1} = "S" ++sys_number mpt = 0 loop for j = 1 to 7 temp = txt(rec,[' ']) repeat lines_per_system(sys_number) = int(temp) end tput [Y,k] ~rec repeat eof3: close [3] tput [Y,k] Z (End of Data) pfz = k ypnt = 1 putc putc PAGE ~pagenum putc ÄÄÄÄÄÄÄÄÄÄÄÄÄ putc ~sys_number systems on this page loop for i = 1 to sys_number putc lines for system ~i = ~lines_per_system(i) repeat putc &dA &dA &d@ 2. Get data from page-specific file &dA &dA &d@ The trick here is to get data in the order it appears &dA &d@ in the all the page-specific files and then later &dA &d@ write the data to score &dA sys_number = 0 GL1: line_number = 0 GL2: loop for k = 1 to 5 pass(k) = "" repeat notenum = 0 loop for i = 1 to 40 superdata(i,1) = 0 superdata(i,2) = 0 superdata(i,3) = 0 repeat supercnt = 0 GL3: tget [Y,ypnt] rec ++ypnt rec = rec // pad(80) &dA &dA &d@ Types of records &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ 1 S = Systems &dA &d@ 2 L = Music Lines (page specific) &dA &d@ 3 J = Objects &dA &d@ 4 K = Sub-objects &dA &d@ 5 T = Text (form of sub-object) &dA &d@ 6 W = Words (form of sub-object) &dA &d@ 7 H = Super-objects &dA &d@ 8 B = System Bar &dA &d@ 9 E = End of Music Line &dA &d@ 10 X = Page Text &dA &d@ 11 Z = (end of file) &dA if "SLJKTWHBEXZ" con rec{1} goto TYPE(mpt) end &dA &dA &d@ 1. System record (S) &dA TYPE(1): ++sys_number ++sys_count scorelinepnt(sys_count,1) = lines_per_system(sys_number) goto GL1 &dA &dA &d@ 2. Music line record (L) &dA TYPE(2): ++line_number goto GL2 &dA &dA &d@ 3. Object (J) &dA &dA &d@ Field 2: type of object 1 B = bar line &dA &d@ 2 C = clef &dA &d@ 3 K = key signature &dA &d@ 4 T = time signature &dA &d@ 5 D = directive (e.g. time word, etc) &dA &d@ 6 S = other symbol &dA &d@ 7 N = note &dA &d@ 8 R = rest &dA &d@ 9 G = grace note &dA &d@ 10 Q = cue note &dA &d@ 11 F = figures &dA &d@ 12 M = mark (mostly for superobjects) &dA TYPE(3): tget [Y,ypnt-1] .t3 jtype jcode jhorz jvert jpcode qq a jscnt s(1) s(2) s(3) s(4) s(5) s(6) s(7) s(8) &dA &dA &d@ make sure s(.) is in increasing order &dA if jscnt > 1 loop for i = 1 to jscnt - 1 loop for j = 2 to jscnt if s(i) > s(j) k = s(i) s(i) = s(j) s(j) = k end repeat repeat end if "BCKTDSNRGQFM" con jtype goto JTYPE(mpt) end &dA &dA &d@ 1. Object type = bar line &dA &dA &d@ Bar line code Score Equivalent &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ 1 = single light bar M &dA &d@ 2 = single heave bar (use M) &dA &d@ 3 = dotted bar MS &dA &d@ 5 = double light bar MD &dA &d@ 6 = light-heavy double bar ML with :|, else MH &dA &d@ 9 = heavy-light double bar MR with |:, else MD &dA &d@ 10 = heavy-heavy double bar MDR with :|:, else MD &dA JTYPE(1): if line_number = lines_per_system(sys_number) if jpcode < 32 if jvert < 6 testfor jvert < 3 temp = "/M" else (=) temp = "/MS" else (>) temp = "/MD" end else h = 0 k = 0 loop for i = 1 to jpcode tget [Y,ypnt] .t3 a b c ++ypnt if c = 44 if a < 0 h = 1 else k = 1 end end repeat testfor jvert < 9 if h = 1 temp = "/ML" else temp = "/MH" end else (=) if k = 1 temp = "/MR" else temp = "/MD" end else (>) if h = 1 and k = 1 temp = "/MDR" else temp = "/MD" end end end else temp = "/M" end pass(1) = pass(1) // temp // chs(lines_per_system(sys_number)) end goto GL3 &dA &dA &d@ 2. Object type = clef &dA &dA &d@ jcode = clef code &dA &dA &d@ Clef code Score Equ. &dA &d@ ÄÄÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ treble 4 TR &dA &d@ soprano 15 (default) TR &dA &d@ alto 13 AL &dA &d@ tenor 12 TE &dA &d@ trans-treble 34 (default) BA &dA &d@ baritone 23 (default) BA &dA &d@ bass 22 BA &dA JTYPE(2): temp = "BA" if jcode = 4 or jcode = 15 temp = "TR" end if jcode = 12 temp = "TE" end if jcode = 13 temp = "AL" end if pass(1) = "" if line_number = lines_per_system(sys_number) pass(1) = "MD" // chs(lines_per_system(sys_number)) // "/" // temp else pass(1) = temp end else pass(1) = pass(1) // "/" // temp end h = jcode / 10 --rem middle_c = rem * 14 k = h / 3 h = 1 - rem h *= 28 middle_c += h if k = 1 middle_c -= 49 end if k = 2 middle_c += 49 end goto GL3 &dA &dA &d@ 3. Object type = key signature &dA &dA &d@ jcode = key code 1 = 1 sharp, -1 = 1 flat, etc. &dA JTYPE(3): if jcode <> 0 if jcode > 0 temp = "S" else temp = "F" end h = abs(jcode) pass(1) = pass(1) // "/K" // chs(h) // temp end goto GL3 &dA &dA &d@ 4. Object type = time signature &dA &dA &d@ jcode = time code (100 * tnum + tden) &dA &dA &d@ 1,1 = common time T9901 &dA &d@ 0,0 = alle breve T9801 &dA JTYPE(4): h = jcode / 100 k = rem if h = 0 and k = 0 temp = "/T9801" longest_dur(line_number) = "1" else if h = 1 and k = 1 temp = "/T9901" longest_dur(line_number) = "1" else temp = "/" // chs(h) // "T" // chs(k) if k = 0 x1 = flt(h) x2 = 1.0 / x1 longest_dur(line_number) = chs(x2,4) goto G6 end a = h / 3 if rem = 0 b = a loop for c = 1 to 10 b >>= 1 repeat while b > 0 --c b = 1 << c if b = a a = h / 3 * 2 b = k / a longest_dur(line_number) = chs(b) // "." goto G6 end end a = h / 7 if rem = 0 b = a loop for c = 1 to 10 b >>= 1 repeat while b > 0 --c b = 1 << c if b = a a = h / 7 * 4 b = k / a longest_dur(line_number) = chs(b) // ".." goto G6 end end x1 = flt(k) x2 = flt(h) x3 = x2 / x1 longest_dur(line_number) = chs(x3,4) end end G6: pass(1) = pass(1) // temp goto GL3 &dA &dA &d@ 5. Object type = directive &dA &dA &d@ ignore for the moment &dA JTYPE(5): goto GL3 &dA &dA &d@ 6. Object type = symbol &dA &dA &d@ ignore for the moment &dA JTYPE(6): goto GL3 &dA &dA &d@ 7. Object type = note &dA &dA &d@ jcode = note type &dA &dA &d@ Note type code Score Equ. &dA &d@ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ breve 10 .5 &dA &d@ whole 9 1 &dA &d@ half 8 2 &dA &d@ quarter 7 4 &dA &d@ eighth 6 8 &dA &d@ sixteenth 5 16 &dA &d@ thirty-second 4 32 &dA &d@ sixty-fourth 3 64 &dA &d@ 128th 2 128 &dA &d@ 256th 1 256 &dA &dA &d@ jvert = vertical position of note on staff line &dA &dA &d@ For objects which are groups of notes (chords), the &dA &d@ y co-ordinate is the position of the note which is &dA &d@ farthest from the note-end of the stem (and hence &dA &d@ closest to a beam, if there be one). This is impor &dA &d@ tant for the proper setting of beams at print time. &dA &d@ JTYPE(7): &dA &dA &d@ a. get letter and range of pitch &dA h = middle_c - jvert / 7 + 28 h /= 7 temp = "CDEFGAB"{rem+1} /* note letter ++notenum &dA &dA &d@ b. look at sub-objects for &dA &dA &d@ 1) dot or double dot &dA &d@ 2) accidentals &dA &dA &d@ Fonts for accidentals &dA &d@ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ 63 sharp 191 sharp &dA &d@ 64 natural 192 natural &dA &d@ 65 flat 193 flat &dA &d@ 66 double sharp 194 double sharp &dA if jpcode < 32 dots = 0 temp3 = "" loop for i = 1 to jpcode tget [Y,ypnt] temp2 .t3 a b c ++ypnt if temp2{1} = "K" if c = 44 and b <= 0 and b > -10 ++dots end if c = 63 or c = 191 temp3 = temp3 // "S" end if c = 64 or c = 192 temp3 = temp3 // "N" end if c = 65 or c = 193 temp3 = temp3 // "F" end if c = 66 or c = 194 temp3 = temp3 // "SS" end end repeat end &dA &dA &d@ c. write out pitch &dA pass(1) = pass(1) // "/" // temp // temp3 // chs(h) &dA &dA &d@ d. examine super-objects for &dA &dA &d@ 1) start or end tuple X = tuple/bracket &dA &d@ 2) start or end of beam B = beam &dA &d@ 3) start or end of tie T = tie &dA &d@ 4) start or end of slur S = slur (or dotted slur) &dA if jscnt > 0 loop for k = 1 to jscnt h = s(k) /* super object number loop for i = ypnt to pfz tget [Y,i] rec .t1 rtype hnum if rtype = "H" and hnum = h mpt = 2 temp = txt(rec,[' ']) htype = txt(rec,[' ']) temp = txt(rec,[' ']) temp = txt(rec,[' ']) a = int(temp) temp = txt(rec,[' ']) temp = txt(rec,[' ']) b = int(temp) i = 100000 end repeat if i <> 100000 putc Page-specific file format error: putc no superobject number ~h stop end if "XBTS" con htype i = 0 loop for i = 1 to supercnt if superdata(i,1) = h if htype = "X" if tupleflag <> 1 putc Tuple format error stop end tupleflag = 2 end if htype = "B" ++superdata(i,2) if superdata(i,2) = b /* end of beam pass(4) = pass(4) // " " // chs(notenum) end end if "TS" con htype if jhorz > superdata(i,3) if pass(5) = "" pass(5) = chs(notenum) // " 99" else pass(5) = pass(5) // "/" // chs(notenum) // " 99" end else if pass(5) = "" pass(5) = "99 " // chs(notenum) else pass(5) = pass(5) // "/99 " // chs(notenum) end end end i = 100000 end repeat if i < 100000 /* new super-object ++supercnt superdata(supercnt,1) = h if htype = "X" if tupleflag <> 0 putc Tuple format error stop end tupleflag = 1 superdata(supercnt,2) = a tuplenum = a end if htype = "B" superdata(supercnt,2) = 1 if pass(4) = "" pass(4) = chs(notenum) else pass(4) = pass(4) // "/" // chs(notenum) end end if "TS" con htype superdata(supercnt,2) = notenum superdata(supercnt,3) = jhorz end end end repeat end &dA &dA &d@ e. write out duration &dA &dA &d@ jcode = note type &dA &dA &d@ Note type code Score Equivalent &dA &d@ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ breve 10 .5 &dA &d@ whole 9 1 &dA &d@ half 8 2 &dA &d@ quarter 7 4 &dA &d@ eighth 6 8 &dA &d@ sixteenth 5 16 &dA &d@ thirty-second 4 32 &dA &d@ sixty-fourth 3 64 &dA &d@ 128th 2 128 &dA &d@ 256th 1 256 &dA if jcode = 10 temp = ".5" k = 0 else h = 9 - jcode k = 1 << h end if tupleflag > 0 if tupleflag = 2 tupleflag = 0 end if tuplenum = 3 if k = 0 temp = ".75" end if k = 1 k = 0 temp = "1.5" end k = k * 3 / 2 else putc tuple = ~tuplenum putc I don't understand how Leland handles this putc stop end end if k > 0 temp = chs(k) end loop for i = 1 to dots temp = temp // "." repeat if pass(2) = "" pass(2) = temp else pass(2) = pass(2) // "/" // temp end goto GL3 &dA &dA &d@ 8. Object type = rest &dA &dA &d@ jcode = rest type &dA &dA &d@ Note type code Score Equ. &dA &d@ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ breve 10 .5 &dA &d@ whole 9 1 &dA &d@ half 8 2 &dA &d@ quarter 7 4 &dA &d@ eighth 6 8 &dA &d@ sixteenth 5 16 &dA &d@ thirty-second 4 32 &dA &d@ sixty-fourth 3 64 &dA &d@ 128th 2 128 &dA &d@ 256th 1 256 &dA &dA &d@ jvert = vertical position of note on staff line &dA &dA &d@ For objects which are groups of notes (chords), the &dA &d@ y co-ordinate is the position of the note which is &dA &d@ farthest from the note-end of the stem (and hence &dA &d@ closest to a beam, if there be one). This is impor &dA &d@ tant for the proper setting of beams at print time. &dA &d@ JTYPE(8): &dA &dA &d@ a. take a closer look at whole rest &dA wflag = 0 if jcode = 9 if qq <> 1 /* rest not at beginning of measure goto G7 end tget [Y,ypnt] rec1 .t5 a a a a a if rec1{1} <> "J" goto G7 end if a = 1 wflag = 1 end if a = 6913 wflag = 6913 end end G7: &dA &dA &d@ b. look at sub-objects for &dA &dA &d@ 1) dot or double dot &dA if jpcode < 32 dots = 0 temp3 = "" loop for i = 1 to jpcode tget [Y,ypnt] temp2 .t3 a b c ++ypnt if temp2{1} = "K" if c = 44 and b <= 0 and b > -10 ++dots end end repeat end &dA &dA &d@ c. examine super-objects for &dA &dA &d@ 1) start or end tuple X = tuple/bracket &dA if jscnt > 0 loop for k = 1 to jscnt h = s(k) /* super object number loop for i = ypnt to pfz tget [Y,i] rec .t1 rtype hnum if rtype = "H" and hnum = h mpt = 2 temp = txt(rec,[' ']) htype = txt(rec,[' ']) temp = txt(rec,[' ']) temp = txt(rec,[' ']) a = int(temp) temp = txt(rec,[' ']) temp = txt(rec,[' ']) b = int(temp) i = 100000 end repeat if i <> 100000 putc Page-specific file format error: putc no superobject number ~h stop end if htype = "X" i = 0 loop for i = 1 to supercnt if superdata(i,1) = h if tupleflag <> 1 putc Tuple format error stop end tupleflag = 2 i = 100000 end repeat if i < 100000 /* new super-object ++supercnt superdata(supercnt,1) = h if tupleflag <> 0 putc Tuple format error stop end tupleflag = 1 superdata(supercnt,2) = a tuplenum = a end end repeat end &dA &dA &d@ d. write out rest &dA if wflag > 0 pass(1) = pass(1) // "/RW" if wflag = 1 and line_number = lines_per_system(sys_number) pass(1) = pass(1) // "/M" // chs(lines_per_system(sys_number)) end else pass(1) = pass(1) // "/R" end &dA &dA &d@ e. write out duration &dA &dA &d@ jcode = rest type &dA &dA &d@ Note type code Score Equivalent &dA &d@ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ &dA &d@ breve 10 .5 &dA &d@ whole 9 1 &dA &d@ half 8 2 &dA &d@ quarter 7 4 &dA &d@ eighth 6 8 &dA &d@ sixteenth 5 16 &dA &d@ thirty-second 4 32 &dA &d@ sixty-fourth 3 64 &dA &d@ 128th 2 128 &dA &d@ 256th 1 256 &dA if wflag > 0 temp = longest_dur(line_number) k = 0 else if jcode = 10 temp = ".5" k = 0 else h = 9 - jcode k = 1 << h end end if tupleflag > 0 if tupleflag = 2 tupleflag = 0 end if tuplenum = 3 if k = 0 temp = ".75" end if k = 1 k = 0 temp = "1.5" end k = k * 3 / 2 else putc tuple = ~tuplenum putc I don't understand how Leland handles this putc stop end end if k > 0 temp = chs(k) end loop for i = 1 to dots temp = temp // "." repeat if pass(2) = "" pass(2) = temp else pass(2) = pass(2) // "/" // temp end goto GL3 &dA &dA &d@ 9. Object type = grace note &dA &dA &d@ ignore for the moment &dA JTYPE(9): goto GL3 &dA &dA &d@ 10. Object type = que note &dA &dA &d@ ignore for the moment &dA JTYPE(10): goto GL3 &dA &dA &d@ 11. Object type = figures &dA &dA &d@ ignore for the moment &dA JTYPE(11): goto GL3 &dA &dA &d@ 12. Object type = mark &dA &dA &d@ relevent to beginning and ending of tie, and slur &dA &d@ super-objects on the line &dA JTYPE(12): &dA &dA &d@ examine super-objects for &dA &dA &d@ 1) start or end of tie T = tie &dA &d@ 2) start or end of slur S = slur (or dotted slur) &dA if jscnt > 0 loop for k = 1 to jscnt h = s(k) /* super object number loop for i = ypnt to pfz tget [Y,i] rec .t1 rtype hnum if rtype = "H" and hnum = h mpt = 2 temp = txt(rec,[' ']) htype = txt(rec,[' ']) temp = txt(rec,[' ']) temp = txt(rec,[' ']) a = int(temp) temp = txt(rec,[' ']) temp = txt(rec,[' ']) b = int(temp) i = 100000 end repeat if i <> 100000 putc Page-specific file format error: putc no superobject number ~h stop end if "TS" con htype i = 0 loop for i = 1 to supercnt if superdata(i,1) = h if jhorz > superdata(i,3) if pass(5) = "" pass(5) = chs(superdata(i,2)) // " 99" else pass(5) = pass(5) // "/" // chs(superdata(i,2)) // " 99" end else if pass(5) = "" pass(5) = "99 " // chs(superdata(i,2)) else pass(5) = pass(5) // "/99 " // chs(superdata(i,2)) end end i = 100000 end repeat if i < 100000 /* new super-object ++supercnt superdata(supercnt,1) = h superdata(supercnt,2) = 99 superdata(supercnt,3) = jhorz end end repeat end goto GL3 &dA &dA &d@ 4. Sub-objects (K) &dA &dA &d@ These are handled under objects &dA TYPE(4): goto GL3 &dA &dA &d@ 5. Text (form of sub-object) (T) &dA &dA &d@ Text is not handled in this program &dA TYPE(5): goto GL3 &dA &dA &d@ 6. Words (form of sub-object) (W) &dA &dA &d@ Words are not handled in this program &dA TYPE(6): goto GL3 &dA &dA &d@ 7. Super-objects (H) &dA &dA &d@ These are handled under objects &dA TYPE(7): goto GL3 &dA &dA &d@ 8. System Bar (B) &dA &dA &d@ Bar lines are handled under objects &dA TYPE(8): goto GL3 &dA &dA &d@ 9. End of Music Line (E) &dA &dA &d@ Here is where we transfer the pass array to &dA &d@ the score data table &dA TYPE(9): scorelinepnt(sys_count,line_number + 1) = zpnt loop for i = 1 to 5 tput [Z,zpnt] ~pass(i) ; ++zpnt repeat goto GL3 &dA &dA &d@ 10. Page text (X) &dA &dA &d@ Page text is not handled in this program &dA TYPE(10): goto GL3 &dA &dA &d@ 11. End of file (Z) &dA &dA &d@ End of big loop; now look for another page file &dA TYPE(11): repeat &dA &dA &d@ &dAÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿&d@ &dA &d@ &dA³ Time to assemble score files! ³&d@ &dA &d@ &dAÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ&d@ &dA WRITE: score_cnt = 0 n = sys_count sys_count = 1 NEW: ++score_cnt if score_cnt < 10 scfile = sclib // "\0" // chs(score_cnt) else scfile = sclib // "\" // chs(score_cnt) end open [4,2] scfile &dA &dA &d@ Determine the number of systems that will fit on this score file &dA j = sys_count i = scorelinepnt(j,1) /* number of lines loop while j < n ++j i += scorelinepnt(j,1) if i > 16 --j i -= scorelinepnt(j,1) goto G1 end repeat G1: j = j - sys_count + 1 /* number of systems for this file putc Writing ~j systems (~i lines) to ~scfile &dA &dA &d@ Write to file &dA sys_count += j k = 0 loop for i = 1 to j a = sys_count - i b = scorelinepnt(a,1) + 1 loop for j = 1 to scorelinepnt(a,1) ++k putf [4] IN ~k 0 0 .70 putf [4] SP 0 200 1 zpnt = scorelinepnt(a,b) --b loop for c = 1 to 5 tget [Z,zpnt] rec ++zpnt loop while len(rec) > 60 loop for d = 60 to 1 step -1 if rec{d} = "/" temp = rec{1,d} putf [4] ~temp rec = rec{d+1..} d = 0 end repeat repeat putf [4] ~rec repeat repeat repeat close [4] &dA &dA &d@ Determine if there is more to do &dA if sys_count <= n goto NEW end putc done run