De-click External Sends

This commit is contained in:
Robin Gareus 2025-11-27 01:31:27 +01:00
parent 6a5215db37
commit de042dcde7
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 16 additions and 3 deletions

View file

@ -322,7 +322,11 @@ Delivery::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample
{
assert (_output);
if (!check_active()) {
/* Do not use check_active() here, because we need to continue running
* until the gain has gone to zero.
*/
if (!_active && !_pending_active) {
_output->silence (nframes);
return;
}
@ -347,6 +351,11 @@ Delivery::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample
// which cannot do this.
tgain = target_gain ();
const bool converged = fabsf (_current_gain - tgain) < GAIN_COEFF_DELTA;
if (converged) {
_active = _pending_active;
}
if (tgain != _current_gain) {
/* target gain has changed */

View file

@ -151,7 +151,7 @@ Send::deactivate ()
samplecnt_t
Send::signal_latency () const
{
if (!_pending_active) {
if (!_pending_active && !_active) {
return 0;
}
if (_delay_out > _delay_in) {
@ -242,7 +242,11 @@ Send::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_sample, do
return;
}
if (!check_active()) {
/* Do not use check_active() here, because we need to continue running
* until the gain has gone to zero.
*/
if (!_active && !_pending_active) {
_meter->reset ();
_output->silence (nframes);
return;