Class: Wavify::DSP::Effects::Expander
- Inherits:
-
EffectBase
- Object
- EffectBase
- Wavify::DSP::Effects::Expander
- Defined in:
- lib/wavify/dsp/effects/expander.rb,
sig/effects.rbs
Overview
Downward expander that reduces low-level material below a threshold.
Constant Summary
Constants inherited from EffectBase
Wavify::DSP::Effects::EffectBase::TAIL_CHUNK_FRAMES
Instance Method Summary collapse
-
#initialize(threshold: -40.0,, ratio: 2.0, floor: -80.0,, attack: 0.001, hold: 0.02, release: 0.05, gain_attack: 0.001, gain_release: 0.05) ⇒ Expander
constructor
A new instance of Expander.
Methods inherited from EffectBase
#apply, #build_runtime, #flush, #latency, #lookahead, #process, #process_sample, #reset, #tail_duration
Constructor Details
#initialize(threshold: -40.0,, ratio: 2.0, floor: -80.0,, attack: 0.001, hold: 0.02, release: 0.05, gain_attack: 0.001, gain_release: 0.05) ⇒ Expander
Returns a new instance of Expander.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wavify/dsp/effects/expander.rb', line 10 def initialize(threshold: -40.0, ratio: 2.0, floor: -80.0, attack: 0.001, hold: 0.02, release: 0.05, gain_attack: 0.001, gain_release: 0.05) super() @threshold_db = validate_dbfs!(threshold, :threshold) @ratio = validate_ratio!(ratio) @floor_db = validate_dbfs!(floor, :floor) @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 |