{:major => [4,7], :minor => [3,7], :five => [7], :sus2 => [2, 7], :sus4 => [5, 7], :aug => [4, 8], :dim => [3, 6], :minus5 => [4, 6]}
15 16 17 18 19 20
# File 'lib/chords/chord_factory.rb', line 15 def new_chord(root, key) raise "No chord with key #{key}" unless CHORDS.has_key?(key) notes = [root] notes += CHORDS[key].map{|interval| root + interval} Chord.new([key.to_s], notes) end