module Negasonic::LoopedEvent

Attributes

events[RW]

Public Class Methods

dispose_all() click to toggle source
# File lib/negasonic/looped_event.rb, line 13
def dispose_all
  @events.each(&:dispose)
  @events = []
end
start(looped_element) click to toggle source
# File lib/negasonic/looped_event.rb, line 18
def start(looped_element)
  looped_element.start(0)
  looped_element.loop = true
  @events << looped_element
end
to_tone_notes(notes) click to toggle source
# File lib/negasonic/looped_event.rb, line 24
def to_tone_notes(notes)
  notes.map do |note|
    if JS.typeof(note) == 'string'
      note
    else
      # is a midi note
      (2**((note-69)/12) * 440).to_f
    end
  end
end