Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (29 sloc) 0.751 kb
module Archaeopteryx
class Rhythm
attr_accessor :beats
def initialize(attributes)
# @mutation = attributes[:mutation]
@drumfile = attributes[:drumfile]
@beats = attributes[:beats] || 16
reload
end
def reload
puts "\a" # flash the screen ; only valid on my box and similarly configured machines!
@drums = eval(File.read(@drumfile))
end
def notes(beat)
drums = []
@drums.each do |drum|
drums << drum.note if drum.play? beat
end
drums
end
def mutate(measure)
if $mutation[measure]
reload # reloading can kill mutations!
@drums.each {|drum| drum.mutate}
end
end
end
end
# probably rename this to make it drum-specific
Jump to Line
Something went wrong with that request. Please try again.