Method: AudioStream::Fx::Chorus#initialize
- Defined in:
- lib/audio_stream/fx/chorus.rb
#initialize(soundinfo, depth: 100, rate: 4) ⇒ Chorus
Returns a new instance of Chorus.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/audio_stream/fx/chorus.rb', line 7 def initialize(soundinfo, depth: 100, rate: 4) @depth = depth @rate = Rate.sec(rate) @delaybufs = [ RingBuffer.new(@depth * 3, 0.0), RingBuffer.new(@depth * 3, 0.0) ] @phase = 0 @speed = @rate.sample_phase(soundinfo) end |