Class: Coltrane::Theory::CircleOfFifths
- Inherits:
-
Object
- Object
- Coltrane::Theory::CircleOfFifths
- Defined in:
- lib/coltrane/theory/circle_of_fifths.rb
Constant Summary collapse
- LETTER_SEQUENCE =
%w[C G D A E B F].freeze
Instance Attribute Summary collapse
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
Instance Method Summary collapse
-
#initialize(start_note = Note['C'], size = Float::INFINITY) ⇒ CircleOfFifths
constructor
A new instance of CircleOfFifths.
Constructor Details
#initialize(start_note = Note['C'], size = Float::INFINITY) ⇒ CircleOfFifths
Returns a new instance of CircleOfFifths.
10 11 12 13 14 15 |
# File 'lib/coltrane/theory/circle_of_fifths.rb', line 10 def initialize(start_note = Note['C'], size = Float::INFINITY) index = letters.index(start_note.name[0]) @notes = fifths(note: start_note - Interval.perfect_fifth, size: size, index: (index - 1) % LETTER_SEQUENCE.size) end |
Instance Attribute Details
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
6 7 8 |
# File 'lib/coltrane/theory/circle_of_fifths.rb', line 6 def notes @notes end |