From 1c83df80db4ccea14a9c0d0722cb2393c502dd6e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 18 Nov 2015 14:29:13 +0100 Subject: reduce math weirdness (thanks to Steven Yi) --- libs/ardour/audioregion.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libs') diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 8f5228ad6a..ddd152bf0e 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -109,11 +109,9 @@ generate_db_fade (boost::shared_ptr dst, double len, int nu //generate a fade-out curve by successively applying a gain drop float fade_speed = dB_to_coefficient(dB_drop / (float) num_steps); + float coeff = GAIN_COEFF_UNITY; for (int i = 1; i < (num_steps-1); i++) { - float coeff = GAIN_COEFF_UNITY; - for (int j = 0; j < i; j++) { - coeff *= fade_speed; - } + coeff *= fade_speed; dst->fast_simple_add (len*(double)i/(double)num_steps, coeff); } -- cgit v1.2.3