class Scale

Public Class Methods

build(*arr) click to toggle source
# File lib/chord_finder/scale.rb, line 2
def self.build(*arr)
  notes =
    arr.flat_map.with_index { |names, position|
      names.split("|").map { |name| Note.new(name, position) } }
  new(notes)
end

Public Instance Methods

[](idx) click to toggle source
Calls superclass method
# File lib/chord_finder/scale.rb, line 9
def [] idx
  return super(idx % size) if idx.is_a? Fixnum
  super(idx)
end
find_note(name) click to toggle source
# File lib/chord_finder/scale.rb, line 14
def find_note(name)
  find { |note| note.name == name }
end