Class: Wavify::DSP::Effects::NoiseGate
- Inherits:
-
EffectBase
- Object
- EffectBase
- Wavify::DSP::Effects::NoiseGate
- Defined in:
- lib/wavify/dsp/effects/noise_gate.rb,
sig/effects.rbs
Overview
Simple downward gate for suppressing low-level noise.
Constant Summary
Constants inherited from EffectBase
Instance Method Summary collapse
-
#initialize(threshold: -40.0,, floor: -80.0,, attack: 0.001, hold: 0.02, release: 0.05, gain_attack: attack, gain_release: release) ⇒ NoiseGate
constructor
A new instance of NoiseGate.
Methods inherited from EffectBase
#apply, #build_runtime, #flush, #latency, #lookahead, #process, #process_sample, #reset, #tail_duration
Constructor Details
#initialize(threshold: -40.0,, floor: -80.0,, attack: 0.001, hold: 0.02, release: 0.05, gain_attack: attack, gain_release: release) ⇒ NoiseGate
Returns a new instance of NoiseGate.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wavify/dsp/effects/noise_gate.rb', line 10 def initialize(threshold: -40.0, floor: -80.0, attack: 0.001, hold: 0.02, release: 0.05, gain_attack: attack, gain_release: release) super() @threshold_db = validate_dbfs!(threshold, :threshold) @floor_db = validate_dbfs!(floor, :floor) @threshold = db_to_amplitude(@threshold_db) @floor_gain = db_to_amplitude(@floor_db) @gain_attack = validate_time!(gain_attack, :gain_attack) @gain_release = validate_time!(gain_release, :gain_release) @envelope_follower = EnvelopeFollower.new(attack: attack, hold: hold, release: release) reset end |