Constructor
new PitchClass(nameOrValue)
Parameters:
Name | Type | Description |
---|---|---|
nameOrValue |
number | string | a PitchClass numerical value or string name. |
- Source:
- See:
Example
// Constructing by name
new PitchClass('C')
new PitchClass('Db') // same as PitchClass('C#')
new PitchClass('D') // Same as PitchClass('C##') or PitchClass('Ebb')
new PitchClass('Db') // same as PitchClass('D#')
new PitchClass('E')
new PitchClass('F')
new PitchClass('Gb')
new PitchClass('G')
new PitchClass('Ab')
new PitchClass('A')
new PitchClass('Bb')
new PitchClass('B')
// Constructing by value
new PitchClass(0) // same as PitchClass('C') or PitchClass(12)
new PitchClass(1) // same as PitchClass('Db')
...
new PitchClass(11) // same as PitchClass('B')
Members
(static) NAMES
The canonical names of all pitch classes, indexed by their value. Note that some names have aliases. For example: "C#" is equivalent to "Db", and "Fbb" is equivalent to "Eb"
- Source:
(readonly) name :PitchClass
The canonical name of this PitchClass. See PitchClass.NAMES
Type:
- Source:
(readonly) value :Number
The number of semitones above C. Used to compute MIDI pitch values. This is always the canonical value in the range 0-11 (inclusive). Assigning this property will convert to the equivalent canonical value.
Type:
- Number
- Source: