Method: AudioStream::Fx::Tremolo#process
- Defined in:
- lib/audio_stream/fx/tremolo.rb
#process(input) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/audio_stream/fx/tremolo.rb', line 14 def process(input) window_size = input.window_size streams = input.streams.map {|stream| stream.map.with_index {|f, i| f * (1.0 + @depth * Math.sin((i + @phase) * @period)) } } @phase = (@phase + window_size) % (window_size / @period) Buffer.new(*streams) end |