Class: Archaeopteryx::Mix

Inherits:
Object
  • Object
show all
Defined in:
lib/mix.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Mix



3
4
5
# File 'lib/mix.rb', line 3

def initialize(attributes)
  @rhythms = attributes[:rhythms]
end

Instance Method Details

#mutate(measure) ⇒ Object

Haskell style! Lisp style?! Recursion style! def notes(beat)

notes = []
@rhythms.each do |rhythm|
  notes << rhythm.notes(beat)
end

end



20
21
22
# File 'lib/mix.rb', line 20

def mutate(measure)
  @rhythms.each {|rhythm| rhythm.mutate(measure)}
end

#notes(beat) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/mix.rb', line 6

def notes(beat)
  notes = []
  @rhythms.each do |rhythm|
    notes << rhythm.notes(beat)
  end
  notes.flatten
end