MusicFileDefs.mesa
Copyright (C) 1981, 1984 Xerox Corporation. All rights reserved.
Author: John Maxwell
last modified: April 20, 1981 1: 10 PM
Edited by Doug Wyatt, June 14, 1984 4:55:52 pm PDT
MusicFileDefs: CEDAR DEFINITIONS
= BEGIN OPEN MusicDefs;
versionID: INTEGER = 3;
ID:
TYPE ~
MACHINE
DEPENDENT {nullID(0), scoreID(1), eventID(2), noteID(3), chordHeapID(4), chordID(5), beamHeapID(6), beamID(7), viewID(8), tieID(9), (
CARDINAL.
LAST)};
MusicFile is never actually used, it is a conceptual tool that helps
one understand the file format.
MusicFile: TYPE = MACHINE DEPENDENT RECORD[
version: INTEGER,
score: MACHINE DEPENDENT RECORD[
identifier: ID ← scoreID,
length: CARDINAL,
events: ARRAY [0..0) OF EventFormat],
chordHeap: MACHINE DEPENDENT RECORD[
identifier: ID ← chordHeapID,
length: CARDINAL,
chords: ARRAY [0..0) OF ChordFormat],
beamHeap: MACHINE DEPENDENT RECORD[
identifier: ID ← beamHeapID,
length: CARDINAL,
beams: ARRAY [0..0) OF BeamFormat],
spare1: ID ← nullID, --all spares are set to zero until needed
spare2: ID ← nullID, --these spares are for: ties, slurs,
spare3: ID ← nullID, --eventExeptions, noteExceptions, and strings.
spare4: ID ← nullID,
spare5: ID ← nullID,
spare6: ID ← nullID,
spare7: ID ← nullID,
spare8: ID ← nullID,
spare9: ID ← nullID,
view: ViewFormat];
EventFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
identifier: ID ← eventID,
time: Time ← 0,
type: EventType ← notes,
exception: BOOL ← FALSE,
spare1: [0..1000) ← 0,
value: INTEGER ← 0,
spare2: CARDINAL ← 0,
length: CARDINAL ← 0
notes: ARRAY [0..length) OF NoteFormat
];
SheetFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
junk: NotePTR ← NIL,
height, offset: INTEGER ← 0,
sl: CARDINAL ← 0,
staff: ARRAY [0..6) OF Staff
];
NoteFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
identifier: ID ← noteID,
pitch: INTEGER ← 40,
voice: CARDINAL ← 0,
value: NoteValue ← unknown, --3 bits
spelled: Accidental ← inKey, --3 bits
rest: BOOL ← FALSE,
dotted: BOOL ← FALSE,
doubleDotted: BOOL ← FALSE,
grace: BOOL ← FALSE,
stemUp: BOOL ← FALSE,
exception: BOOL ← FALSE,
embellish: Embellishment ← none, --3 bits
tie: BOOL ← FALSE,
show: BOOL ← FALSE,
spare4: [0..2000) ← 0,
staff: [0..16) ← 1,
spare2: CARDINAL ← 0, --legato, stacatto, accents
spare3: CARDINAL ← 0,
toc: LONG CARDINAL,
duration: CARDINAL
];
ChordFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
identifier: ID ← chordID,
stemUp: BOOL,
exception: BOOL ← FALSE,
spare1: [0..16000) ← 0,
exceptionPTR: CARDINAL ← 0,
spare2: INTEGER ← 0,
length: CARDINAL,
notePTRs: ARRAY [0..0) OF RelativePTR
];
BeamFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
identifier: ID ← beamID,
tilt: REAL,
beamed: BOOL,
exception: BOOL ← FALSE,
ntuple: [0..128),
against: [0..128),
height: INTEGER,
invisible: BOOL ← FALSE,
spare1: [0..1024) ← 0,
staff: [0..32),
spare2: CARDINAL ← 0,
length: CARDINAL,
chordPTRs: ARRAY [0..0) OF RelativePTR
];
TieFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
identifier: ID ← tieID,
height: INTEGER ← 0,
heap: CARDINAL ← 0,
index: CARDINAL ← 0
];
RelativePTR:
TYPE =
MACHINE
DEPENDENT
RECORD[
heap: CARDINAL,
index: CARDINAL
];
beams: CARDINAL = 64000; -- special heap value in RelativePTR
chords: CARDINAL = 64001; -- special heap value in RelativePTR
ViewFormat:
TYPE =
MACHINE
DEPENDENT
RECORD[
identifier: ID ← viewID,
scale: INTEGER,
accidental: BOOL,
notehead: BOOL,
sync: BOOL,
display: DisplayMode,
noCarry: BOOL ← FALSE,
hardcopy: BOOL,
spare1: [0..512) ← 0,
sheet: INTEGER ← 0, --will later be made obsolete
speed: INTEGER ← 0, --will later be made obsolete
key: INTEGER ← 0, --will later be made obsolete
spare5: INTEGER ← 0,
spare6: INTEGER ← 0
];
END.