Class: Coltrane::Theory::GreekMode

Inherits:
Scale
  • Object
show all
Defined in:
lib/coltrane/theory/greek_mode.rb

Constant Summary collapse

MODES =
%w[
  Ionian
  Dorian
  Phrygian
  Lydian
  Mixolydian
  Aeolian
  Locrian
].freeze
LETTER_SEQUENCE =
%w[C D E F G A B].freeze

Constants included from ClassicScales

ClassicScales::SCALES

Instance Attribute Summary collapse

Attributes inherited from Scale

#interval_sequence, #tone

Instance Method Summary collapse

Methods inherited from Scale

#&, #==, #chords, #degree, #degree_of_chord, #degree_of_note, #degrees, #id, #include_notes?, #interval, #name, #notes, #pentads, #pretty_name, #progression, #sevenths, #size, #tertians, #triads

Methods included from ClassicScales

#fetch, #having_chords, #having_notes, #known_scales, #major, #minor, #standard_scales

Constructor Details

#initialize(mode, tone) ⇒ GreekMode

Returns a new instance of GreekMode.



18
19
20
21
22
23
24
25
26
27
# File 'lib/coltrane/theory/greek_mode.rb', line 18

def initialize(mode, tone)
  super name: mode.capitalize, notes: begin
    @mode = mode.to_s
    @tone = Note[tone]
    base_major_notes
    .rotate(mode_index)
    .zip(letter_sequence)
    .map { |(note, letter)| note.as(letter) }
  end
end

Instance Attribute Details

#modeObject (readonly)

Returns the value of attribute mode.



4
5
6
# File 'lib/coltrane/theory/greek_mode.rb', line 4

def mode
  @mode
end