The Siren 7.5 Reference Manual

Music-Models-Representation


Class:            MusicMagnitude

Environment:      Siren
Superclass:         Magnitude
Category:         Music-Models-Representation
Instance variables:   value

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 precise mixed-mode arithmetic and comparison methods using a per-species generality table and auto-coercion within a species.

The "type abstraction" classes (Duration, Pitch, Amplitude, etc.) represent "what"; they are never instantiated; their class creation methods answer instances of their species, but they manage coercion within the classes of their species. The "representational abstraction" classes (NominalMagnitude, OrdinalMagnitude, NumericalMagnitude, RatioMagnitude, etc.) represent "how"; they share value model semantics and coercion techniques. Note that the concrete implementation classes therefore answer their species by property model rather than by implementation subclass (i.e., HertzPitch species --> Pitch rather than NumericalMagnitude).

MusicMagnitudes can have dependents (observers), and send themselves the changed: message when their values are changed.

There are many examples in the implementation classes and the Siren outline.

Instance variables:
   value       the magnitude's value

accessing

, anArgument
   Answer en Event with the given magnitude as its first property.

value
   Answer the instance variable 'value'.

value: theValue
   Accept the argument, 'theValue', as the new instance variable 'value'
      and signal any dependents.

printing

printOn: aStream
   Print the receiver on the argument as a MM declaration.

printOn: aStream parens: useParens
   Print the receiver on the argument as a MM declaration.

printString
   Answer a String whose characters are a description of the receiver.

printStringParens: bool
   Answer a String whose characters are a description of the receiver.

printValue
   

storeOn: aStream
   Store the receiver on the argument as a MM declaration.

units
   Answer the units string of the receiver.

private

species
   Answer MusicMagnitude.

converting

adaptToNumber: rcvr andSend: selector
   If I am involved in arithmetic with a number, convert me to a number.

coerceTo: type
   Coerce the receiver to the given class and answer a new object.

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.

msec
   Answer a MSecondDuration.

usec
   Answer a MSecondDuration.

testing

isImmediate
   Answer whether the receiver has an immediate representation.

isMusicMagnitude
   Answer true for the receiver and all subsclasses.

arithmetic

* aValue
   Answer the product of the receiver and the argument

+ aValue
   Answer the sum of the receiver and the argument, doing generality-based
   class coercion within a species using auto-generated coercion messages.

- aValue
   Answer the difference of the receiver and the argument

/ aValue
   Answer the quotient of the receiver and the argument

comparing

< aValue
   Answer whether the receiver is less than the argument

= aValue
   Answer whether the receiver and the argument are equal.

hash
   Answer a SmallInteger unique to the receiver.

MetaClass:         MusicMagnitude class

instance creation

value: aValue
   Answer and instance with the argument as its value.

class constants

color
   Answer the default color to display instances with (hack for making pretty graphs).

propertyName
   Answer the receiver class's default property name.

relativeMember
   Answer the receiver class's species member used as a relative magnitude.


Class:            PField

Environment:      Siren
Superclass:         Siren.MusicMagnitude
Category:         Music-Models-Representation
Instance variables:   name field

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 field in the score
   name the parameter's name (optional)

Examples:
   PField field: 5 value: 0.7 name: #position
   PField field: 9 value: 'legato' name: #expression

accessing

field
   Answer the instance variable 'field'.

field: theNumber
   Accept the argument, 'theNumber', as the new instance nariable 'field'.

name
   Answer the instance variable 'name'.

name: theName
   Accept the argument, 'theName', as the new instance nariable 'name'.

MetaClass:         PField class

instance creation

field: aNumber value: aValue
   Answer an initialized instance.

field: aNumber value: aValue name: aName
   Answer an initialized instance.


Class:            MusicModel

Environment:      Siren
Superclass:         Siren.MusicMagnitude
Category:         Music-Models-Representation
Class instance variables:   generalityTable

MusicModel adds the class instance variable generalityTable that is used for "abstract" music magnitude models such as Pitch and Amplitude.

See the class methods for generality.

Class inst Vars:
   generalityTable Integer)> The species generality table

MetaClass:         MusicModel class

Instance variables:   generalityTable

generality

generality
   Answer the class inst var for the generality table.

generalize: aMag and: otherMag
   Answer an array of the two arguments with the most general first.

examples

