--Author: John Maxwell -- Last Edited by: Maxwell, November 18, 1983 2:12 pm -- This module gives the format for the file on the disk. -- Changing this module may make old music files obsolete. -- MusicDefs imports from here whenever its types exactly match these. MusicFileDefs: DEFINITIONS= BEGIN versionID: INTEGER = 3; nullID: INTEGER = 0; scoreID: INTEGER = 1; eventID: INTEGER = 2; noteID: INTEGER = 3; chordHeapID: INTEGER = 4; chordID: INTEGER = 5; beamHeapID: INTEGER = 6; beamID: INTEGER = 7; viewID: INTEGER = 8; tieID: INTEGER = 9; -- MusicFile is just a conceptual tool to help one understand the file format. -- the identifiers are used to make sure that the file has been read in correctly. -- (You may wish to eliminate these, but then old files will no longer work.) -- MusicFile: TYPE = MACHINE DEPENDENT RECORD[ -- version: INTEGER, -- score: RECORD[ -- identifier: INTEGER _ scoreID, -- events: SEQUENCE length: CARDINAL OF EventFormat], -- chordHeap: RECORD[ -- identifier: INTEGER _ chordHeapID, -- chords: SEQUENCE length: CARDINAL OF ChordFormat], -- beamHeap: RECORD[ -- identifier: INTEGER _ beamHeapID, -- beams: SEQUENCE length: CARDINAL OF BeamFormat], -- spare1: INTEGER _ nullID, ++ spare identifiers. -- spare2: INTEGER _ nullID, ++ all spares are set to zero until needed -- spare3: INTEGER _ nullID, ++ these spares are for: ties, slurs, -- spare4: INTEGER _ nullID, ++ eventExeptions, noteExceptions, and strings. -- spare5: INTEGER _ nullID, -- spare6: INTEGER _ nullID, -- spare7: INTEGER _ nullID, -- spare8: INTEGER _ nullID, -- spare9: INTEGER _ nullID, -- view: ViewFormat]; EventFormat: TYPE = MACHINE DEPENDENT RECORD[ identifier: INTEGER _ eventID, time: LONG INTEGER _ 0, type: EventTypeFormat _ notes, ignore: BOOLEAN _ FALSE, -- do not use this bit spare1: [0..1000) _ 0, value: INTEGER _ 0, -- may be a time signature spare2: CARDINAL _ 0, length: CARDINAL _ 0]; -- followed by: -- notes: ARRAY [0..length) OF NoteFormat OR -- sheet: SheetFormat depending on 'type' TimeFormat: TYPE = LONG INTEGER; EventTypeFormat: TYPE = {notes, measure, repeat1, repeat2, endMeasure, doubleMeasure, m5, timeSignature, keySignature, metrenome, staves, clef, octava1, octava2, spare5, spare6, spare7, spare8, spare9, spare10, spare11, spare12, spare13, spare14}; SheetFormat: TYPE = MACHINE DEPENDENT RECORD[ junk: LONG CARDINAL _ 0, -- garbage filler height: INTEGER _ 0, offset: INTEGER _ 0, sl: CARDINAL _ 0, staff: ARRAY [0..6) OF Staff _ ALL[[]]]; Staff: TYPE = RECORD[ pitch: INTEGER _ 0, -- pitch of note on bottom line y: INTEGER _ 0]; -- height relative to bottom line NoteFormat: TYPE = MACHINE DEPENDENT RECORD[ identifier: INTEGER _ noteID, pitch: INTEGER _ 40, voice: CARDINAL _ 0, value: NoteValueFormat _ unknown, --3 bits spelled: AccidentalFormat _ inKey, --3 bits rest: BOOLEAN _ FALSE, dotted: BOOLEAN _ FALSE, doubleDotted: BOOLEAN _ FALSE, grace: BOOLEAN _ FALSE, stemUp: BOOLEAN _ FALSE, exception: BOOLEAN _ FALSE, embellish: EmbellishmentFormat _ none, --3 bits tie: BOOLEAN _ FALSE, -- if TRUE, a TieFormat follows show: BOOLEAN _ FALSE, spare4: [0..2000) _ 0, staff: [0..16) _ 1, spare2: CARDINAL _ 0, --legato, stacatto, accents spare3: CARDINAL _ 0, toc: LONG CARDINAL _ 0, duration: CARDINAL _ 0]; NoteValueFormat: TYPE= {whole, half, quarter, eighth, sixteenth, thirtysecond, sixtyfourth, unknown}; AccidentalFormat: TYPE = {doubleSharp, sharp, natural, inKey, flat, doubleFlat}; EmbellishmentFormat: TYPE = {none, trill, mordent1, mordent2, e1, e2, e3, e4}; ChordFormat: TYPE = MACHINE DEPENDENT RECORD[ identifier: INTEGER _ chordID, stemUp: BOOLEAN _ FALSE, exception: BOOLEAN _ FALSE, spare1: [0..16000) _ 0, exceptionPTR: CARDINAL _ 0, spare2: INTEGER _ 0, length: CARDINAL _ 0]; -- notePTRs: ARRAY [0..length) OF RelativePTR; BeamFormat: TYPE = MACHINE DEPENDENT RECORD[ identifier: INTEGER _ beamID, tilt: REAL _ 0, beamed: BOOLEAN _ FALSE, exception: BOOLEAN _ FALSE, ntuple: [0..128) _ 0, against: [0..128) _ 0, height: INTEGER _ 0, invisible: BOOLEAN _ FALSE, spare1: [0..1024) _ 0, staff: [0..32) _ 0, spare2: CARDINAL _ 0, length: CARDINAL _ 0]; -- chordPTRs: ARRAY [0..length) OF RelativePTR; TieFormat: TYPE = MACHINE DEPENDENT RECORD[ identifier: INTEGER _ tieID, height: INTEGER _ 0, heap: CARDINAL _ 0, index: CARDINAL _ 0]; RelativePTR: TYPE = MACHINE DEPENDENT RECORD[ heap: CARDINAL, index: CARDINAL]; beams: CARDINAL = 64000; -- used in RelativePTR chords: CARDINAL = 64001; -- used in RelativePTR ViewFormat: TYPE = MACHINE DEPENDENT RECORD[ identifier: INTEGER _ viewID, scale: INTEGER _ 0, accidental: BOOLEAN _ FALSE, notehead: BOOLEAN _ FALSE, sync: BOOLEAN _ FALSE, display: DisplayModeFormat _ physical, noCarry: BOOLEAN _ FALSE, hardcopy: BOOLEAN _ FALSE, spare1: [0..512) _ 0, sheet: INTEGER _ 0, --will later be made obselete speed: INTEGER _ 0, --will later be made obselete key: INTEGER _ 0, --will later be made obselete spare5: INTEGER _ 0, spare6: INTEGER _ 0]; DisplayModeFormat: TYPE = {physical,logical,graphical}; END.