Class: Negasonic::LoopedEvent::Sequence
- Inherits:
-
Object
- Object
- Negasonic::LoopedEvent::Sequence
- Defined in:
- lib/negasonic/looped_event/sequence.rb
Instance Method Summary collapse
-
#initialize(synth, segments = []) ⇒ Sequence
constructor
A new instance of Sequence.
- #play(*notes) ⇒ Object
- #start(duration) ⇒ Object
Constructor Details
#initialize(synth, segments = []) ⇒ Sequence
Returns a new instance of Sequence.
4 5 6 7 |
# File 'lib/negasonic/looped_event/sequence.rb', line 4 def initialize(synth, segments = []) @synth = synth @segments = segments end |
Instance Method Details
#play(*notes) ⇒ Object
15 16 17 |
# File 'lib/negasonic/looped_event/sequence.rb', line 15 def play(*notes) @segments << LoopedEvent.to_tone_notes(notes) end |
#start(duration) ⇒ Object
9 10 11 12 13 |
# File 'lib/negasonic/looped_event/sequence.rb', line 9 def start(duration) do_start(duration) do |time, note| @synth.trigger_attack_release(note, duration, time) end end |