Class: Archaeopteryx::ScaleTraversalRhythm

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

Instance Method Summary (collapse)

Constructor Details

- (ScaleTraversalRhythm) initialize(attributes)



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

- (Object) map



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

def map
  @drums = @scale / arpeggio
end

- (Object) mutate(measure)



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

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

- (Object) notes(beat)



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