examples
   Pitch generalize: (#c pitch) and: (21 key)


Class:            Positus

Environment:      Siren
Superclass:         Siren.MusicModel
Category:         Music-Models-Representation

Class Positus is the abstract representational class for the position, space, and direction species.
Instances of its subclass species are used to model spatial and positional values.

MetaClass:         Positus class


Class:            Directionality

Environment:      Siren
Superclass:         Siren.Positus
Category:         Music-Models-Representation

Instances of the Directionality species model the radiation characteristics of sound sources in room simulations.
This class can be used as a concrete one (adding a few methods to fill it out), or like the other representational classes (making concrete classes of this species).
In the later case, the value instance variable would hold a 1- or 2-dimensional position as a number or point.

MetaClass:         Directionality class


Class:            Ergon

Environment:      Siren
Superclass:         Siren.MusicModel
Category:         Music-Models-Representation

Class Ergon is the abstract representational class for the amplitude/loudness/dynamic species.
Instances of its subclass species are used to model loudness values.

MetaClass:         Ergon class


Class:            Spatialization

Environment:      Siren
Superclass:         Siren.Positus
Category:         Music-Models-Representation

Instances of the Spatialization species model the characteristics and configuration of room simulations in scores.
This class can be used as a concrete one (adding a few methods to fill it out), or like the other representational classes (making concrete classes of this species).
In the later case, the value instance variable would hold a record with the geometry or the room, the positions of default sources, and the listener's position and features.

MetaClass:         Spatialization class


Class:            Amplitude

Environment:      Siren
Superclass:         Siren.Ergon
Category:         Music-Models-Representation

Instances of classes whose species is Amplitude 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.

MetaClass:         Amplitude class

instance creation

value: aValue
   Answer a new instance of a member of my species.

class constants

color
   Answer the default color to display instances with.

initialize
   Set up the class inst var, a generality table.

initializeGenerality
   Set up the class inst var, a generality table.

mostGeneral
   Answer the most general-purpose duration--relative

propertyName
   Answer the receiver class's default property name.

relativeMember
   Answer the receiver class's species member used as a relative magnitude.

species
   Answer Amplitude.

examples

example
   Print a simple message to the transcript demonstrating the various types.


Class:            Position

Environment:      Siren
Superclass:         Siren.Positus
Category:         Music-Models-Representation

Instances of the Position species model the position of sound sources in room simulations or scores.
This class can be used as a concrete one (adding a few methods to fill it out), or like the other representational classes (making concrete classes of this species).
In the later case, the value instance variable could hold a number or point.

MetaClass:         Position class


Class:            Chroma

Environment:      Siren
Superclass:         Siren.MusicModel
Category:         Music-Models-Representation

Class Chroma is the abstract representational class for the pitch and mode-element species.
Instances of its subclass species are used to model pitches, gamut members, and frequencies.

MetaClass:         Chroma class


Class:            Pitch

Environment:      Siren
Superclass:         Siren.Chroma
Category:         Music-Models-Representation

Instances of classes whose species is Pitch 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.

MetaClass:         Pitch class

instance creation

value: aValue
   Answer a new instance of a member of my species.

class constants

color
   Answer the default color to display instances with.

initialize
   Set up the class inst var, a generality table.

initializeGenerality
   Set up the class inst var, a generality table.

mostGeneral
   Answer the most general-purpose duration--Hertz

propertyName
   Answer the receiver class's default property name.

relativeMember
   Answer the receiver class's species member used as a relative magnitude.

species
   Answer Pitch.

examples

example
   Print a simple message to the transcript demonstrating the various types.

exampleAdC
   Pitch exampleAdC


Class:            Chronos

Environment:      Siren
Superclass:         Siren.MusicModel
Category:         Music-Models-Representation

Class Chronos is the abstract representational class for the duration and meter species.
Instances of its subclass species are used to model times, durations and metronomes.

MetaClass:         Chronos class


Class:            Duration

Environment:      Siren
Superclass:         Siren.Chronos
Category:         Music-Models-Representation

Instances of classes whose species is Duration 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.

MetaClass:         Duration class

instance creation

value: aValue
   Answer a new instance of a member of my species.

class constants

color
   Answer the default color to display instances with.

initialize
   Set up the class inst var, a generality table.

initializeGeneralities
   Set up the class inst var, a generality table.

mostGeneral
   Answer the most general-purpose duration--seconds

propertyName
   Answer the receiver class's default property name.

relativeMember
   Answer the receiver class's species member used as a relative magnitude.

species
   Answer Duration.

examples

example
   Print a simple message to the transcript demonstrating the various types.


Class:            Meter

Environment:      Siren
Superclass:         Siren.Chronos
Category:         Music-Models-Representation

Instances of the Meter species model the tempo or metronome used to map durations.
This class can be used as a concrete one (adding a few methods to fill it out), or like the other representational classes (making concrete classes of this species).
In the later case, the value instance variable could hold a number, process or block.

MetaClass:         Meter class


Class:            ModeMember

Environment:      Siren
Superclass:         Siren.Chroma
Category:         Music-Models-Representation

Instances of the ModeMember species model pitches as elements of a mode (e.g., minor) or gamut (e.g., pentatonic on F).
This class can be used as a concrete one (adding a few methods to fill it out), or like the other representational classes (making concrete classes of this species).
In the later case, the value instance variable could hold a number or pitch, and the mode or gamut could be shared.

MetaClass:         ModeMember class


Music-Models-Implementation


Class:            OrdinalMagnitude

Environment:      Siren
Superclass:         Siren.MusicMagnitude
Category:         Music-Models-Implementation
Instance variables:   table
Class instance variables:   Table

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 Symbol> instance rel. table

Class Instance Variable:
   Table Symbol> class rel. table of all instances

accessing

hash
   Answer a SmallInteger unique to the receiver. Essential. See
   Object documentation whatIsAPrimitive.

table
   Answer the receiver's loop-up table--its or the class'.

value
   Signal an error.

value: theValue
   Signal an error.

initialize-release

release
   Release the receiver's table.

printing

printOn: aStream
   Print the receiver as an ordinal magnitude.

converting

mostGeneral
   Answer that it is an error to attempt coercion with ordinal magnitudes.

ordering

< anotherOMag
   Answer whether the receiver is less than the argument.

<< anotherOMag
   Specify that the receiver is less than the argument.

<= anotherOMag
   Answer whether the receiver is less than or equal to the argument.

=< anotherOMag
   Specify that the receiver is less than or equal to the argument.

== anotherOMag
   Specify that the receiver is equal to the argument.

=> anotherOMag
   Specify that the receiver is greater than or equal to the argument.

=? anotherOMag
   Answer whether the receiver is equal to the argument.

> anotherOMag
   Answer whether the receiver is greater than the argument.

>= anotherOMag
   Answer whether the receiver is greater than or equal to the argument.

>> anotherOMag
   Specify that the receiver is greater than the argument.

arithmetic

* aValue
   Answer that it is an error to attempt arithmetic with ordinal magnitudes.

+ aValue
   Answer that it is an error to attempt arithmetic with ordinal magnitudes.

- aValue
   Answer that it is an error to attempt arithmetic with ordinal magnitudes.

/ aValue
   Answer that it is an error to attempt arithmetic with ordinal magnitudes.

= aValue
   Answer whether the receiver and the argument are equivalent.

MetaClass:         OrdinalMagnitude class

Instance variables:   Table

table access

table
   Answer the class' instance look-up table.

values
   Answer the sorted values.

instance creation

new
   Answer a new instance and, if it's in use, add it to the table.

value: aValue
   Answer an instance

class initialization

flush
   Release the shared class table and all instances.

useTable
   Set up a shared class table for all instances.


Class:            NumericalMagnitude

Environment:      Siren
Superclass:         Siren.MusicMagnitude
Category:         Music-Models-Implementation

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.

double dispatching

adaptInteger: val
   

adaptToInteger
   

MetaClass:         NumericalMagnitude class


Class:            HertzPitch

Environment:      Siren
Superclass:         Siren.NumericalMagnitude
Category:         Music-Models-Implementation

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.

printing

printOn0: aStream
   Print the receiver as a pitch string in Hertz.

units
   Answer the units string of the receiver.

private

species
   Answer Pitch.

converting

asFracMIDI
   Assuming value is a frequency, Answer a fractional key number

asFracSymbol
   Assuming value is a frequency, answer a symbolic note name

asHertz
   Answer a HertzPitch.

asHz
   Answer a HertzPitch.

asMIDI
   Assuming value is a frequency, Answer a key number

asSymbol
   Assuming value is a frequency, answer a symbolic note name

MetaClass:         HertzPitch class

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            RatioMagnitude

Environment:      Siren
Superclass:         Siren.NumericalMagnitude
Category:         Music-Models-Implementation
Instance variables:   relative

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       the reference value

accessing

realValue
   Answer the receiver's value mapped to the receiver.

value
   Answer the receiver's value mapped to the receiver.

converting

asRatio
   Answer self.

map
   Apply the receivers reference.

relativeTo: aRelative
   Set the receivers reference.

MetaClass:         RatioMagnitude class

instance creation

value: aValue relative: aMMagnitude
   Answer and instance with the argument as its value.


Class:            RatioPitch

Environment:      Siren
Superclass:         Siren.RatioMagnitude
Category:         Music-Models-Implementation

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.

private

species
   Answer Pitch.

printing

printOn0: aStream
   Print the receiver as a ratio.

converting

asFracMIDI
   return a RatioPitch as a fractional MIDINote.

asFracSymbol
   Assuming value is a ratio, answer a symbolic note name

asHertz
   Answer a HertzPitch.

asMIDI
   return a RatioPitch as a MIDINote (rounded).

asSymbol
   Assuming value is a ratio, answer a symbolic note name

mostGeneral
   Answer the most numerically meaningful version of the receiver.

MetaClass:         RatioPitch class

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            RatioLoudness

Environment:      Siren
Superclass:         Siren.RatioMagnitude
Category:         Music-Models-Implementation

Instances of RatioLoudness are fractional amplitude values normally relative to the range 0 to 1.

private

species
   Answer Amplitude.

printing

printOn0: aStream
   Print the receiver as a ratio.

converting

asDB
   Answer a dB loudness; ratio 1 = 0dB, ratio 0.5 = -6dB, etc.

asMIDI
   Answer a MIDI key velocity (0 to 127)

asSymbol
   Answer a symbolic dynamic.

MetaClass:         RatioLoudness class

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            IntervalMagnitude

Environment:      Siren
Superclass:         Siren.NumericalMagnitude
Category:         Music-Models-Implementation
Class instance variables:   range

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. the actual range is a class inst var.

accessing

value: theValue
   Accept theValue, as the new instance variable 'value' -- perform range-checking

MetaClass:         IntervalMagnitude class

Instance variables:   range

class inst var access

range
   Answer the class' range.

range: anInterval
   Set the class' range.


Class:            ConditionalDuration

Environment:      Siren
Superclass:         Siren.MusicMagnitude
Category:         Music-Models-Implementation

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.
ConditionalDurations can be made dependents of other objects using the until: instance creation message.

See the class examples.

updating

update: anAspect with: aValue
   Respond to a change in the receiver's model

accessing

valueAt: anArg
   Answer the result of passing the argument to the receiver's block.

wait
   Cycle the receiver until the argument fulfills the receiver's block.

waitUntil: anArg
   Cycle the receiver until the argument fulfills the receiver's block.

private

species
   Answer Duration.

converting

mostGeneral
   It is an error to try this here--we implement what's ok for CDs

arithmetic

* aValue
   Answer that it is an error to attempt arithmetic with this magnitude.

+ aDuration
   Answer the sum of the receiver and the argument--the composition of two blocks

- aValue
   Answer that it is an error to attempt arithmetic with this magnitude.

/ aValue
   Answer that it is an error to attempt arithmetic with this magnitude.

MetaClass:         ConditionalDuration class

instance creation

on: aModel until: boolBlock
   Answer a new conditional duration whose value is the given block

randomBetween: lo and: hi
   Answer a new conditional duration whose value is between lo and hi (given in seconds)

until: boolBlock
   Answer a new conditional duration whose value is the given block

examples

example
   Print a simple message to the transcript demonstrating the various types.

exampleWithRands
   Demonstrate the random duration


Class:            Length

Environment:      Siren
Superclass:         Siren.OrdinalMagnitude
Category:         Music-Models-Implementation

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.

private

species
   Answer Duration.

MetaClass:         Length class

examples

example
   Demonstrate the use of an OrdinalMagnitude with a scale of length.


Class:            NominalMagnitude

Environment:      Siren
Superclass:         Siren.MusicMagnitude
Category:         Music-Models-Implementation
Class instance variables:   NameMap

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    Number or Interval)> the class' look-up table

