Class: Synthesizer::Filter::Parallel::Fx

Inherits:
Object
  • Object
show all
Defined in:
lib/synthesizer/filter/parallel.rb

Instance Method Summary collapse

Constructor Details

#initialize(fxs) ⇒ Fx

Returns a new instance of Fx.



20
21
22
# File 'lib/synthesizer/filter/parallel.rb', line 20

def initialize(fxs)
  @fxs = fxs
end

Instance Method Details

#process(input) ⇒ Object



24
25
26
27
28
29
# File 'lib/synthesizer/filter/parallel.rb', line 24

def process(input)
  outputs = @fxs.map {|fx|
    fx.process(input)
  }
  AudioStream::Buffer.merge(outputs, average: true)
end