diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2015-03-25 16:47:25 -0500 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-04-22 00:22:43 +0200 |
commit | 46f97e8d92241c94d12d81ea182a9172df98e61e (patch) | |
tree | f757e7014aa6260b7d927b35bcf1fd221e2d40e4 /libs/ardour/internal_send.cc | |
parent | 187ddb3bad70088f901ed1ea5e1402519fd393b4 (diff) |
Initial Gain Coefficient tweaks
1) Disambiguate 1.0 to GAIN_COEFF_UNITY, and 0.0 to GAIN_COEFF_ZERO
2) Add GAIN_COEFF_SMALL which replaces SMALL_SIGNAL (-140dB)
3) GAIN_COEFF_SMALL can used to avoid interpolating towards -inf on a db scale
4) GAIN_COEFF_SMALL is used to detect very small (denormal?) gains and memset to zero
Diffstat (limited to 'libs/ardour/internal_send.cc')
-rw-r--r-- | libs/ardour/internal_send.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index de5af0c6e2..e8e560c7c0 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -74,10 +74,10 @@ InternalSend::init_gain () { if (_role == Listen) { /* send to monitor bus is always at unity */ - _amp->set_gain (1.0, this); + _amp->set_gain (GAIN_COEFF_UNITY, this); } else { /* aux sends start at -inf dB */ - _amp->set_gain (0, this); + _amp->set_gain (GAIN_COEFF_ZERO, this); } } @@ -196,16 +196,16 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame _current_gain = Amp::apply_gain (mixbufs, _session.nominal_frame_rate(), nframes, _current_gain, tgain); - } else if (tgain == 0.0) { + } else if (tgain == GAIN_COEFF_ZERO) { /* we were quiet last time, and we're still supposed to be quiet. */ _meter->reset (); - Amp::apply_simple_gain (mixbufs, nframes, 0.0); + Amp::apply_simple_gain (mixbufs, nframes, GAIN_COEFF_ZERO); goto out; - } else if (tgain != 1.0) { + } else if (tgain != GAIN_COEFF_UNITY) { /* target gain has not changed, but is not zero or unity */ Amp::apply_simple_gain (mixbufs, nframes, tgain); @@ -220,7 +220,7 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame /* consider metering */ if (_metering) { - if (_amp->gain_control()->get_value() == 0) { + if (_amp->gain_control()->get_value() == GAIN_COEFF_ZERO) { _meter->reset(); } else { _meter->run (mixbufs, start_frame, end_frame, nframes, true); |