MetaClass:         NominalMagnitude class

Instance variables:   NameMap

class instance variables

nameMap
   Answer the class instance variable NameMap.


Class:            SymbolicLoudness

Environment:      Siren
Superclass:         Siren.NominalMagnitude
Category:         Music-Models-Implementation

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.

printing

printOn0: aStream
   Print the receiver as a symbolic amplitude.

units
   Answer the units string of the receiver.

private

species
   Answer Amplitude.

converting

asDB
   Answer a dB loudness; ratio 1 = 0dB, ratio 0.5 = -6dB, etc.

asMIDI
   Answer a MIDIVelocity.

asRatio
   Answer a RatioLoudness.

asSymbol
   Answer a SymbolicLoudness.

mostGeneral
   Answer the most numerically meaningful version of the receiver.

MetaClass:         SymbolicLoudness class

class initialization

initialize
   Set up the class dynamic mapping dictionary

instance creation

fromMIDI: aValue
   Assuming value is a key velocity, answer a symbolic loudness name

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            Sharpness

Environment:      Siren
Superclass:         Siren.OrdinalMagnitude
Category:         Music-Models-Implementation

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.

private

species
   Answer Pitch.

MetaClass:         Sharpness class

examples

example
   Demonstrate the use of an OrdinalMagnitude with a scale of sharpness.


