| Path: | app/models/scale.rb |
| Last Update: | Tue Mar 25 17:47:06 -0400 2008 |
A scale is an ordered collection of tones.
Scale objects should be created by indexing the Scale class directly:
Scale['Major']
An alternative method of resolving a chord is to use the resolve method, though this is likely to become deprecated in the future when chord progression support/representation is added:
Scale.resolve(name)
the only defined mode such as for the whole tone scale.
Each scale can have one or many modes, which really define the relationship to chords. Modes are accessible like so (all methods are equal):
Scale['Major']['Dorian'] Scale['Major'][2] Scale['Major'].modes['Dorian'] Scale['Major'].modes[2]
Scale['Major'].notes
# => ["C", "D", "E", "F", "G", "A", "B"]
Scale['Major'].in_key_of('Eb').notes
Scale['Eb Major'].notes # Same as above
# => ["Eb", "F", "G", "Ab", "Bb", "C", "D"]
Scale['Gb Major'].notes # => ["Gb", "Ab", "Bb", "Cb", "Db", "Eb", "F"] # Note the use of Cb which is theoretically correct over enharmonic B.
Also correctly interpet tones off of enharmonic base keys:
Scale['Gb Major'].notes # => ["Gb", "Ab", "Bb", "Cb", "Db", "Eb", "F"] Scale['F# Major'].notes # => ["F#", "G#", "A#", "B", "C#", "D#", "E#"]
Scale['Major'].modes['Dorian'] Scale['Major']['Dorian'] # Same as above # => ["D", "E", "F", "G", "A", "B", "C"] Scale['Melodic Minor'].modes['Super Locrian'].notes # => ["B", "C", "D", "Eb", "F", "G", "A"] # aka. Altered Scale or Dim. Whole Tone
Scale['Major'].chords.symbols # => ['maj7', 'maj6', '6/9'] Scale['Major']['Dorian'].chords.symbols # => ['min7', 'min6']