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