Class:            MIDIPitch

Environment:      Siren
Superclass:         Siren.IntervalMagnitude
Category:         Music-Models-Implementation

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 = 440/16).

Note that AdC's additions make fractional MIDI pitches possible, whereby the first 2 digits to the right of the decimal point signify pitch cents. There are coercion methods such as asFracMIDI for handling microtonal MIDI pitches.

printing

units
   Answer the units string of the receiver.

private

species
   Answer Pitch.

converting

asFracMIDI
   Answer a fractionalMIDIPitch (or integer if value is no fraction).

asFracSymbol
   Assuming value is a key number, answer a symbolic pitch name

asHertz
   Assuming value is a key number, answer a frequency

asHz
   Assuming value is a key number, answer a frequency

asMIDI
   Answer a MIDIPitch.

asSymbol
   Assuming value is a key number, answer a symbolic pitch name

mostGeneral
   Answer the most numerically meaningful version of the receiver.

MetaClass:         MIDIPitch class

class initialization

initialize
   Initialize the class instance variable.

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            DBLoudness

Environment:      Siren
Superclass:         Siren.RatioLoudness
Category:         Music-Models-Implementation

Instances of DBLoudness represent deciBel loudness values.

printing

units
   Answer the units string of the receiver.

double dispatch

differenceFromDynamic: aDyn
   Subtract the argument from the receiver after turning both into db.

differenceFromVelocity: aDyn
   Subtract the argument from the receiver after turning both into db.

productFromDynamic: aDyn
   Multiply the argument by the receiver after turning both into db.

productFromVelocity: aDyn
   Multiply the argument by the receiver after turning both into db.

quotientFromDynamic: aDyn
   Divide the argument by the receiver after turning both into db.

quotientFromVelocity: aDyn
   Divide the argument by the receiver after turning both into db.

sumFromDynamic: aDyn
   Add the argument to the receiver after turning both into db.

private

species
   Answer Amplitude.

converting

asMIDI
   Answer a MIDI key velocity (0 to 127)

asRatio
   Answer the receiver as a ratio between 0 and 1.

positiveDB
   Answer the zero-based positive dB value of the receiver.

MetaClass:         DBLoudness class

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            RatioDuration

Environment:      Siren
Superclass:         Siren.RatioMagnitude
Category:         Music-Models-Implementation

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.

printing

printOn0: aStream
   Print the receiver as a fractional duration.

units
   Answer the units string of the receiver.

private

species
   Answer Duration.

double dispatching

quotientFromInteger: numerator
   Answer a MM whose value is the argument over the receiver's value.

converting

asMS
   Answer a MSecondDuration.

asMsec
   Answer a MSecondDuration.

asSec
   Answer a SecondDuration.

asUsec
   Answer a USecondDuration.

asUseconds
   Answer a USecondDuration.

mostGeneral
   Answer the most numerically meaningful version of the receiver.

MetaClass:         RatioDuration class

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            SecondDuration

Environment:      Siren
Superclass:         Siren.NumericalMagnitude
Category:         Music-Models-Implementation

Instances of SecondDuration are duration times in floating-point seconds.
This is among the most general duration time representations.

printing

printOn: aStream
   Print the receiver on the argument as a MM declaration.

units
   Answer the units string of the receiver.

process delay

wait
   Delay for a time corresponding to the receiver

private

mostGeneral
   Answer the receiver in seconds.

species
   Answer Duration.

converting

adaptToFloat
   Answer a float of seconds.

asBeat
   Answer a RatioDuration.

asMS
   Answer a MSecondDuration.

asMsec
   Answer a MSecondDuration.

asMseconds
   Answer a MSecondDuration.

asRatio
   Answer a RatioDuration.

asSec
   Answer a float of seconds.

asSeconds
   Answer a float of seconds.

asUsec
   Answer a USecondDuration.

asUseconds
   Answer an int of micro seconds.

MetaClass:         SecondDuration class

-- all --

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            MSecondDuration

Environment:      Siren
Superclass:         Siren.SecondDuration
Category:         Music-Models-Implementation

Instances of MSecondDuration are duration times in milli-seconds.

printing

units
   Answer the units string of the receiver.

converting

