Class: Archaeopteryx::ScaleTraversalRhythm
- Inherits:
-
Object
- Object
- Archaeopteryx::ScaleTraversalRhythm
- Defined in:
- lib/scale_traversal_rhythm.rb
Instance Method Summary (collapse)
-
- (ScaleTraversalRhythm) initialize(attributes)
constructor
A new instance of ScaleTraversalRhythm.
- - (Object) map
- - (Object) mutate(measure)
- - (Object) notes(beat)
Constructor Details
- (ScaleTraversalRhythm) initialize(attributes)
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
- (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 |