Class: SynthBlocks::Core::OnePoleLP
- Inherits:
-
Object
- Object
- SynthBlocks::Core::OnePoleLP
- Defined in:
- lib/synth_blocks/core/one_pole_lowpass.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize ⇒ OnePoleLP
constructor
A new instance of OnePoleLP.
- #run(input, cutoff) ⇒ Object
Constructor Details
#initialize ⇒ OnePoleLP
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 |