Class: Coltrane::Theory::GreekMode
- 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
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Attributes inherited from Scale
Instance Method Summary collapse
-
#initialize(mode, tone) ⇒ GreekMode
constructor
A new instance of GreekMode.
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
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
4 5 6 |
# File 'lib/coltrane/theory/greek_mode.rb', line 4 def mode @mode end |