Class: SynthBlocks::Core::OnePoleLP

Inherits:
Object
  • Object
show all
Defined in:
lib/synth_blocks/core/one_pole_lowpass.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeOnePoleLP

Returns a new instance of OnePoleLP.



4
5
6
# File 'lib/synth_blocks/core/one_pole_lowpass.rb', line 4

def initialize
  @outputs = 0.0
end

Instance Method Details

#run(input, cutoff) ⇒ Object



8
9
10
11
# File 'lib/synth_blocks/core/one_pole_lowpass.rb', line 8

def run(input, cutoff)
  p = (cutoff * 0.98) * (cutoff * 0.98) * (cutoff * 0.98) * (cutoff * 0.98);
  @outputs = (1.0 - p) * input + p * @outputs
end