Class: MusicSetTheory::ScaleChordRow

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_typeObject

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

#notesObject

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_aObject



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