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