--Author: John Maxwell
--last modified: November 28, 1981 8:43 AM
DIRECTORY
MusicDefs: FROM "MusicDefs";
Chord: DEFINITIONS IMPORTS MusicDefs =
BEGIN
OPEN MusicDefs;
default:INTEGER = 1000;
AddNote:PROCEDURE[c:ChordPTR,n:NotePTR];
Adjust:PROCEDURE[c:ChordPTR];
Draw:PROC[c:ChordPTR,stem:INTEGER←default];
RemoveNote:PROCEDURE[c:ChordPTR,n:NotePTR];
SetDefaultStem:PROCEDURE[c:ChordPTR];
Sort:PROCEDURE[c:ChordPTR,up:BOOLEAN] RETURNS[n:CARDINAL];
-- INLINE Procedures
Beam:PUBLIC PROC[c:ChordPTR] RETURNS[BeamPTR] = INLINE
{RETURN[IF c.note[0]#NIL THEN c.note[0].beam ELSE NIL]};
GetHeapIndex:PUBLIC PROC[c:ChordPTR] RETURNS[CARDINAL] = INLINE
{FOR i:CARDINAL IN [0..chordHeapLength) DO
IF chordHeap[i]=c THEN RETURN[i];
ENDLOOP;
RETURN[chordHeapLength]};
Grace:PROCEDURE[c:ChordPTR] RETURNS[BOOLEAN] = INLINE
{FOR i:CARDINAL IN [0..chordLength) DO
IF c.note[i]=NIL THEN EXIT;
IF ~c.note[i].grace THEN RETURN[FALSE];
ENDLOOP;
RETURN[TRUE]};
InVoice:PROCEDURE[c:ChordPTR,voice:CARDINAL] RETURNS[BOOLEAN] = INLINE
{FOR i:CARDINAL IN [0..chordLength) DO
IF c.note[i]=NIL THEN EXIT;
IF c.note[i].voice=voice THEN RETURN[TRUE];
ENDLOOP;
RETURN[FALSE]};
Length:PROC[c:ChordPTR] RETURNS[CARDINAL] = INLINE
{FOR i:CARDINAL IN [0..chordLength] DO
IF i=chordLength THEN RETURN[i];
IF c.note[i]=NIL THEN RETURN[i];
ENDLOOP;
ERROR};
Width:PROCEDURE[c:ChordPTR] RETURNS[INTEGER] = INLINE
{RETURN[IF Grace[c] THEN 5 ELSE 8]};
END..