INTERMEDIATE FILES FOR MUSIC PRINTING November 28, 1990 (revised 5-28-93) (revised 11-11-93) (revised 9-15-94) (revised 9-27-94) (revised 2-25-95) I. File Structure Variable length ASCII records Fields separated by blanks II. Types of I-files The first step is to generate an I-file for each individual part. These "source" I-files are non-page-specific; i.e. the clef, key and time signatures occur only at the beginning of the file, and there are no line breaks or page breaks. The reason for this type of representation is that we may want to generate a printed part, or we may want to generate a score. The generation of a single part will lead to a page-specific I-file for this part. The generation of a full score will lead to a page-specific I-file for the score. There will be some slight variation in representation for these page-specific files: 1. Lines will be broken and located on the page. 2. Clef, key and time signatures will be placed at the begining of every line. 3. The hyphens betwen syllables of text underlay locations. 4. Ties, slurs and extended hyphens will be continued across line and page boundaries. III. Record Types Source Files Page Specific (additional) ------------ -------------------------- Music Lines Systems Objects Music Lines (page specific) Sub-objects End of Music Line Text (form of sub-object) System Bar Words (form of sub-object) Page Text Attribute (form for sub-object) Super-objects IV. Record Formats A. Music Lines Field 1: Identifier = L &dA &d@ Field 2: 0 = single staff; # = vertical offset of second staff Field 3: vertical displacement of text line &dA &d@ Field 4: notesize (zero if not specified) &dA &d@ Field 5: part name (ASCII string) _NP B. Objects Field 1: Identifier = J Field 2: type of object B = bar line C = clef K = key signature T = time signature D = directive (e.g. time word, etc) S = other symbol N = note R = rest G = grace note Q = cue note F = figures &dA &d@ I = isolated directive or symbol (not &dA &d@ associated with a note, rest, or figure) M = mark (mostly for superobjects) Field 3: object code Bar line: x = measure number if there be one, else zero Clef: x = clef code Key: x = key code Time sig: x = time code (100 * tnum + tden) Directive: 0 = print always (parts and score) bit 0 set = print in parts bit 1 set = print in score bit 2 set = print if top part in score bit 3 set = print if bottom part in score (bit 1 over-rides bits 2 and 3) Symbol: 0 = not identified 4 = extended rest 6 = whole measure rest From the standpoint of typesetting for a score the major difference between a directive and a symbol is that a symbol will always be printed whether or not the part stands alone or is part of a score (e.g., letter dynamics), whereas a directive can be "made invisible" in parts that are not at the top or the bottom of a score (e.g., the segno sign). Notes: x = note type Rests: x = rest type Grace note: x = note type Cue note: x = note type Figure: 0 Isolated: same as for Directives Mark: 0 Field 4: horizontal displacement measured in 32-bit precision from beginning of piece For objects which are groups of notes (chords), the x co-ordinate is the position of the notes which fall on the proper side of the stem. For stem up, the object's position is that of the note heads to the left of the stem; for stem down, the object's position is that of the note heads to the right of the stem. _NP Field 5: vertical displacement from top staff line For objects which are groups of notes (chords), the y co-ordinate is the position of the note which is farthest from the note-end of the stem (and hence closest to a beam, if there be one). This is impor- tant for the proper setting of beams at print time. &dA &d@ For objects to be placed on the second (or greater) &dA &d@ staff of the grand staff, 1000 (2000) will be added &dA &d@ to the displacement. This means that the print &dA &d@ program must check the range of the displacement before &dA &d@ placing the object. For Bar type objects, which always have a y co-ordinate of 0, this field contains instead the bar line code: 1 = single light bar 2 = single heave bar 3 = dotted bar 5 = double light bar 6 = light-heavy double bar 9 = heavy-light double bar 10 = heavy-heavy double bar &dA &d@ In case the bar object extends to more than one staff &dA &d@ an amount equal to 1000 times (n-1) where n is the &dA &d@ number of staves is added to the bar line code Field 6: print code (or if < 32, number of sub-objects) Field 7: space node number 1. Multiple rests -- number = measures of rest 2. Everything else -- number = division number This number will indicate the division within the measure to which the object belongs. The measure is divided into 6912 (27 x 256) parts. Divisions run from 1 to 6912. It is possible for several objects to have the same space node number. These objects will have separate numbers in the page- specific format. Field 8: distance increment flag. This flag describes the distance from the preceding object, as well as an attribute of the node: 0 = preceding distance should remain fixed at print time # = preceding distance may vary at print time; parameter is the duration of the preceding node, measured in units such that 576 = quarter note. 10000 = object will be centered between bar lines (used only with whole measure rests) Field 9: number of super-objects associated with this object Fields 9a,b...,: super-object numbers _NP C. Sub-objects (these must follow directly after their associated objects) &dA &d@ Field 1: Identifier = K (or k for "silent" Sub-objects) Field 2: horiz. displacement, relative to object co-ordinate Field 3: vertical displacement, relative to object co-ordinate Field 4: print code of sub-object D. Text (a form of sub-object attached to note or rest) Field 1: Identifier = T Field 2: horizontal displacement of text, relative to object &dA &d@ Field 3: vertical code (text line number, between 1 and 10) &dA &d@ The vertical code may be followed by the "|" character &dA &d@ and a y offset. The interpretation of the offset is &dA &d@ a displacement from the normal position of the line &dA &d@ (see page-specific lines below). &dA &d@ Field 4: ASCII string &dA &d@ If this field = "~", this means that this note is the &dA &d@ termination of a forward underline. Field 5: indication of forward hyphen or underline character - = forward hyphen _ = forward underline character . = " " " followed by . , = " " " " " , : = " " " " " : ; = " " " " " ; ! = " " " " " ! ? = " " " " " ? * = nothing Field 6: space taken up by ASCII string E. Words (a form of sub-object attached to symbol) Field 1: Identifier = W Field 2: horizontal displacement of word(s), relative to directive or symbol object Field 3: vertical displacement Field 4: font number Field 5: ASCII string (includine font designations) _NP &dA &d@ F. Attributes (a form of sub-object attached to notes/rests) &dA &dA &d@ The purpose of attributes is to communication information about &dA &d@ an object that is not represented precisely by purely graphical &dA &d@ information. An example is the duration of tuplets. The tuplet &dA &d@ super-object (H . X) references only the end points of a tuplet; &dA &d@ there is no precise way to determine the remaining objects whose &dA &d@ duration might be effected by the tuplet. When converting page &dA &d@ specific i-files to SCORE pmx files, we need to know the precise &dA &d@ duration of all notes. The only foolproof way to convey this &dA &d@ information is in an attribute. Attributes are typically ignored &dA &d@ in the printing process. &dA &dA &d@ Field 1: Identifier = A &dA &d@ Field 2: type of attribute &dA &dA &d@ 1. D = duration &dA &dA &d@ Field 3: numerator of duration &dA &d@ Field 4: denominator of duration &dA &dA &d@ Duration is represented as a proper fraction. &dA &d@ 1/4 = quarter note &dA &d@ 1/2 = half note &dA &d@ etc. &dA &d@ In terms of divisions (from stage2 source representation) &dA &d@ the numerator is the number of divisions, and the denominator &dA &d@ is four times the divisions per quarter. G. Super-objects (these are things whose shapes depend on the locations of more than one object. They generally follow after all of their associated objects have been described Field 1: Identifier = H Field 2: super-object number Field 3: type of super-object B = beam T = tie S = slur (dotted slur) X = tuple/bracket W = wedge D = word plus dashes E = ending R = long trills V = octave transposition F = figure extension N = null super-object (no action) Fields 4--: depend on the super-object type 1. Beams (type = B) &dA &d@ Fields 4 and 5: &dA &dA &d@ Case I: location undetermined &dA &dA &d@ Field 4: 0 = beam above first object &dA &d@ 1 = beam below first object &dA &dA &d@ Field 5: 0 or 1 = stem directions are all the same &dA &d@ > 1 = binary representation of stem direction. &dA &d@ If field 4 = 0, then bit set = stem up; &dA &d@ if field 4 = 1, then bit set = stem down; &dA &d@ Example: if field 4 = 1, then 101001010 = &dA &d@ down, up, down, up, up, down, up, down, up &dA &dA &d@ Case II: location determined &dA &dA &d@ Field 4: length of first stem (positive = stem up) &dA &dA &d@ Field 5: slope of beam Field 6: font number Field 7: number of associated objects Fields 7a, b,... beam codes beam code = up to 6 digit number 0 = no beam 1 = continue beam 2 = begin beam 3 = end beam 4 = forward hook 5 = backward hook 6 = begin repeated beam 7 = end repeated beam 1's digit = eight level beams 10's digit = 16th level beams 100's digit = 32nd level beams 1000's digit = 64th level beams 10000's digit = 128th level beams 100000's digit = 256th level beams _NP 2. Ties (type = T) Fields 4--6: locations of note heads to be tied Field 4: vertical position of tied notes (position measured in dots (300/inch) from top staff line) &dA &d@ For ties on the virtual staff, 1000 will be added to &dA &d@ this value. Field 5: horizontal displacement of first note head from associated object (non-zero only with chords) Field 6: horizontal displacement of second note head from associated object (non-zero only with hords) Fields 7--9: parameters for tie shape and placement (calculated at print time) Field 7: horizontal displacement from note head one Field 8: vertical displacement from note head one Field 9: font number Field 10: situation flag interference tips down tips up stem staff space line space line ----- ----- ----- ---- ----- ---- no yes 1 5 9 13 no no 2 6 10 14 yes yes 3 7 11 15 yes no 4 8 12 16 Field 11: reset parameter flag (used in cases where post-editing has specified non-standard parameters) value action ----- ------ 0 recompute position and font (normal setting) 1 do not recompute position 2 do not recompute font 3 do not recompute position or font _NP 3. Slurs (dotted slurs) (type = S) Field 4: situation flag bit clear bit set -------------- ------------- bit 0: full slur dotted slur bit 1: stock slur custom slur bit 2: first tip down first tip up (*) bit 3: second tip down second tip up (+) bit 4: compute stock slur hold stock slur (*) used on custom slurs only (+) used on stock slurs only Field 5--8: position fields: For stock slurs, these are displacements added to the note positions &dAbefore&d@ the slur number is calculated. Displacements are measured in dots (300/inch). Horizontal positive is forward to the right; vertical positive is down. &dK &d@ For custom slurs, these displacements are the actual &dK &d@ starting point and ending points of the slur &dK &d@ relative to the first and second objects. &dK &d@ &dK &d@ Field 5: (extra) horizontal displacement from &dK &d@ associated object one &dK &d@ Field 6: (extra) vertical displacement from &dK &d@ associated object one &dK &d@ Field 7: (extra) horizontal displacement from &dK &d@ associated object two &dK &d@ Field 8: (extra) vertical displacement from &dK &d@ associated object two Field 9--10: parameter fields: Stock slurs: Field 9: post adjustment to curvature Field 10: beam flag 1 = set slur above beam 2 = set slur below beam &dK &d@ Custom slurs: Field 9: vertical height parameter &dK &d@ Field 10: length of flat portion as a &dK &d@ percent of span between end &dK &d@ points Field 11--12: more parameters Stock slurs: Field 11: post adjustment to x-position negative = left; positive = right Field 12: post adjustment to y-position negative = up; positive = down _NP 4. Tuplets/brackets (type = X) Field 4: situation flag bit clear bit set -------------- ------------- bit 0: no tuplet number tuplet number bit 1: no bracket bracket bit 2: tips down tips up bit 3: 0 tuplet aligns with beam bit 4: tuple near notes tuple near beam (bit 4 has meaning only if bit 3 is set) bit 5: break bracket for number bracket is continuous (bit 5 has meaning only if bit 0 is set) bit 6: number outside bracket number inside bracket (bit 6 has meaning only if bit 5 is set) bit 7: bracket is square bracket is curved (bit 7 has meaning only if bit 1 is set) Field 5: tuplet number: value = 1000 * [second number] + first or single number Fields 6--10: parameters Case I: bit 3 of sitflag = 0 (tuple not aligned with beam) or bit 3 of sitflag = 1 and bit 4 of sitflag = 0 (tuple aligned with notes of beam) Field 6: horizontal displacement from associated object one Field 7: vertical displacement from associated object one Field 8: horizontal displacement from associated object two Field 9: vertical displacement from associated object two Field 10: not used Case II: bit 3 of sitflag = 1 (tuple aligned with beam) Field 6: horizontal post adjustment to tuple Field 7: vertical post adjustment to tuple Field 8: horizontal post adjustment to tuple Field 9: vertical post adjustment to tuple Field 10: beam super-object number with which tuplet aligns 5. Wedges (type = W) Field 4: wedge size at left end Field 5: wedge size at right end Field 6: horizontal displacement from associated object one Field 7: vertical displacement from top of staff Field 8: horizontal displacement from associated object two Field 9: vertical displacement from top of staff 6. Word(s) plus dashes (type = D) Field 4: horizontal displacement from associated object one Field 5: horizontal displacement from associated object two Field 6: vertical displacement from staff lines Field 7: spacing parameter Field 8: font designator _NP 7. Endings (type = E) Field 4: situation flag 0 = ending with no number 1 = first ending 2 = second ending 3 = third ending 4 = fourth ending 11 = transposed 8av down 12 = transposed 8av up Field 5: horizontal displacement from associated object one Field 6: horizontal displacement from associated object two Field 7: vertical displacement from staff lines Field 8: length of left vertical hook Field 9: length of right vertical hook 8. Long trills (type = R) Field 4: situation 1 = no trill 2 = trill with no accidental 3 = trill with sharp 4 = trill with natural 5 = trill with flat Field 5: horizontal displacement from associated object one Field 6: horizontal displacement from associated object two Field 7: vertical displacement from associated object one 9. Octave transposition (type = V) Field 4: situation 0 = 8ve up, 1 = 8ve down 2 = 15 up, 3 = 15 down Field 5: horizontal displacement from associated object one Field 6: horizontal displacement from associated object two Field 7: vertical displacement from associated object one Field 8: length of vertical hooks _NP 10. Figure extension (type = F) Field 4: level 1,2,3 or 4 Field 5: horizontal displacement from associated object one Field 6: horizontal displacement from associated object two _NP V. Record Formats for Page Specific Record Types A. Systems Field 1: Identifier = S Field 2: 0 Field 3: x co-ordinate of system on page Field 4: y co-ordinate of system on page Field 5: horizontal length of system Field 6: vertical length of system Field 7: number of lines in system Field 8: control string in double quotes (null string allowed) B. Music Lines (page specific) Field 1: Identifier = L Field 2: y off-set in system &dA &d@ Field 3: text off-set(s) from line (separated by |) &dA &d@ Fields 4--7: parameters carried over from previous line &dA &d@ &dA &d@ Field 4: dyoff(s) &dA &d@ Field 5: uxstart(s) &dA &d@ Field 6: backloc(s) &dA &d@ Field 7: xbyte(s) (length of field = number of text lines) &dA &d@ &dA &d@ Field 8: y off-set to virtual staff line (0 = none) &dA &d@ Field 9: notesize (optional; 0 = none) C. End of Music Line Field 1: Identifier = E &dA &d@ Field 2: xbyte(s) at end of line (length of field = number of bytes) D. System Bar Field 1: Identifier = B Field 2: bar type Single bars Double Bars ----------- ----------- 1 = simple 5 = double light 2 = heavy 6 = light-heavy 3 = dotted 9 = heavy-light 10 = heavy-heavy 25 = heavy-light with 99 = no bar repeat dots Field 3: x off-set from beginning of line Field 4: number of breaks in line (to avoid interference with text and other designations) Fields 5--: parameter pairs, beginning and ending of breaks E. Page Text Field 1: Identifier = X Field 2: font number Field 3: x co-ordinate of beginning of text Field 4: y co-ordinate of text line Field 5: ASCII text