asMseconds
   Answer a MSecondDuration.

asSeconds
   Answer a float of seconds.

asUseconds
   Answer a float of micro seconds.

MetaClass:         MSecondDuration class

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            USecondDuration

Environment:      Siren
Superclass:         Siren.SecondDuration
Category:         Music-Models-Implementation

Instances of USecondDuration are duration times in micro-seconds.
This is the default time representation (most general duration) and is usually used for keys in event lists.

printing

units
   Answer the units string of the receiver.

converting

asMseconds
   Answer a MSecondDuration.

asSeconds
   Answer a float of seconds.

asUseconds
   Answer a float of micro seconds.

MetaClass:         USecondDuration class


Class:            SymbolicPitch

Environment:      Siren
Superclass:         Siren.NominalMagnitude
Category:         Music-Models-Implementation
Instance variables:   fracPitch

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.

Instance Variables:
   fracPitch the remainder for microtonal tunings

The class instance variable NameMap is used for the name <--> MIDI key number mapping array.

printing

printOn0: aStream
   Print the receiver as a symbolic pitch.

units
   Answer the units string of the receiver.

arithmetic

+ aValue
   Answer the sum of the receiver and the argument-handle adding Integers as a special case.

- aValue
   Answer the sum of the receiver and the argument-handle adding Integers as a special case.

transposeBy: aValue
   transpose a SymbolicPitch by aValue in fractional halfsteps

private

species
   Answer Pitch.

converting

asFracMIDI
   Assuming value is a symbolic note name, answer a key number.

asHertz
   assuming value is a symbolic note name, return a frequency

asHz
   assuming value is a symbolic note name, return a frequency

asMIDI
   Assuming value is a symbolic note name, answer a key number.

asSymbol
   Answer a SymbolicPitch.

mostGeneral
   Answer the most numerically meaningful version of the receiver.

accessing

accidental
   Answer the receiver's accidental, if any.

fracPitch
   return microtonal offset as fractions of a halfstep

fracPitch: aValue
   set microtonal offset as fractions of a halfstep

MetaClass:         SymbolicPitch class

class initialization

initialize
   Set up the class name mapping array.

instance creation

fromFracMIDI: aValue
   Assuming value is a key number, answer a symbolic pitch name

fromMIDI: aValue
   Assuming value is a key number, answer a symbolic pitch name

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            MIDIVelocity

Environment:      Siren
Superclass:         Siren.IntervalMagnitude
Category:         Music-Models-Implementation

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.

accessing

value: theValue
   Truncate

printing

printOn0: aStream
   Print the receiver as a MIDI velocity.

units
   Answer the units string of the receiver.

private

species
   Answer Amplitude.

converting

asDB
   Answer a dB loudness; ratio 1 = 0dB, ratio 0.5 = -6dB, etc.

asMIDI
   Answer a MIDIVelocity.

asRatio
   Answer a RatioLoudness.

asSymbol
   Answer a symbolic loudness.

mostGeneral
   Answer the most numerically meaningful version of the receiver.

MetaClass:         MIDIVelocity class

class initialization

initialize
   Initialize the class instance variable.

coercion

ddMsgName
   Answer the selector to be used in coercing double-dispatching messages.


Class:            MeasureDuration

Environment:      Siren
Superclass:         Siren.NumericalMagnitude
Category:         Music-Models-Implementation
Instance variables:   timeSignature

A MeasureDuration reprsents time as beats and measures.

It is partially implemented and unused.

Instance Variables:
   timeSignature    my time signature

printing

units
   Answer the units string of the receiver.

private

species
   Answer Duration.

MetaClass:         MeasureDuration class


Music-Events


Class:            AbstractEvent

Environment:      Siren
Superclass:         Object
Category:         Music-Events
Instance variables:   properties

AbstractEvent is the base class in the event/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    property list dictionary

The global dictionary called Events can be used for sharing event instances.

accessing

, anArgument
   Add the argument as a property of the receiver.

date
   Answer the receiver's 'date'.

date: obj
   Set the receiver's 'date'.

inspect
   Inspect the receiver--Use a special inspector for Event types

name
   Answer the receiver's 'name'.

open
   Edit, play (if ) or inspect (if ) the receiver, depending on the keyboard state

species
   Answer AEvent--all subclasses look like me

version
   Answer the receiver's 'version'.

version: obj
   Set the receiver's 'version'.

printing

asExplorerString: showHide
   

display: showHide field: filter on: stream
   

displayField: filter on: stream
   

printOn: aStream
   Format and print the receiver on the argument.

storeOn: aStream
   Format and store the source the receiver on the argument.

templateFields
   Answer the field names for the instances of the receiver class.

scheduling

scheduleOn: aChannel
   Perform or interpret the receiver on the argument; override in subclasses.

properties

at: aProp
   Answer a value from the property list dictionary (or an instVar).

at: aProp ifAbsent: otherCase
   Answer a value from the property list dictionary or the value of the given block.

at: aProp put: aVal
   Set a value in the receiver's property list dictionary (or instVar).

doesNotUnderstand: aMessage
   Handle doesNotUnderstand: to try to access the property dictionary.
   If this is unsuccessful, announce that the receiver does not understand the argument.

hasProperty: aSymbol
   Answer whether or not the receiver's property list dictionary includes the symbol as a key.

properties
   Answer the receiver's property list dictionary.

respondsTo: aSymbol
   Answer whether the method dictionary of the receiver's class contains
   aSymbol as a message selector OR if the selector is unary and is a key
   in the receiver's property dictionary.

initialize-release

initialize
   Set up the default state of the receiver--add props. dict.

release
   Flush the receiver.

private

propCheck
   Make sure the receiver has a property list dictionary.

