Size Description 40 Name of font, padded with Return (&0D) characters 4 16 4 16 1 n=number of defined characters 3 reserved - currently 0 256 character mapping (ie indices into following arrays). For example, if the 40th byte in this block is 4, then the fourth entry in each of the following arrays refers to that character. A zero entry means that character is not defined in this font. 2n x0 | 2n y0 | bounding cox of character (in 1/1000th em) 2n x1 | coordinates are relative to the 'origin point' 2n y1 | 2n x-offset after printing this character 2n y-offset after printing this characterThe bounding boxes and offsets are given as 16-bit signed numbers, with the low byte first.
Size Description 1 point size (not multiplied by 16) 1 bits per pixel (4) 1 pixels per inch (x-direction) 1 pixels per inch (y-direction) 4 reserved - currently 0 4 offset of font data in file 4 size of font dataThe list is terminated by:
Size Description 4 x-size in 1/16ths point * x pixels per inch 4 y-size in 1/16ths point * y pixels per inch 4 pixels per inch in the x-direction 4 pixels per inch in the y-direction 1 x0 | maximum bounding box for any character 1 y0 | bottom-left is inclusive 1 x1 | top-rightis exclusive 1 y1 | all coordinates are in pixels 512 2 byte offsets from table start of character data. A zero value means the character is not defined. These are low/high byte pairs (ie little-endian)
Size Description 1 x0 | bounding box 1 y0 | 1 x1 - x0 = X 1 y1 - y0 = Y X*Y/2 4-bits per pixel (bpp), consectutive rows bottom to top. Not aligned until at the end. 0 - 3.5 Alignment
If the length of an outlines file is less than 256 bytes, then contents are the name of another font whose glyphs are to be used instead (with this fonts metrics).
If the length of a x90y45 file is less than 256 bytes then contents are the name of the f9999x9999 file to use as master bit maps.
Size Description 4 "FONT - identification word 1 Bits per pixel: 0 = outlines 1 = 1 bpp 4 = 4 bpp 1 Version number of file format 4:no "don't draw skeleton lines unless smaller than this" byte present 5:byte at [table+512] = max pixel size for skeleton lines (0 => always do it) 6:byte at [chunk+indexsize] = dependency mask (see below)
Instrument dataInstrument names are not recorded; only channel numbers.Size Description 1 3 indicates Instrument data followsThis is followed by 8 blocks of 2 bytes each:1 channel number. Always consecutive 1-8 1 voice number; 0=no voice attached
Volume dataSize Description 1 4 indicates Volume data follows 1*8 Volume on each channel = 0-7 = ppp-fff. One byte for each channel.
Stereo position dataSize Description 1 5 indicates Stereo data follows 1*8 Stereo position of channel n = 0-7 = Full Left...Full Right. One byte for each channel.
Tempo dataSize Description 1 6 indicates Tempo data follows 1 0-14, which corresponds to one of: 40, 50, 60, 65, 70, 80, 90, 100, 115, 130, 145, 160, 175, 190, 210 beats per minuteTo convert to values to program into SWI Sound_Tempo, use the formula: Sound_Tempo value = Beats per minute * 128 * 4096/6000
Title stringSize Description 1 7 indicates Title string follows n Null terminated string of n characters total length
Instrument namesSize Description 1 8 indicates Instrument names follow n1..n8 8 null terminated strings for each voice number used in ascending order under Instrument data above.
MIDI channelsSize Description 1 9 indicates MIDI channel numbers follow 1*8 MIDI channel number from 1-16 on this stave for each channel. 0 indicates not transmitted over MIDI.
GatesA Gate is a point in the music where something is interpreted. eg. a note, time-signature, key-signature, bar-line or clef can each occupy a gate. The gate data is one byte for a note or rest; 2 bytes for an attribute (time-signature, key-signature, bar-line or clef).
Note or restBits Description 0-7 Gate mask, bit n set to 1 note or rest from queue n.
AttributeByte Description 0 0 1 Could be any of the following forms: Time-signature
Bit(s) Description 0 Stem orientation. 0 for up and 1 for down 1 Set to 1 to join beams (barbs) to next note 2 Set to 1 to tie with next note 3-7 Stave line position 1-31 (16 is the centre line) 8-10 Accidental 0 = natural 1 = sharp 2 = flat 3 = double-sharp 4 = double-flat 5 = natural sharp 6 = natural flat 7 = unused 11-12 number of dots, from 0-3 13-15 Type. Breve = 0 to Hemisemidemiquaver = 7
Bits Description 0-10 Unused. Set to 0 11-12 Number of dots, from 0-3 13-15 Type. Breve=0 to Hemisemidemiquaver=7If a rest coincides with a note, its position is determined by the following note on the same channel.