Piece.mesa
Copyright (C) 1983, 1984 Xerox Corporation. All rights reserved.
Author: John Maxwell
Last Edited by: Maxwell, November 22, 1983 11:52 am
Last Edited by: Doug Wyatt, June 14, 1984 6:27:28 pm PDT
DIRECTORY
MusicDefs USING [EventPTR, NotePTR, ObjectType, ScorePortionPTR, ScorePTR, Time];
Piece: CEDAR DEFINITIONS
= BEGIN OPEN MusicDefs;
default: INTEGER = 1000;
AddEvent: PROC[score: ScorePTR, event: EventPTR];
RemoveEvent: PROC[score: ScorePTR, event: EventPTR, free: BOOLEANFALSE];
removes event from score. IF free = TRUE, then frees EVENT.
Copy: PROC[score: ScorePTR, time1, time2: Time] RETURNS[ScorePortionPTR];
Merge: PROC[score, new: ScorePTR, begin, end: Time];
Replace: PROC[score: ScorePTR, new: ScorePortionPTR, delete1, delete2: Time];
new gets deleted when done. may raise Piece.Overflow
Insert: PROC[score: ScorePTR, new: ScorePortionPTR, begin: Time] =
INLINE {Replace[score, new, begin, begin]};
Delete: PROC[score: ScorePTR, begin, end: Time] =
INLINE {Replace[score, NIL, begin, end]};
New: PROC[length: CARDINAL, auxiliary: BOOLFALSE] RETURNS[score: ScorePTR];
Free: PROC[score: ScorePTR]; -- utterly destroys score. removes from anything that might point to it. Raises Piece.Overflow with new = NIL.
Sort: PROC[score: ScorePTR];
CleanUpNotes: PROC[score: ScorePTR];
CleanUpEvents: PROC[score: ScorePTR];
MaxToc: PROC[score: ScorePTR, time1, time2: Time, duration: BOOLEAN] RETURNS[Time];
NearestNote: PROC[score: ScorePTR, x, y: INTEGER ← default]
RETURNS[NotePTR]; -- x and y default to mouse.
NearestObject: PROC[score: ScorePTR, x, y: INTEGER ← default]
RETURNS[obj: ObjectType, p: REF]; -- x and y default to mouse.
NearestEvent: PROC[score: ScorePTR, t: Time, syncsOnly: BOOLEANFALSE]
RETURNS[index: CARDINAL]; -- returns score.length if none found
END.