testing

isEvent
   Answer true.

isSound
   Answer false.

comparing

= anObject
   Answer whether the receiver and the argument represent the same values.

MetaClass:         AbstractEvent class

examples

eventInspectExample
   Demonstrate the creation of an AEvent.

example
   Demonstrate the creation of an AEvent.


Class:            DurationEvent

Environment:      Siren
Superclass:         Siren.AbstractEvent
Category:         Music-Events
Instance variables:   duration index startedAt realTime

Instances of DurationEvent are events that have special slots for their duration and voice properties.

Instance variables:
   duration duration--a relative time

accessing

ampl
   Answer the receiver's ampl

dur
   Answer the receiver's duration.

dur: newValue
   Set the receiver's duration.

duration
   Answer the receiver's duration.

duration: newValue
   Set the receiver's duration.

index: aNumber
   Set the receiver's event index.

order
   Answer the receiver's order.

order: anOrder
   Set the receiver's order.

pitch
   Answer the receiver's pitch

voice
   Answer the receiver's voice or some reasonable default.

voice: aValue
   Set the receiver's voice to the argument.

printing

printOn: aStream
   Format and print the receiver on the argument.

storeOn: aStream
   Format and store the source the receiver on the argument.

scheduling

isActive
   Answer whether the receiver is in a schedule

nextTime: ignored
   Answer whether to reschedule the receiver

play
   Play the receiver by scheduling it.

playAt: aTime
   Play the receiver on its voice then.

playOn: aVoice at: aTime
   This is a no-op in the abstract class

reset
   Reset the receiver's index.

scheduleAt: aTime
   Play the receiver on its voice then.

comparing

= anObject
   Answer whether the receiver and the argument represent the same values.

initialize-release

initialize
   Set up the default state of the receiver--add props. dict.

MetaClass:         DurationEvent class

examples

eventInspectExample
   Demonstrate the creation of a DEvent.

example
   Demonstrate the creation of a DEvent.

instance creation

dur: aD voice: aVoice
   Answer a DurationEvent instance initialized with the arguments.


Class:            MusicEvent

Environment:      Siren
Superclass:         Siren.DurationEvent
Category:         Music-Events
Instance variables:   pitch loudness voice

Instances of class MusicEvent are concrete musical note event objects used for eventLists and eventGenerators.

Instance variables:
   pitch the pitch/frequency
   loudness the loudness/amplitude
   voice voice--a voice or key

accessing

ampl
   Answer the receiver's loudness

ampl: aValue
   Set the receiver's loudness to the argument.

amplitude
   Answer the receiver's loudness

amplitude: aValue
   Set the receiver's loudness to the argument.

loudness
   Answer the receiver's loudness

loudness: aValue
   Set the receiver's loudness to the argument.

pitch
   Answer the receiver's pitch

pitch: aValue
   Set the receiver's pitch to the argument.

voice
   Answer the receiver's voice

voice: aValue
   Set the receiver's voice to the argument.

processing

transposeBy: aStep
   Add the given step to the receiver's pitch.

printing

printOn: aStream
   Format and print the receiver on the argument.

printTerseOn: aStream
   Format and print the receiver on the argument as tersely as possible.

printVerboseOn: aStream
   Format and print the receiver on the argument.

readDataFrom: aDataStream size: size
   Read a new event from the given stream using the compact format.

storeDataOn: aDataStream
   Store myself on a DataStream. Answer self.

storeOn: aStream
   Format and store the source the receiver on the argument.

comparing

= anObject
   Answer whether the receiver and the argument represent the same values.

scheduling

playOn: aVoice at: aTime
   Play the receiver on the voice then.

MetaClass:         MusicEvent class

instance creation

ampl: anA voice: aVoice
   Answer a MusicEvent instance initialized with the arguments.

dur: aD ampl: anA voice: aVoice
   Answer a MusicEvent instance initialized with the arguments.

dur: aD pitch: aP
   Answer a MusicEvent instance initialized with the arguments.

dur: aD pitch: aP ampl: anA
   Answer a MusicEvent instance initialized with the arguments.

dur: aD pitch: aP ampl: anA voice: aVoice
   Answer a MusicEvent instance initialized with the arguments.

dur: aD pitch: aP voice: aVoice
   Answer a MusicEvent instance initialized with the arguments.

dur: aD voice: aVoice ampl: anA
   Answer a MusicEvent instance initialized with the arguments.

duration: aD pitch: aP
   Answer a MusicEvent instance initialized with the arguments.

duration: aD pitch: aP ampl: anA
   Answer a MusicEvent instance initialized with the arguments.

pitch: aP
   Answer a MusicEvent instance initialized with the argument.

pitch: aP ampl: anA voice: aVoice
   Answer a MusicEvent instance initialized with the arguments.

class initialization

initialize
   Initialize the global dictionary of Events (optional).

initializeEventDictionary
   Initialize the global dictionary of Events (optional).

examples

eventInspectExample
   Demonstrate the terse format of event description.

example
   Demonstrate the terse format of event description.


Class:            EventList

Environment:      Siren
Superclass:         Siren.MusicEvent
Category:         Music-Events
Instance variables:   events

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 MEvent)>
            the list's events, time/event associations sorted by relative start times
   index the current position (used in scheduling)
   startedAt the clock value when I sterted

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.

accessing

addModifier: aModifier
   Add the given event modifier to the receiver's special modifier collection

code
   Answer a symbol about the receiver's events' coding, usually #durations or #noteOnOff

code: aSymbol
   Set the code about the receiver's events, usually #durations or #noteOnOff

deepCopy
   Answer a careful deep copy.

defaultEventClass
   Answer the default note event class.

