Class: Archaeopteryx::RhythmWithoutEval
- Inherits:
-
Object
- Object
- Archaeopteryx::RhythmWithoutEval
- Defined in:
- lib/rhythm_without_eval.rb
Instance Method Summary (collapse)
-
- (RhythmWithoutEval) initialize(attributes)
constructor
A new instance of RhythmWithoutEval.
- - (Object) mutate(measure)
- - (Object) notes(beat)
Constructor Details
- (RhythmWithoutEval) initialize(attributes)
A new instance of RhythmWithoutEval
3 4 5 6 |
# File 'lib/rhythm_without_eval.rb', line 3 def initialize(attributes) @mutation = attributes[:mutation] @drums = attributes[:drums] end |
Instance Method Details
- (Object) mutate(measure)
14 15 16 17 18 |
# File 'lib/rhythm_without_eval.rb', line 14 def mutate(measure) if @mutation[measure] @drums.each {|drum| drum.mutate} end end |
- (Object) notes(beat)
7 8 9 10 11 12 13 |
# File 'lib/rhythm_without_eval.rb', line 7 def notes(beat) drums = [] @drums.each do |drum| drums << drum.note if drum.play? beat end drums end |