Class:            Voice

Environment:      Siren
Superclass:         Model
Category:         MusicIO-Voices
Instance variables:   name instrument stream
Class variables:      DefaultVoiceClass

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:
   instrument my instrument
   name        my handle or name
   stream       my (optional) I/O stream

The global object Voices is a dictionary that note events can refer to with integer or symbolic keys.

accessing

instrument
   return my instrument.

instrument: newValue
   set my instrument.

stream
   answer the stream of the receiver voice

stream: someStream
   plug in a stream to the receiver voice

events

eventList
   Answer an event list read from the receiver.

play: anEventList
   Expand the list and play it now.

play: anEventOrList at: start
   Expand the list and play it at the given time.

playEvent: anEvent
   Play the argument now.

playEvent: anEvent at: aTime
   make sure my subclasses implement this

readOnto: eventList
   Read events from the receiver into the argument.

printing

printOn: aStream
   Print the receivcer on the argument.

testing

isVoice
   Answer true

initialize-release

close
   Close the stream, devise, or whatever.

initialize
   Set up a Voice.

initializeNamed: aName
   Set up a named Voice.

MetaClass:         Voice class

class var accessing

class initialization

initialize
   set up the shared dictionary for caching voices

reset
   Reset all sub-instances of Voice.

setDefault: className
   Set the default class to use for new voices

instance creation

default
   Answer a voice.

named: aName
   Answer the shared dictionary's voice item at the given name (or the name itself if it's a voice)

on: someStream
   Answer a new voice instance on the given stream.