new Key(keyName, mode)
Create a Key object. Like a KeySignature but with ideas about Tonic, Dominant, etc.
TODO: allow keyName to be a music21.pitch.Pitch
TODO: Scale mixin.
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
keyName |
string |
|
|
mode |
string |
<optional> |
|
- Source:
Extends
Members
-
<readonly> alteredPitches :Array.<music21.pitch.Pitch>
-
An Array of Altered Pitches in KeySignature order (i.e., for flats, Bb, Eb, etc.)
Type:
- Array.<music21.pitch.Pitch>
- Inherited From:
- Source:
Example
var ks = new music21.key.KeySignature(3) var ap = ks.alteredPitches var apName = []; for (var i = 0; i < ap.length; i++) { apName.push(ap[i].name); } apName // ["F#", "C#", "G#"] -
<readonly> width :number
-
Gives the width in pixels necessary to represent the key signature.
Type:
- number
- Inherited From:
- Source:
Methods
-
<static> Key#getScale(scaleType) → {Object}
-
returns a
music21.scale.MajorScaleormusic21.scale.MinorScale
object from the pitch object.Parameters:
Name Type Argument Default Description scaleTypestring | undefined <optional>
this.mode the type of scale, or the mode.
- Source:
Returns:
A music21.scale.Scale subclass.
- Type
- object