Class: Archaeopteryx::ScaleTraversalRhythm

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ ScaleTraversalRhythm

Returns a new instance of ScaleTraversalRhythm



3
4
5
6
7
# File 'lib/scale_traversal_rhythm.rb', line 3

def initialize(attributes)
  @mutation = attributes[:mutation]
  @arpeggio = attributes[:arpeggio]
  @scale = attributes[:scale]
end

Instance Method Details

#mapObject



8
9
10
# File 'lib/scale_traversal_rhythm.rb', line 8

def map
  @drums = @scale / arpeggio
end

#mutate(measure) ⇒ Object



18
19
20
# File 'lib/scale_traversal_rhythm.rb', line 18

def mutate(measure)
  map if @mutation[measure]
end

#notes(beat) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/scale_traversal_rhythm.rb', line 11

def notes(beat)
  drums = []
  @drums.each do |drum|
    drums << drum.note if drum.play? beat
  end
  drums
end