<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Magnitudes-Representation




<ClassName>
class:			MusicMagnitude
<ClassHeading>
superclass:		Magnitude

category:		Music-Magnitudes-Representation

<ClassComment>
comment:
\	Instances of the subclasses of MusicMagnitude are used to represent scalar magnitudes in musical objects.
\	
\	\	\	The class MusicMagnitude is a place for the music magnitudes to share their state and basic accessing behavior.
\	
\	\	\	MusicMagnitudes generally implement arithmetic and comparison, using a mostGeneral version within a species for coercion.
\	
\	\	\	
\	
\	\	\	The 'type abstraction' classes (Duration, Pitch, Amplitude), are never instantiated; their class creation methods answer instances of their species.
\	
\	\	\	
\	
\	\	\	The 'representational abstraction' classes (NominalMagnitude, OrdinalMagnitude, NumericalMagnitude, RatioMagnitude), share value models and coercion techniques.
\	
\	\	\	Note that the concrete classes therefore answer their species by property model rather than by implementation subclass (i.e., HertzPitch species --\> Pitch rather than NumericalMagnitude).
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	value\	\	\<Number or Symbol\> the magnitude's value
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.1, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-June, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			PField
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Representation

<ClassComment>
comment:
\	Instances of PField magnitudes are used for arbitrary parameters of musical events oriented towards formats with positional parameter declarations, e.g., Music-V-style notelist formats (see uses).
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	field\	\	\<Integer\> field in the score
\	
\	\	\	\	name\	\<String or Symbol\> the parameter's name (optional)
\	
\	\	\	
\	
\	\	\	Examples:
\	
\	\	\	\	PField field: 5 value: 0.7 name: #position
\	
\	\	\	\	PField field: 9 value: 'legato' name: #expression
\	
\	\	\	




<ClassName>
class:			Duration
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Representation

<ClassComment>
comment:
\	Instances of the Duration species are used for the duration parameters of musical events.
\	
\	\	\	Durations come in several flavors, as in the classes RatioDuration, MSecondDuration and ConditionalDuration.
\	
\	\	\	The class Duration is abstract, its class creation method answers an instance of a concrete Duration class.
\	
\	\	\	
\	
\	\	\	Examples:
\	
\	\	\	\	Duration value: 0.77\	\	"create an instance with seconds as the unit"
\	
\	\	\	\	Duration value: 770\	\	"create an instance with milliseconds as the unit"
\	
\	\	\	\	Duration value: 1/4\	\	"create an instance with beats as the unit"
\	
\	\	\	\	Duration value: [ :x | x \> 4]\	"create an instance for: 'until x \> 4'"
\	
\	\	\	
\	
\	\	\	See also the class example.




<ClassName>
class:			Amplitude
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Representation

<ClassComment>
comment:
\	Instances of the Amplitude species are used for the loudness parameters of musical events.
\	
\	\	\	Amplitudes come in several flavors, as in the classes RatioMagnitude, MIDIVelocity and SymbolicLoudness.
\	
\	\	\	The class Amplitude is abstract, its class creation method answers an instance of a concrete Amplitude/Loudness class.
\	
\	\	\	
\	
\	\	\	Examples:
\	
\	\	\	\	Amplitude value: 0.77\	\	"create a ratio instance - range 0.0 to 1.0 (cmusic)"
\	
\	\	\	\	Amplitude value: 77\	\	"create an MIDI instance - range 0 to 127"
\	
\	\	\	\	Amplitude value: #mp\	\	"create a symbolic instance - range #ppp to #fff"
\	
\	\	\	
\	
\	\	\	See also the class example.




<ClassName>
class:			Pitch
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Representation

<ClassComment>
comment:
\	Instances of the Pitch species are used for the pitch or frequency parameters of musical events.
\	
\	\	\	Pitches come in several flavors, as in the classes HertzPitch, RatioPitch, MIDIPitch and SymbolicPitch.
\	
\	\	\	The class Pitch is abstract, its class creation method answers an instance of a concrete Pitch class.
\	
\	\	\	
\	
\	\	\	Examples:
\	
\	\	\	\	Pitch value: 440.0 \	"create an instance with units of Hertz"
\	
\	\	\	\	Pitch value: 77\	\	"create an instance with units of MIDI key numbers"
\	
\	\	\	\	Pitch value: #e4\	\	"create a symbolic instance"
\	
\	\	\	\	Pitch value: 'e4'\	\	"same as using a symbol"
\	
\	\	\	\	Pitch value: 4/3\	\	"create a ratio instance"
\	
\	\	\	
\	
\	\	\	Note that new pitch representations such as music11-like pch (4.11 = 11th note in oct 4) or oct (4.1100 = oct4 + 1100 cts) notations can be added by overriding the float-to-Hz or float-to-midi conversions.
\	
\	\	\	
\	
\	\	\	See also the class example.

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Magnitudes-Implementation




