Class: MTK::Sequencers::StepSequencer
- Defined in:
- lib/mtk/sequencers/step_sequencer.rb
Overview
A Sequencer which has a constant #step_size time between Events::Timeline entries.
Instance Attribute Summary collapse
-
#step_size ⇒ Object
The time between entries in the Events::Timeline.
Attributes inherited from Sequencer
#event_builder, #max_steps, #max_time, #patterns, #step, #time
Instance Method Summary collapse
-
#advance ⇒ Object
protected
Advance @time to the next time for the Events::Timeline being produced by MTK::Sequencers::Sequencer#to_timeline.
-
#initialize(patterns, options = {}) ⇒ StepSequencer
constructor
A new instance of StepSequencer.
Methods inherited from Sequencer
Constructor Details
#initialize(patterns, options = {}) ⇒ StepSequencer
Returns a new instance of StepSequencer.
10 11 12 13 |
# File 'lib/mtk/sequencers/step_sequencer.rb', line 10 def initialize(patterns, ={}) super @step_size = .fetch :step_size, 1 end |
Instance Attribute Details
#step_size ⇒ Object
The time between entries in the Events::Timeline.
8 9 10 |
# File 'lib/mtk/sequencers/step_sequencer.rb', line 8 def step_size @step_size end |
Instance Method Details
#advance ⇒ Object (protected)
Advance @time to the next time for the Events::Timeline being produced by MTK::Sequencers::Sequencer#to_timeline
19 20 21 |
# File 'lib/mtk/sequencers/step_sequencer.rb', line 19 def advance @time += @step_size end |