name
   Answer the receiver's name.

name: aName
   Set the receiver's name.

next
   Answer the next event in the list.

removeModifier: aModifier
   Remove the given event modifier from the receiver's collection.

shallowCopy
   Answer a shallow copy of the receiver's events.

size
   Answer the number of events in the receiver.

tempo: someValue
   Set the tempo to scale the events by.

voices
   Answer the collection of voices used by thereceiver event list.

code conversion

continueProperties
   Fill in missing properties with values that are continued from previous ones.

findNoteOff: anAssociation
   Locate the noteOff event that corresponds to anAssociation; answer the sum of the delta times between (the duration)

setDurations
   Take a delta-time encoded event list and determine the durations.

collecting

collect: aBlock
   Iterate over the receiver's events with the given block

collectAll: aBlock
   Iterate over the receiver's events with the given block

do: aBlock
   Iterate over the receiver's event associations with the given block

eventsDo: aBlock
   Iterate over the receiver's events with the given block

excerptFrom: start to: end
   Answer a hierarchical list delineated by the given times.

expanded
   Expand all sub-event lists and answer one large flat list.

expandedFrom: start to: end
   Expand all sub-event lists and answer one flat list with events between the given times.

group: selection
   Group the argument's events as a sub-event list in the receiver's list.

includes: anAss
   Answer whether the given association is in the receiver's event list.

keysAndValuesDo: aBlock
   

remove: anA
   Remove the given event from the receiver's collection

select: aBlock
   Iterate over the receiver's events with the given block

selectAll: aBlock
   Iterate over the receiver's events with the given block

selectKey: aBlock
   Iterate over the receiver's events with the given block

selectValue: aBlock
   Iterate over the receiver's events with the given block

timesDo: aBlock
   Iterate over the receiver's events' relative start times with the given block

printing

asExplorerString
   

asExplorerString: ignored
   

printOn: aStream
   Print out the receiver's events on the argument.

readDataFrom: aDataStream size: size
   Read a new event list from the given stream using the compact format.

storeDataOn: aDataStream
   Store myself on a DataStream. Answer self.

storeOn: aStream
   Store source code for the receiver's events on the argument.

storeOnFile: aName
   Store out the receiver's events on the file named by the argument.

templateFields
   Answer the field names for the instances of the receiver class.

processing

addValue: theValue toProp: theSelector
   Add theValue to the aspect refered to by theSelector of all events.

applyBlock: theBlock toProp: theSelector
   Apply the given block to the aspect refered to by theSelector of all events.

applyFunction: aFunction to: aSelector
   Apply the given function to the range of the given selector

applyFunction: aFunction to: aSelector startingAt: sTime
   Apply the given function to the range of the given selector starting at sTime.

chooseRange: theRange toProp: theSelector
   Select a value from the given range for the aspect refered to by theSelector of all events.

edit
   Open your favorite graphical editor on the receiver (left-shift-sensitive)

scale: theSelector by: theValue
   Multiply the aspect refered to by theSelector of all events by theValue.

scaleStartTimesBy: theValue
   Multiply the start times all events by theValue.

scaleValue: theValue toProp: theSelector
   Multiply the aspect refered to by theSelector of all events by theValue.

setValue: theValue toProp: theSelector
   Set the aspect refered to by theSelector of all events to theValue.

spreadValue: theRandomPercent toProp: theSelector
   Spread the given property of all events by the given random range (%+-).

testing

hasItems
   Answer whether or not the receiver has items or components (true).

isEmpty
   Answer whether the receiver is an event list (true).

isEventList
   Answer whether the receiver is an event list (true).

species
   Answer EventList.

scheduling

loop
   Play the event list by passing it off to the event scheduler.

nextTime: now
   Answer the time of the next appointment

nextTimeFor: ass
   Answer the time delay between the given event association and the one that follows it.

play
   Play the event list by passing it off to the event scheduler.

playOn: aVoice
   Play the event list on the voice by expanding its events

playOn: aVoice at: startTime
   Play the event list on the voice by expanding its events

scheduleAt: aTime
   Expand an eventList for the appointment scheduler.

stop
   Play the event list by passing it off to the event scheduler.

initialize-release

empty
   Throw away the receiver's events.

initializeAnonymous
   Initialize an un-named instance with default state.

initializeNamed: aName
   Initialize a named instance with default state.

release
   Flush the receiver.

event accessing

, anEorA
   Add a new event or association to the receiver.

add: anEorA
   Add a new event or association to the receiver.

add: anEvent at: aTime
   Add a new event to the receiver at the given relative start time.

addAll: anEventList
   Add the given event list's events to the receiver.

eventKeys
   Answer the keys (durations) of the receiver's eventDictionary.

eventNear: aPoint
   Answer an event within a reasonable distance (100 msec.) of the given point's x.

eventNearestTime: aTime
   Answer an event within a reasonable distance (32 msec.) of the given point.

eventNearTime: aTime
   Answer an event within a reasonable distance (32 msec.) of the given point.

events
   Answer the receiver's eventDictionary.

events: anEL
   Set the receiver's eventDictionary.

eventValues
   Answer the values (events) of the receiver's eventDictionary.

recomputeDuration
   Recompute the total duration of the receiver.

private

map: anAssociation
   Map the receiver's special properties and/or eventModifiers onto the given event.

map: anAssociation at: startTime
   Map the receiver's special properties and/or eventModifiers onto the given event.

comparing

= anObject
   Answer whether the receiver and the argument represent the same events.

MetaClass:         EventList class

examples

creationExamples
   Select the expressions below one-at-a-time and inspect the results.

randomExample
   Create an event list with random data.

randomExample: length
   Create an event list with random data.

