Class: MTK::Sequencers::LegatoSequencer

Inherits:
Sequencer
  • Object
show all
Defined in:
lib/mtk/sequencers/legato_sequencer.rb

Overview

A Sequencer which uses the longest duration of the events at each step to determine the delta times between entries in the Events::Timeline.

Instance Attribute Summary

Attributes inherited from Sequencer

#event_builder, #max_steps, #max_time, #patterns, #step, #time

Instance Method Summary collapse

Methods inherited from Sequencer

#initialize, #rewind, #to_timeline

Constructor Details

This class inherits a constructor from MTK::Sequencers::Sequencer

Instance Method Details

#advanceObject (protected)

Advance @time to the next time for the Events::Timeline being produced by Sequencer#to_timeline



17
18
19
# File 'lib/mtk/sequencers/legato_sequencer.rb', line 17

def advance
  @time += @previous_events.map{|event| event.length }.max
end

#nextObject

Note:

this is called automatically by Sequencer#to_timeline, so you can ignore this method unless you want to hack on sequencers at a lower level.

Advanced the step index and time, and return the next list of events built from the sequencer patterns.



9
10
11
# File 'lib/mtk/sequencers/legato_sequencer.rb', line 9

def next
  @previous_events = super
end