class MusicTheory::Arpeggio

Attributes

all_notes[RW]
duration[RW]
output_file_name[RW]
third[RW]

Public Class Methods

new(third, options = {}) click to toggle source
# File lib/music_theory/arpeggio.rb, line 9
def initialize(third, options = {})
  @duration         = options[:duration] || 0.25
  @third            = third
  @output_file_name = options[:output_file_name] || 'chord' # File name to write (without extension)
end

Public Instance Methods

arpeggionate() click to toggle source
# File lib/music_theory/arpeggio.rb, line 15
def arpeggionate
   third.all_notes.each {|note| note.duration = duration}
   third.all_notes += [third.all_notes[2], third.all_notes[1], third.all_notes[0], third.all_notes[1]]
end
samples() click to toggle source
# File lib/music_theory/arpeggio.rb, line 20
def samples
  arpeggionate.map(&:samples).flatten
end