Class: Beeps::Envelope

Inherits:
Object
  • Object
show all
Defined in:
lib/beeps/processor.rb

Instance Method Summary collapse

Constructor Details

#initialize(attack = nil, decay = nil, sustain = nil, release = nil, *args, **kwargs, &block) ⇒ Envelope

Returns a new instance of Envelope.



133
134
135
136
137
138
139
140
141
142
143
# File 'lib/beeps/processor.rb', line 133

def initialize(
  attack = nil, decay = nil, sustain = nil, release = nil,
  *args, **kwargs, &block)

  attack_time   attack  if attack
  decay_time    decay   if decay
  sustain_level sustain if sustain
  release_time  release if release

  super(*args, **kwargs, &block)
end

Instance Method Details

#note_off(delay = 0) ⇒ Object



149
150
151
# File 'lib/beeps/processor.rb', line 149

def note_off(delay = 0)
  note_off! delay
end

#note_on(delay = 0) ⇒ Object



145
146
147
# File 'lib/beeps/processor.rb', line 145

def note_on(delay = 0)
  note_on! delay
end