Class: MusicSetTheory::ScaleChordRow
- Inherits:
-
Object
- Object
- MusicSetTheory::ScaleChordRow
- Defined in:
- lib/music_set_theory/chord_generator.rb,
lib/music_set_theory/chord_generator.rb
Overview
Represents different rows (triads, 7ths, 9ths) in tabular representations of scale chords.
Instance Attribute Summary collapse
-
#chord_type ⇒ Object
Returns the value of attribute chord_type.
-
#notes ⇒ Object
Returns the value of attribute notes.
Instance Method Summary collapse
-
#initialize(chord_type) ⇒ ScaleChordRow
constructor
A new instance of ScaleChordRow.
- #to_a ⇒ Object
Constructor Details
#initialize(chord_type) ⇒ ScaleChordRow
Returns a new instance of ScaleChordRow.
203 204 205 206 |
# File 'lib/music_set_theory/chord_generator.rb', line 203 def initialize( chord_type ) self.chord_type = chord_type self.notes = [] end |
Instance Attribute Details
#chord_type ⇒ Object
Returns the value of attribute chord_type.
202 203 204 |
# File 'lib/music_set_theory/chord_generator.rb', line 202 def chord_type @chord_type end |
#notes ⇒ Object
Returns the value of attribute notes.
202 203 204 |
# File 'lib/music_set_theory/chord_generator.rb', line 202 def notes @notes end |
Instance Method Details
#to_a ⇒ Object
208 209 210 211 212 213 214 215 216 |
# File 'lib/music_set_theory/chord_generator.rb', line 208 def to_a # ret = "#{self.chord_type}:#{self.notes}" tmp = [] self.notes.each do |nt| tmp << [self.chord_type,] + nt.to_a end ret = tmp ret end |