The Music Construction Set File Format For The Atari ST By Richard J. Plom Copyright 1988, INTERSECT Software & Electronic Arts, All rights reserved. In this text we will explain the internal file format for MCS. It is important to note since this is the internal format it is not easily ported. It is displayed here in a sequential format. ***** Fread(filehandle,4L,magic) BYTE magic[4]; HEAD contains the Magic header which tells the program this is really one of its songs. It should always contain "STMC" otherwise it is bogus. ***** Fread(filehandle,32L,header) SCRPHEAD header This contains the score header struct. typedef struct { WORD tmp; /* Tempo */ WORD pg_top; /* Page Top */ WORD ky_sig; /* Key Signature */ WORD phncs; /* Midi Mode 0=poly 1=monophonic */ WORD rgb[4][3]; /* Colors, in vs_color format */ } SCRPHEAD; TMP the score's overall tempo. PG_TOP the highest page used in the score(there are 26 note positions per page ). KY_SIG the score's key signature(1-15, C,G,... in same order as the key drop down in MCS.). PHNCS the midi mode 0 for poly, 1 for monophonic RGB the for score colors in vs_color format ***** Fread(filehandle,312L,about) SCI about; This contains the score's "ABOUT" information struct. typedef struct { /* Score Text Information */ char title[26]; /* Score title */ char auth[42]; /* Score Author */ char cdate[25]; /* Creation date */ char comments[5][45]; /* Score Comments */ } SCI; ***** Fread(filehandle,960L,instrumentdata) Sorry, the format of the internal sound driver is propriety. ***** Score data is stored out in track format. Fread(filehandle,(long)pg_top * 104L,trak1) Fread(filehandle,(long)pg_top * 104L,trak2) Fread(filehandle,(long)pg_top * 104L,trak3) Each trak consists of several events. An event is a 4 byte field which can be anything from a note to a repeat. The following is a description of the note events and their parameters: *NADA 0: an empty space in the score, the three remaining bytes are empty. *NOTE 1: BYTE 2 is the type of note, the following: (1=WHOLE REST,2=HALF REST,...6=THIRTY SECOND REST) (7-12,same sequence as above only dotted) (13-18, WHOLE NOTE,2=HALF NOTE,...6=THIRTY SECOND NOTE) (19-24) same sequence as above only dotted) (25-30) same sequence as 13-18, only flat) (31-36) same sequence as 13-18, flat & dotted) (37-42) same sequence as 13-18, only sharp) (43-48) same sequence as 13-18, sharp & dotted) (49-54) same sequence as 13-18, only natural) (55-60) same sequence as 13-18, natural & dotted) BYTE 3: 1-16 the instrument used. BYTE 4: full step position on staff. 0-35, 0 is high C, and 35 is low C. *REST 2 : BYTE 2 is the type of note, the following: (1=WHOLE REST,2=HALF REST,...6=THIRTY SECOND REST) (7-12,same sequence as above only dotted) BYTE 3: empty. BYTE 4: full step position on staff. 0-35, 0 is high C, and 35 is low C. *MEASURE 3 or 11 : A measure, all timing get reset. The three remaining bytes are empty. *QUIN 4: Quintuplet flag, the next note is played as a quintuplet BYTE 2-3 empty. BYTE 4: full step position on staff. 0-35, 0 is high C, and 35 is low C. *TRIP 5: triplet flag, the next note is played as a triplet BYTE 2-3 empty. BYTE 4: full step position on staff. 0-35, 0 is high C, and 35 is low C. *START_REPEAT 6: Beginning of a repeating sequence. BYTE 2 empty. BYTE 3 number of times to repeat. BYTE 4 empty. *END_REPEAT 7: Go back to beginning of repeat. The three remaining bytes are empty. *OCT_UP 8: octave raiser flag, the next note is played an octave higher. BYTE 2-3 empty. BYTE 4: full step position on staff. 0-35, 0 is high C, and 35 is low C. *OCT_DOWN 8: octave down flag, the next note is played an octave lower. BYTE 2-3 empty. BYTE 4: full step position on staff. 0-35, 0 is high C, and 35 is low C. *NU_TIME 10: Change time signature. BYTE 2 number of time sig. to use. 100 = 2/4; 101 = 4/4; 102 = 6/8; 103 = 3/4; 104 = 2/2; 105 = 3/8; 106 = 3/2; 107 = 6/4; **** Fread(filehandle,8L,midi_channel) This assigns a voice to a midi channel. WORD midi_channel[4]; midi_channel[0] empty. midi_channel[1] = voice 1 etc.. ***** Fread(filehandle,2L,&uo_inst) This is the instrument used if polyphonic is selected. WORD uo_inst; This basically wraps up our description, it is very cryptic I know, but it was never intended to be used by anything else.