randomExample: length from: data
   Create an event list with random data.

randomSWSSExample
   Create an event list with random data appropriate for software sound synthesis.

randomSWSSExample2
   Create an event list with random data appropriate for software sound synthesis.

scaleExample2
   Answer a scale where the event property types are mixed.

scaleFrom: start to: stop in: dur
   Answer an event list with a scale.

sentenceExample
   Create an event list for a beautiful sentence.

serialExample: length from: data
   Create an event list with serial data.

wordExample
   Create an event list for a long word.

class initialization

flush
   Erase the shared EventList dictionary and try to clean up all events.

initialize
   Initialize the shared EventList dictionary.

storeAll
   Write out all event lists.

named constants

named: aName
   Answer the named instance from the dictionary or a new EL.

named: aName ifAbsent: theBlock
   Answer the named instance from the dictionary or the result of the block.

namedLists
   Answer the dictionary of named event lists.

newNamed
   Answer the named instance with a temp name.

newNamed: aName
   Create and answer a new named (and stored) instance.

nextName
   Answer a gensym-type ('te6') event list name for which no EL exists in the dictionary.

instance creation

basicNew: ignored
   Create and answer a new default-named instance of me

fromFile: theName
   Create and answer a new default un-named (and therefore un-persistent) instance of me

named: myName fromPitches: pitchCollection
   Answer an event list made with the given collection of pitches.

named: myName fromSelectors: selArray values: valueArrayArray
   Answer an event list made with the given collection of values applied to the given array of selectors.

named: myName fromStartTimes: timeCollection
   Answer an event list with the given collection of relative start times.

new
   Create and answer a new default-named instance of me

new: ignored
   Create and answer a new default-named instance of me

newAnonymous
   Create and answer a new default un-named (and therefore un-persistent) instance of me


Class:            ActionEvent

Environment:      Siren
Superclass:         Siren.DurationEvent
Category:         Music-Events
Instance variables:   action
Indexed variables:   objects

An instance of ActionEvent evaluates a Smalltalk block when scheduled.

Instance variables:
   action Something to do

scheduling

play
   Play the receiver by executing its action block.

playAt: aTime
   Play the receiver by executing its action block.

accessing

action
   Answer the receiver's 'action'.

action: anObject
   Set the receiver's instance variable 'action' to be anObject.

MetaClass:         ActionEvent class

examples

eventExample
   Demonstrate the creation of an ActionEvent.

listExample
   Demonstrate the creation of an ActionEvent by making a list of events that draw rectangles on the top window.

playExample
   Demonstrate the performance of a list of ActionEvents.

instance creation

dur: aD action: actionBlock
   Answer an ActionEvent instance initialized with the arguments.

dur: aD block: actionBlock
   Answer an ActionEvent instance initialized with the arguments.


Music-EventGenerators


Class:            EventGenerator

Environment:      Siren
Superclass:         Siren.EventList
Category:         Music-EventGenerators

This class is the parent of most of the simple music-structure 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.

playing

edit
   edit me

eventList
   Answer an eventList for the receiver.

play
   Play the receiver's event list.

MetaClass:         EventGenerator class

accessing instances

all
   Find the and return instances of me or any subclasses of me.

allPlaying
   Find all playing instances of me or my subclasses.

named: aName
   Find the named instance of me or a subclass of me.

stopAll
   Find all playing instances of me or my subclasses and terminate them.

examples

randomExample
   Play random examples from the set of examples in my subclasses


Class:            Cloud

Environment:      Siren
Superclass:         Siren.EventGenerator
Category:         Music-EventGenerators
Instance variables:   density

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 of notes per second

accessing

density: theDensity
   set the density instance variable

playing

eventList
   Make the cloud's events; assume that the receiver's pitch, loudness and
   durations are actually intervals

eventList0
   Make the cloud's events; assume that the receiver's pitch, loudness and
   durations are actually intervals

MetaClass:         Cloud class

examples

dictionaryExample
   Answer an initialized Cloud generated from the given property map dictionary.

example1
   Create and edit a low 6 second stochastic cloud with 5 events per second

randomExample
   Play a stochastic cloud with random properties.

randomExample2
   Play a stochastic cloud with random properties.

instance creation

dur: aD pitch: aP ampl: anA
   return an initialized Cloud

dur: aD pitch: aP ampl: anA voice: aVoice
   return an initialized Cloud

dur: aD pitch: aP ampl: anA voice: aVoice density: aDe
   return an initialized Cloud

dur: aD voice: aVoice density: aDe
   return an initialized Cloud

fromDictionary: aDictionary
   Answer an initialized Cloud generated from the given property map dictionary.


Class:            Peal

Environment:      Siren
Superclass:         SequenceableCollection
Category:         Music-EventGenerators
Instance variables:   base directions position finished
Indexed variables:   objects

Peals are repetitive note-generating sequences.
This implementation was written by Mark Lentczner in 1986.

Instance variables:
   base the pitches i use
   directions the direction of the current sub-sequence
   position the current index
   finished an i done?

playing

eventList
   

play
   

playOn0: out durations: dur meter: mtr at: start
   Play the receiver

playOn: vox
   

playOn: out durations: dur meter: mtr at: start
   Play the receiver

accessing

at: index
   Answer the element in the base collection currently mapped into the index position.

at: index put: object
   

currentChange
   Answer the base as mapped by the current change.

finished
   Answer is the peal has completed it's last change

setBase: baseSet
   Initialize the base set and everything else.

size
   Redone here because SequencableCollection overrides it.

private

changeOrder: n bounds: range
   Produce the next change in the peal by moving the element n within the range. If the element wants to move outside the range, alter it's direction and move the next element (recursively call this).

indexOfElement: n</