class RBMusic::Scale
Attributes
degrees[R]
key[R]
Public Class Methods
new(key, name)
click to toggle source
# File lib/rb-music/scale.rb, line 7 def initialize(key, name) scale_name = name.to_sym raise ArgumentError unless NOTES.has_key?(key) raise ArgumentError unless SCALES.has_key?(scale_name) @key = key @degrees = [:unison] + SCALES[scale_name] end
Public Instance Methods
degree_count()
click to toggle source
# File lib/rb-music/scale.rb, line 15 def degree_count @degree_count ||= @degrees.size end
notes_in_range(start_note, end_note)
click to toggle source
# File lib/rb-music/scale.rb, line 19 def notes_in_range(start_note, end_note) raise ArgumentError unless start_note.is_a?(Note) && end_note.is_a?(Note) NoteSet.new() end