<ClassName>
class:			OrdinalMagnitude
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of the OrdinalMagnitude classes are order-only magnitudes.
\	
\	\	\	They use the instance or class instance tables for holding comparative relationships among instances (e.g., mag1 might know that it's \> mag2).
\	
\	\	\	The relation-setting (i.e., order assignment) messages are: ==, \>\>, \<\<, =\<, and =\>.
\	
\	\	\	The query messages are: =?, \> \< \<=, and \>=.
\	
\	\	\	
\	
\	\	\	Each subclass may decide whether instances or the class will hold the table of relationships.
\	
\	\	\	The decision should be made on the basis of the expected number of magnitude instances and the sparseness of their relationships.
\	
\	\	\	
\	
\	\	\	See the subclass' class examples.
\	
\	\	\	
\	
\	\	\	Instance Variable:
\	
\	\	\	\	table\	\<Dictionary of OrdinalMagnitude -\> Symbol\> instance rel. table
\	
\	\	\	
\	
\	\	\	Class Instance Variable:
\	
\	\	\	\	Table\	\<Dictionary of OrdinalMagnitude -\> Symbol\> class rel. table of all instances
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.0, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-February, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			Length
<ClassHeading>
superclass:		OrdinalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of Length represent subjective length (~ duration * loudness) values.
\	
\	\	\	The instance variable tables are used for the name -\> relation symbol map.
\	
\	\	\	
\	
\	\	\	See the class examples.




<ClassName>
class:			Sharpness
<ClassHeading>
superclass:		OrdinalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of Sharpness represent subjective sharpness (~ pitch * loudness) values.
\	
\	\	\	The instance variable tables are used for the name -\> relation symbol map.
\	
\	\	\	
\	
\	\	\	See the class examples.




<ClassName>
class:			NumericalMagnitude
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of the subclasses of NumericalMagnitude are music magnitudes with numerical values.
\	
\	\	\	When the values are floating-point numbers, the range is often 0.0 to 1.0.
\	
\	\	\	Integer ranges such as 0 to 127 can also be used in subclasses.
\	
\	\	\	
\	
\	\	\	One may want to add range-checking for these cases.
\	
\	\	\	
\	
\	\	\	Note that the class NumericalMagnitude is vacuous at present, and exists solely for representational modeling.




<ClassName>
class:			MSecondDuration
<ClassHeading>
superclass:		NumericalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of MSecondDuration are duration times in milli-seconds.
\	
\	\	\	This is the default time representation (most general duration) and is usually used for keys in event lists.




<ClassName>
class:			SecondDuration
<ClassHeading>
superclass:		MSecondDuration

category:		Music-Magnitudes-Implementation




<ClassName>
class:			IntervalMagnitude
<ClassHeading>
superclass:		NumericalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of subclasses of the abstract class IntervalMagnitude are NumericalMagnitudes where a specific interval is defined within which values are possible. Examples are MIDI values in the range of 0 .. 127.




<ClassName>
class:			MIDIVelocity
<ClassHeading>
superclass:		IntervalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of MIDIVelocity are key velocities (approximately proportional to loudness) in the range 0 to 127.
\	
\	\	\	
\	
\	\	\	The SymbolicLoudness class maps symbolic dynamic names onto this range on an approximately logarithmic scale.




<ClassName>
class:			MIDIPitch
<ClassHeading>
superclass:		IntervalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of MIDIPitch are well-tempered piano key numbers where 60 is middle-c (c3) according to the MIDI standard.
\	
\	\	\	
\	
\	\	\	The translation key \<--\> Hz. is done with the logarithm or 27.5 Hz. (very low A).




<ClassName>
class:			HertzPitch
<ClassHeading>
superclass:		NumericalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of HertzPitch are frequency values in Hertz.
\	
\	\	\	This is the most general Pitch representation.
\	
\	\	\	The value is assumed to be a floating-point number.




<ClassName>
class:			RatioMagnitude
<ClassHeading>
superclass:		NumericalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of the RatioMagnitude subclasses are fractional values relative to some context-defined reference value--their relative. The relative may be provided, or it may be assumed if uninitialized (e.g., for a default whole note's duration or default reference pitch).
\	
\	\	\	
\	
\	\	\	Instance Variable:
\	
\	\	\	\	relative\	\	\<MusicMagnitude\> the reference value




<ClassName>
class:			RatioLoudness
<ClassHeading>
superclass:		RatioMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of RatioLoudness are fractional amplitude values normally relative to the range 0 to 1.
\	
\	\	\	




<ClassName>
class:			DBLoudness
<ClassHeading>
superclass:		RatioLoudness

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of DBLoudness represent deciBel loudness values.
\	
\	\	\	This is not implemented yet.




<ClassName>
class:			RatioDuration
<ClassHeading>
superclass:		RatioMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of RatioDuration are 'beat' fractions.
\	
\	\	\	They can be expanded into msec. relative to some given event (a whole note), or use the default tempo of 1 sec.




<ClassName>
class:			RatioPitch
<ClassHeading>
superclass:		RatioMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of RatioPitch are fractional pitch values normally relative to c=261.623Hz.
\	
\	\	\	They can be transformed into other values (e.g., note names or key numbers), but often at a loss of accuracy if they are not well-tempered.
\	
\	\	\	




<ClassName>
class:			NominalMagnitude
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of the NominalMagnitude classes are named (symbolic) properties where a symbol \<--\> value map is well-established for a given range and domain, e.g., 0.0 to 1.0 or 0 to 127.
\	
\	\	\	Examples are pitch (#d4) or dynamic (#mp) names.
\	
\	\	\	
\	
\	\	\	Class Instance Variable:
\	
\	\	\	\	NameMap\	\<Dictionary or Array of (Symbol -\> Number or Interval)\> the class' look-up table




<ClassName>
class:			SymbolicLoudness
<ClassHeading>
superclass:		NominalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of SymbolicLoudness are dynamic names in the range #ppp to #fff.
\	
\	\	\	
\	
\	\	\	The class instance variable NameMap is used for the name \<--\> MIDI velocity range (0 to 127) mapping dictionary.
\	
\	\	\	




<ClassName>
class:			SymbolicPitch
<ClassHeading>
superclass:		NominalMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of SymbolicPitch represent well-tempered note names relative to a4=440Hz.
\	
\	\	\	The range is c0 to g#9 and the values are symbols.
\	
\	\	\	Note the confusion between the sharp sign (always placed after the note name) and Smalltalk's symbol key #.
\	
\	\	\	One often writes ('c#3' asSymbol) to be safe.
\	
\	\	\	
\	
\	\	\	The class instance variable NameMap is used for the name \<--\> MIDI key number mapping array.
\	
\	\	\	




<ClassName>
class:			ConditionalDuration
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Magnitudes-Implementation

<ClassComment>
comment:
\	Instances of ConditionalDuration are duration times where the value is a block.
\	
\	\	\	The accessing protocol allows them to be spawned as co-processes in schedulers.
\	
\	\	\	The valueAt: and waitUntil: methods allow flexible conditional scheduling and tests have shown that several dozen conditionals can be managed in real-time on modest hardware.
\	
\	\	\	
\	
\	\	\	See the class examples.
\	
\	\	\	




<ClassName>
class:			BooleanDuration
<ClassHeading>
superclass:		ConditionalDuration

category:		Music-Magnitudes-Implementation




<ClassName>
class:			BlockDuration
<ClassHeading>
superclass:		ConditionalDuration

category:		Music-Magnitudes-Implementation

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Events




<ClassName>
class:			AbstractEvent
<ClassHeading>
superclass:		Object

category:		Music-Events

<ClassComment>
comment:
\	AbstractEvent is the base class in the event list hierarchy (although it can be instantiated).
\	
\	\	\	Instances of AbstractEvent are objects that can be used as dictionaries or property lists.
\	
\	\	\	
\	
\	\	\	Their properties can be accessed either with at: and at:put: or by using the new property names themselves as selectors (e.g., (anAEventInstance at: #color put: #green) or (anAEventInstance color: #green)).
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	properties\	 \<Dictionary or nil\> property list dictionary
\	
\	\	\	
\	
\	\	\	The global dictionary called Events can be used for sharing event instances.
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.1, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-May, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			DurationEvent
<ClassHeading>
superclass:		AbstractEvent

category:		Music-Events

<ClassComment>
comment:
\	Instances of DurationEvent are events that have special slots for their duration and voice properties.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	duration \	\<Duration species or nil\> duration--a relative time
\	
\	\	\	\	voice\	\	\<Voice, Symbol or Number\> voice--a voice or key
\	
\	\	\	




<ClassName>
class:			EventList
<ClassHeading>
superclass:		DurationEvent

category:		Music-Events

<ClassComment>
comment:
\	Instances of class EventList (subclass of DurationEvent), are used for holding onto multiple timed events.
\	
\	\	\	EventLists are events themselves and can have arbitrary properties as well as a collection of (relative start time -\> event) associations.
\	
\	\	\	
\	
\	\	\	Class EventList implements much collection-style protocol for event processing, as well as having special block application methods.
\	
\	\	\	All EventList algorithms are recurrsive in order to handle arbitrarily-deep hierarchical EventLists (possible because EventList is a subclass of DurationEvent).
\	
\	\	\	The class also has numerous powerful and flexible instance creation methods.
\	
\	\	\	
\	
\	\	\	
Instance Variables:

\	\	\	events \	\<SortedCollection of EventAssociations (Duration =\> MEvent)\> 

\	\	\	\	\	\	the list's events, time/event associations sorted by relative start times

\	\	\	index \	\<Integer\> the current position (used in scheduling)

\	\	

\	\	Standard properties are #tempoScale for the tempo scaling factor (used by the CMN editors as the MS/whole note scale), and #code (#duration, #delta, or #startStop) to support different event coding schemes.

\	\	The class also supports typed links to other event lists, e.g., "eList1 isTonicAnswerOf: eList2" or "eList1 hasPreviousVersion: eList2", which can be very useful properties in editors and browsers.

\	\	

\	\	The global dictionary EventLists holds onto instances that can be referenced with their name symbols; these can have gensym-like names such as #temp.23.

\	\	Creating a named EventList automatically adds it to the global dictionary.

\	\	There are tools for browsing and maintaining this dictionary.

\	\	




<ClassName>
class:			MusicEvent
<ClassHeading>
superclass:		DurationEvent

category:		Music-Events

<ClassComment>
comment:
\	Instances of class MusicEvent are concrete musical note event objects used for eventLists and eventGenerators.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	pitch \<Pitch-species MusicMagnitude\> the pitch/frequency
\	
\	\	\	\	loudness \<Loudness-species MusicMagnitude\> the loudness/amplitude
\	
\	\	\	

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Functions




<ClassName>
class:			Function
<ClassHeading>
superclass:		DurationEvent

category:		Music-Functions

<ClassComment>
comment:
\	Instances of of Function and its subclasses represent abstractions of 1- or n-dimensional functions of time. Class Function is concrete and represents functions that are described by a array of data points assumed to lie equally-spaced in the unit interval.
\	
\	\	\	Functions are normally created from an array of values over the unity interval; x varies from 0.0 to 1.0 and y is free over that range.
\	
\	\	\	Examples are a ramp from 0 to 1 such as:
\	
\	\	\	\	[(LinearFunction from: #((0 0) (1 2))) at: 0.33]
\	
\	\	\	or a spline that traces a sine-like path centered around 1:
\	
\	\	\	\	[(SplineFunction from: #((0 1) (0.33 2) (0.67 0) (1 1))) at: 0.35]
\	
\	\	\	
\	
\	\	\	InstanceVariables:
\	
\	\	\	\	data \<Array of Numbers, OrderedCollection of (Z)Points, or UninterpretedBytes\>
\	
\	\	\	\	\	\	\	the data values or breakpoints of the function
\	
\	\	\	\	range \<Interval\> the x-range
\	
\	\	\	\	domain \<Interval\> the y-range
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.0, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-March, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			LinearFunction
<ClassHeading>
superclass:		Function

category:		Music-Functions

<ClassComment>
comment:
\	Instances of LinSeg are line-segment functions of one free variable.




<ClassName>
class:			SplineFunction
<ClassHeading>
superclass:		LinearFunction

category:		Music-Functions

<ClassComment>
comment:
\	Instances of SplineSeg are cubic splines betwen their points.
\	
\	\	\	
\	
\	\	\	Instance Variable:
\	
\	\	\	\	myForm\	\	\<Form\> my cached for (used for value look-up)




<ClassName>
class:			ExponentialFunction
<ClassHeading>
superclass:		LinearFunction

category:		Music-Functions

<ClassComment>
comment:
\	Instances of ExpSeg are exponential-segment functions of one free variable.
\	
\	\	\	They use ZPoints for x|y|exponent. The exponent determines the speed of the exponential/logarithmic transition between breakpoint values. A value of 0 leads to linear interpolation.




<ClassName>
class:			FourierSummation
<ClassHeading>
superclass:		Function

category:		Music-Functions

<ClassComment>
comment:
\	Instances of Fourier are functions that interpret their points as 3-element arrays (harmonic, amplitude, phase), and sum sine waves into their array given the fourier summation of these components.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	myForm\	\	\<Form\> my function plot--default size = 512@180
\	
\	\	\	\	myArray\	\	\<Array of Floats\> my value array--default length = 512

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Voices




<ClassName>
class:			Voice
<ClassHeading>
superclass:		MusicMagnitude

category:		Music-Voices

<ClassComment>
comment:
\	Subclasses of Voice implement the mappings between symbolic event parameters (like timbre descriptions and pitch names) and concrete output event data.
\	
\	\	\	They can be used for generating sound compiler notelists or (real-time output or file dumps of) MIDI data.
\	
\	\	\	
\	
\	\	\	The instance variables are:
\	
\	\	\	\	instruments \<set of symbols, associations or devices\> my instruments
\	
\	\	\	\	name \	\	\<String or Symbol\> my handle or name
\	
\	\	\	\	stream\	\	\<Stream\> my optional output stream
\	
\	\	\	
\	
\	\	\	The global object Voices is a dictionary that note events can refer to with integer or symbolic keys.
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.0, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-February, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			AdagioVoice
<ClassHeading>
superclass:		Voice

category:		Music-Voices

<ClassComment>
comment:
\	I am a parser for the Adagio score representation language as described in the CMU Midi Toolkit handbook. I am  invoked by "AdagioParser parse: stream" where the stream usually comes from a string or file. I operate according to a table of token types, TypeTable. (See my class initialization message.) I work by collecting note attributes and flags until a delimiter is reached, at which point I output a note and update the current time according to the current set of attributes. Delimiters are comma, semi-colon, and the end of a line.




<ClassName>
class:			MIDIVoice
<ClassHeading>
superclass:		Voice

category:		Music-Voices

<ClassComment>
comment:
\	A MidiVoice is used to play note events onto one or more output devices.
\	
\	\	\	I store MidiDevices in my instruments and play events onto them when asked to.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	instruments\	\<set of Associations\>\	my instruments, stored as channel -\> MidiDevice
\	
\	\	\	




<ClassName>
class:			NotelistVoice
<ClassHeading>
superclass:		Voice

category:		Music-Voices

<ClassComment>
comment:
\	Instances of the subclasses of NotelistVoice can read or write note list file streams in various formats for software sound synthesis packages such as cmusic, csound, or cmix.
\	
\	\	\	
\	
\	\	\	
Instance Variables:

\	\	\	parameterMap\	\	\<OrderedCollection of Symbols, Blocks, or Associations\> 

\	\	\	\	\	the object's P_map, used to print out or parse note commands.

\	\	

\	\	




<ClassName>
class:			CsoundVoice
<ClassHeading>
superclass:		NotelistVoice

category:		Music-Voices




<ClassName>
class:			CmixVoice
<ClassHeading>
superclass:		NotelistVoice

category:		Music-Voices




<ClassName>
class:			CmusicVoice
<ClassHeading>
superclass:		NotelistVoice

category:		Music-Voices

<ClassComment>
comment:
\	Cmusic voices know how to print events onto streams in standard cmusic format.
\	
\	\	\	The ignore their instrument associations, assuming they are being used as holders for note parameter transformers.
\	
\	\	\	CmusicVoices use the property dictionaries of events for an arbitratry number of note parameters.
\	
\	\	\	If events are played on them that have properties names like 'p5' or 'p21', they will be printed out in order.
\	
\	\	\	For complex instruments, one can create new subclasses of CmusicVoice that perform special parameter translations or printout formatting.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	stream\	\	\	\<Stream\> my output stream (usually a file or the Transcript)




<ClassName>
class:			OpcodeVoice2
<ClassHeading>
superclass:		Voice

category:		Music-Voices

<ClassComment>
comment:
\	This voice class is a file I/O convertor that can transform Standard 1.0 format MIDI file dumps into 
\	
\	\	\	EventLists and/or play them in real-time. 
\	
\	\	\	The messages here will look like:
\	
\	\	\	(OpcodeVoice2 newOn: 'Scores:n3.a.sc') loadOnto: (EventList newNamed: #n3.a)
\	
\	\	\	
\	
\	\	\	A type 0 MIDI file contains a single, multi-channel track. 
\	
\	\	\	A type 1 contains one or more simultaneous tracks. 
\	
\	\	\	A type 2 contains a number on independent single-track patterns.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	fileType \<Integer\> MIDI file type: 0, 1 or 2.
\	
\	\	\	\	tracks \<Integer\> number of tracks in the file.
\	
\	\	\	\	ppq \<Integer\> time division in pulses per quarter-beat.
\	
\	\	\	\	tempo \<Integer\> the tempo read in from a Midi dump file in microseconds per beat.




<ClassName>
class:			OpcodeVoice1
<ClassHeading>
superclass:		Voice

category:		Music-Voices

<ClassComment>
comment:
\	This voice class is a file I/O convertor that can transform **OLD** Opcode format MIDI file dumps into EventLists and/or play them in real-time. 
\	
\	\	\	The messages here will look like:
\	
\	\	\	(OpCodeVoice newOn: 'Scores:n3.a.sc') loadOnto: (EventList newNamed: #n3.a)
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	tempo \<Integer\> the tempo read in from a Midi dump file
\	
\	\	\	\	time \<Integer\> the current time
\	
\	\	\	\	command \<Byte\> first byte of the command
\	
\	\	\	\	byte2 \<Byte\> second byte of the command
\	
\	\	\	\	byte3 \<Byte\> third byte of the command
\	
\	\	\	\	eventList \<EventList\> the resulting event list

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Sound




<ClassName>
class:			Sound
<ClassHeading>
superclass:		Function

category:		Music-Sound

<ClassComment>
comment:
\	Instances of the subclasses of Sound are used to represent sound objects.
\	
\	\	\	The abstract class Sound is vacuous.
\	
\	\	\	Sounds use their Function and DurationEvent behaviors actively.
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.1, Palo Alto, May, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research. 
\	
\	\	\	All Rights Reserved.




<ClassName>
class:			SampledSound
<ClassHeading>
superclass:		Sound

category:		Music-Sound

<ClassComment>
comment:
\	Instances of Sound represent digitally-sampled sound objects.
\	
\	\	\	They can be read/written to/from files, displayed and played.
\	
\	\	\	The class SampledSound is concrete and assumes 16-bit linear encoding of samples; there are subclasses for floating-point and 8-bit Mu-law sample types.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	samples\	\<UninterpretedBytes\> the sound's samples
\	
\	\	\	\	cueList\	\<SortedCollection of sample indeces or nil\> the points in the data not 
\	
\	\	\	\	\	\	to play, i.e., pointers denoting sections that have been deleted. For 
\	
\	\	\	\	\	\	example, having a cueList of (1000 2000) means that samples (1000, 2000] 
\	
\	\	\	\	\	\	have been virtually cut.
\	
\	\	\	
\	
\	\	\	Other properties, such as the sound's (optional) file name, its sample rate, or the number of channels, are stored in the property list dictionary that is inherited by virtue of being an event subclass.
\	
\	\	\	
\	
\	\	\	Note that not all of this class is finished--there are methods that call non-existant user primitives, and others that are not fully implemented.




<ClassName>
class:			FloatSound
<ClassHeading>
superclass:		SampledSound

category:		Music-Sound

<ClassComment>
comment:
\	Instances of FloatSound are used for sounds with 32-bit floating-point numbers as samples.
\	
\	\	\	There are behaviors for mapping into other formats.




<ClassName>
class:			Mu8Sound
<ClassHeading>
superclass:		SampledSound

category:		Music-Sound

<ClassComment>
comment:
\	Instances of Mu8Sound are used for sounds with 8-bit Mu-law-encoded samples.
\	
\	\	\	There are behaviors for mapping into other formats.




<ClassName>
class:			GranularSound
<ClassHeading>
superclass:		Sound

category:		Music-Sound

<ClassComment>
comment:
\	Instances of GranularSound represent sounds that use granular synthesis rather than stored samples.
\	
\	\	\	
\	
\	\	\	
Instance Variables:

\	\	\	grains\	\<OrderedCollection of Sounds\> the receiver's grains

\	\	

\	\	Note that this class is not implemented yet.




<ClassName>
class:			SoundFile
<ClassHeading>
superclass:		Model

category:		Music-Sound

<ClassComment>
comment:
\	Instances of SoundFile are used for reading and writing sound objects to/from files.
\	
\	\	\	They handle formatting, headers and I/O.
\	
\	\	\	Currently implemented formats include the NeXT, SPARC, and BICSF/IRCAM soundfile formats. Special code is implemented for reading IRCAM headers with comments and max-amp records. Ths C-code for managing these sound files is part of cmix, available free from Princeton.edu.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	sound\	\	\<SampledSound\> the sound's samples
\	
\	\	\	\	rate\	\	\<Number\> the sound's sampling rate
\	
\	\	\	\	channels\	\<Number\> the number of channels
\	
\	\	\	\	fileName\	\<String\> the file's name
\	
\	\	\	\	file\	\	\<ExternalStream\> the file's stream
\	
\	\	\	\	position\	\<Number\> the current position
\	
\	\	\	\	headerSize\	\<Number\> the size of the soundfile header
\	
\	\	\	\	props\	\	\<Dictionary\> the property list dictionary of the receiver
\	
\	\	\	\	format\	\	\<Symbol\> the format--currently only #linear16Bit is handled
\	
\	\	\	\	size\	\	\<Number\> the size in samples
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.0, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-February, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			SoundPort
<ClassHeading>
superclass:		ExternalReadAppendStream

category:		Music-Sound

<ClassComment>
comment:
\	SoundPort instances are interfaces to real-time sound I/O streams.
\	
\	\	\	
\	
\	\	\	Concrete subclasses add primitive interfaces to special devices such as audio ports or coprocessors.




<ClassName>
class:			SPARCAudioPort
<ClassHeading>
superclass:		SoundPort

category:		Music-Sound

<ClassComment>
comment:
\	An instance of SPARCAudioPort can send and receive samples to/from the SPARCstation's sound driver.
\	
\	\	\	The user primitives in this class interface to the driver routines using Mu8Sound objects.




<ClassName>
class:			ProPort
<ClassHeading>
superclass:		SoundPort

category:		Music-Sound

<ClassComment>
comment:
\	An instance of ProPort can send and receive samples to/from an Ariel S56/S56X and ProPort external audio interface via the SPARCstation's SBUS.
\	
\	\	\	The user primitives in this class interface to the driver routines using SampledSound objects.




<ClassName>
class:			SoundManager
<ClassHeading>
superclass:		Model

category:		Music-Sound

<ClassComment>
comment:
\	The SoundManager class is used for managing sampled sound storage within a virtual image. Its class messages are called for creating sounds. In some cases, users will want to allocate one large UninterpretedBytes and have the SoundManager manage pointers into it.
\	
\	\	\	In the current implementation, this is not done and the SoundManager class messages allocate new UB objects on-the-fly.

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-EventGenerators




<ClassName>
class:			EventGenerator
<ClassHeading>
superclass:		EventList

category:		Music-EventGenerators

<ClassComment>
comment:
\	This class is the parent of most of the simple motive classes in this category.
\	
\	\	\	An EventGenerator can create an EventList using its given parameters and a function (block) to use to create Event sequences.  See the subclasses for examples.
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.0, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-February, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			Cluster
<ClassHeading>
superclass:		EventGenerator

category:		Music-EventGenerators

<ClassComment>
comment:
\	Cluster is an abstraction of a set of simultaneous events.
\	
\	\	\	A cluster need only have a set of pitches.
\	
\	\	\	




<ClassName>
class:			Roll
<ClassHeading>
superclass:		Cluster

category:		Music-EventGenerators

<ClassComment>
comment:
\	Rolls repeat their single events.
\	
\	\	\	It will eventually be possible to apply pitch, amplitude or duration envelopes to them as well.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	number\	\	\	\<Integer\> how many notes to play
\	
\	\	\	\	delta\	\	\	\<Number\> delta time between events
\	
\	\	\	\	noteDuration\	\<Number\> duration of events




<ClassName>
class:			Trill
<ClassHeading>
superclass:		Roll

category:		Music-EventGenerators

<ClassComment>
comment:
\	A trill is like a roll, except that it can be given an eventList for repetition.




<ClassName>
class:			Chord
<ClassHeading>
superclass:		Cluster

category:		Music-EventGenerators

<ClassComment>
comment:
\	Instances of Chord are eventLists that can be created by giving them a root and inversion. They can return eventLists.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	root \<Pitch\> the root of the chord
\	
\	\	\	\	inversion \<Integer\> the inversion level (unused at present)




<ClassName>
class:			Arpeggio
<ClassHeading>
superclass:		Chord

category:		Music-EventGenerators

<ClassComment>
comment:
\	Arpeggii can be created on Chords or other event lists and can step through their events (assumed to be simultaneous at the start) with the given delay time.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	delay \<Duration or Number\> the delay betyween the onsets of my events




<ClassName>
class:			Ostinato
<ClassHeading>
superclass:		EventGenerator

category:		Music-EventGenerators

<ClassComment>
comment:
\	Ostinati can repeat their basic eventList without end, if necessary.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	list \<EventList\> my riff
\	
\	\	\	\	playing \<Boolean\> am i on?
\	
\	\	\	\	process \<Process\> the process that's playing me
\	
\	\	\	




<ClassName>
class:			MIDIEcho
<ClassHeading>
superclass:		Ostinato

category:		Music-EventGenerators

<ClassComment>
comment:
\	Instances of class MIDIEcho can read MIDI events and process them through their blocks. An example is the class method transposeMIDI, which echos MIDI keyOn events two octaves higher.
\	
\	\	\	
\	
\	\	\	\	((MIDIEcho new) 
\	
\	\	\	\	\	process: 
\	
\	\	\	\	\	\	[ :e | 
\	
\	\	\	\	\	\	e pitch: (MIDIPitch value: (e pitch value + 24)). e]) 
\	
\	\	\	\	\	play




<ClassName>
class:			Cloud
<ClassHeading>
superclass:		EventGenerator

category:		Music-EventGenerators

<ClassComment>
comment:
\	Clouds are eventLists that are describe in terms of their contours or selection criteria.
\	
\	\	\	This can be (e.g.,) POD-style specification of ranges for random selection, or selection from a given set of pitches.
\	
\	\	\	See the class examples of my subclasses for description examples.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	density\	\	\<Number\> number of notes per second




<ClassName>
class:			SelectionCloud
<ClassHeading>
superclass:		Cloud

category:		Music-EventGenerators

<ClassComment>
comment:
\	Selection clouds are created with a set of pitch and amplitude values and return eventLists selected from these values.




<ClassName>
class:			DynamicSelectionCloud
<ClassHeading>
superclass:		SelectionCloud

category:		Music-EventGenerators

<ClassComment>
comment:
\	Dynamic selection clouds are described by their beginning and ending pitch and amplitude sets and interpolate between them.




<ClassName>
class:			DynamicCloud
<ClassHeading>
superclass:		Cloud

category:		Music-EventGenerators

<ClassComment>
comment:
\	Dynamic clouds are clouds that have starting and ending conditions (ranges or selection sets) and interpolate between them over their duration.

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-MIDI-Ports




<ClassName>
class:			MIDIPort
<ClassHeading>
superclass:		ExternalReadAppendStream

category:		Music-MIDI-Ports

<ClassComment>
comment:
\	Instances of the subclasses of MIDIPort are used for the interface betweeen MIDI devices and the "real world." They may cache output data, throttle I/O streams, or cache active notes for the porpose of sending note-offs them selves.
\	
\	\	\	They implement both note-oriented (e.g., play: pitch at: aDelay dur: aDur amp: anAmp voice: voice), and data-oriented (e.g., put: data at: delay length: size) behaviors for MIDI I/O.
\	
\	\	\	
\	
\	\	\	Subclasses must implement:
\	
\	\	\	\	[put: data at: delay length: size];
\	
\	\	\	\	[play: pitch at: aDelay dur: aDur amp: anAmp voice: voice];
\	
\	\	\	\	[nextEventInto: anEventAssociation]; and 
\	
\	\	\	\	[get: data length: size].
\	
\	\	\	
\	
\	\	\	The use of 'tick' may very among subclasses; those that run in real time will use it differently than those that write output ahead of real-time and assume another layer of delta-time buffering below.
\	
\	\	\	
\	
\	\	\	InstanceVariables:
\	
\	\	\	\	notesOn \	\	\<SortedCollection of (tick -\> (voice@pitch)) or nil\> 
\	
\	\	\	\	\	\	\	\	currently-active\	notes; note that an Event list could used
\	
\	\	\	\	process\	\	\<UnixProcess or nil\> The output process\	
\	
\	\	\	\	bytes \	\	\	\<ByteArray\> cached data\	
\	
\	\	\	\	tick \	\	\	\<Integer\> the offset tick when running ahead of real-time
\	
\	\	\	
\	
\	\	\	Class variable:
\	
\	\	\	\	MStream\	\<WriteStream\> the stream I dump by bytes on if my port is nil (good for debugging new subclasses)
\	
\	\	\	
\	
\	\	\	




<ClassName>
class:			SunMIDIPort
<ClassHeading>
superclass:		MIDIPort

category:		Music-MIDI-Ports

<ClassComment>
comment:
\	SunMIDIPort uses the mread and mplay programs via UnixProcesses and pipes to read and write MIDI data. Instances are used as the ports of MIDI devices, which MIDI voices use to play event lists. 
\	
\	\	\	Note that SunMIDIPort instances assume the mplay program buffers output according to its delta delay times, and reads data in its given message/data format.
\	
\	\	\	There are class utility messages for turning all notes off.
\	
\	\	\	
\	
\	\	\	The data format for mplay is an 8-byte header followed by raw MIDI data:
\	
\	\	\	\	long delay;\	\	/* clock ticks until action */
\	
\	\	\	\	char type;\	\	\	/* message type; 0=data */
\	
\	\	\	\	char network;\	\	/* MIDI network; 0=default */
\	
\	\	\	\	short size;\	\	/* number of MIDI data bytes */
\	
\	\	\	\	char data[];\	\	/* 3-n bytes of data */
\	
\	\	\	
\	
\	\	\	Tick is set to 0 at init time, and is used to accumulate the clock because mplay runs ahead of real time.
\	
\	\	\	
\	
\	\	\	




<ClassName>
class:			PrimMIDIPort
<ClassHeading>
superclass:		MIDIPort

category:		Music-MIDI-Ports

<ClassComment>
comment:
\	Class PrimMIDIPort is instantiated; its instances serve as driver interfaces for the C-language MIDI scheduler via their messages.
\	
\	\	\	
\	
\	\	\	This code is rather stale (as I use SunMIDIPorts), and will be redone soon.
\	
\	\	\	
\	
\	\	\	This implementation is MODE 1.0, STEIM, Amsterdam, May/June 1990; updated at the Lagoon in Palo Alto, July, 1991-February, 1992.
\	
\	\	\	
\	
\	\	\	The entirety of this software is Copyright (c) 1984-1992, Stephen Travis Pope, Nomad Object Design/Nomad Computer Music Research.  All Rights Reserved.




<ClassName>
class:			MIDIDevice
<ClassHeading>
superclass:		Model

category:		Music-MIDI-Ports

<ClassComment>
comment:
\	MIDIDevice is a subclass of Model whose instances are used to model MIDI input/output hardware devices.
\	
\	\	\	The abstract class MIDIDevice implements the generic MIDI note on/off type events.
\	
\	\	\	Subclasses of MIDIDevice exist for specific models of devices and  implement the device-specific (system exclusive) commands.
\	
\	\	\	MIDIDevice are passed Events and channel numbers by their voices and generate commands as ByteArrays that they pass to MIDIPorts.
\	
\	\	\	Several devices may share one port (if there are several MIDI-capable devices on one cable), and one voice may point to several device/channel pairs on one or more devices.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	port\	\	\	\<MidiPort\> the MIDIPort I use
\	
\	\	\	
\	
\	\	\	Class variable:
\	
\	\	\	\	MStream\	\<WriteStream\> the stream I dump by bytes on if my port is nil (good for debugging new subclasses)
\	
\	\	\	
\	
\	\	\	Standard MIDI Commands:
\	
\	\	\	\	\	Note On = 9n kk vv
\	
\	\	\	\	\	Note Off = 8n kk vv
\	
\	\	\	\	\	Key Pressure = An kk vv
\	
\	\	\	\	\	Pitch Wheel = En ll ll
\	
\	\	\	\	\	After Touch Channel Pressure = Dn vv
\	
\	\	\	\	\	Control Change = Bn cc vv
\	
\	\	\	\	\	Program change = Cn pp
\	
\	\	\	
\	
\	\	\	Relevant Constants for description of MIDI commands:
\	
\	\	\	\	\	n = 4-bit channel number
\	
\	\	\	\	\	kk = 7-bit key number
\	
\	\	\	\	\	vv = 7-bit key velocity
\	
\	\	\	\	\	ll = 7-bit low-order value
\	
\	\	\	\	\	hh = 7-bit high-order value
\	
\	\	\	\	\	cc = 7-bit control number
\	
\	\	\	\	\	pp = 7-bit program number




<ClassName>
class:			MIDIPF70
<ClassHeading>
superclass:		MIDIDevice

category:		Music-MIDI-Ports




<ClassName>
class:			MIDIFB01
<ClassHeading>
superclass:		MIDIDevice

category:		Music-MIDI-Ports

<ClassComment>
comment:
\	MidiFB01 is a type of MidiDevice for the system exclusive commands of the Yamaha FB-01 synthesiser.
\	
\	\	\	It implements the special commands available here (like note commands with fractional pitch and given duration).
\	
\	\	\	
\	
\	\	\	The standard FB01 note command is like:
\	
\	\	\	\	\	2n k f v d1 d2 = cmd:channel, noteNum, frac, vel, durLow, durHigh

<!DefineTag Section>
<!DefineTag ClassName>
<!DefineTag ClassHeading>
<!DefineTag ClassComment>
<!DefineTag ProtocolHeader>
<!DefineTag Protocols>
<!DefineTag ClassProtocols>
<!DefineTag InstanceProtocols>
<!DefineTag MethodsMessage>
<!DefineTag MethodsComment>
<!DefineTag MethodsCode>

<Section>
Music-Support




<ClassName>
class:			EventScheduler
<ClassHeading>
superclass:		Object

category:		Music-Support

<ClassComment>
comment:
\	An instance of EventScheduler is a simple driver for real-time message-passing among any classes that can return timed event association values.  
\	
\	\	\	One uses Schedules by setting up clients which a master scheduler process continuously evaluates for their next timed activations.
\	
\	\	\	Clients can return appointments which are sorted into the scheduler's list of (time -\> event) associations that is evaluated continuously when running.
\	
\	\	\	Changed messages are sent from the accessor messages to simplify EventScheduler browsers and inspectors.
\	
\	\	\	This implementation is based on Mark Lentczner's original 1986 design.
\	
\	\	\	
\	
\	\	\	Instance variables:
\	
\	\	\	\	clients \	\	\<Collection\> client objects
\	
\	\	\	\	appointments\	\<SortedCollection of (time -\> event) Associations\> the schedule
\	
\	\	\	\	running \	\	\<Boolean\> running schedule?
\	
\	\	\	\	doWait\	\	\<Boolean\> whether or not the scheduler should do real-time 
\	
\	\	\	\	\	\	\	\	scheduling--set to false if there is a lower level of scheduling 
\	
\	\	\	\	\	\	\	\	(e.g., primitive-level) or if output need not be real-time
\	
\	\	\	
\	
\	\	\	Class variable:
\	
\	\	\	\	Schedule \	\<EventScheduler\> shared instance accessed by the class 
\	
\	\	\	\	\	\	\	\	message masterSchedule
\	
\	\	\	




<ClassName>
class:			EventAssociation
<ClassHeading>
superclass:		Association

category:		Music-Support

<ClassComment>
comment:
\	EventAssociations are used for the (time -\> event) elements of EventLists.
\	
\	\	\	They are like regular Associations, but require both key and value to be equal for the Association to be equal.
\	
\	\	\	
\	
\	\	\	EventAssociations are created with the message '=\>' sent to any object, e.g., 
\	
\	\	\	\	21 =\> anEvent.
\	
\	\	\	They print themselves in this way as well.




<ClassName>
class:			ZPoint
<ClassHeading>
superclass:		Point

category:		Music-Support

<ClassComment>
comment:
\	ZPoints define a third instance variable in addition to Point's x and y to hold 3-dimensional point values.

