diff options
author | Robin Gareus <robin@gareus.org> | 2015-11-18 14:29:13 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-11-18 14:29:13 +0100 |
commit | 1c83df80db4ccea14a9c0d0722cb2393c502dd6e (patch) | |
tree | 5444c4b976f3cdd7a3c2541e35aa79f41ad08074 /libs/ardour/audioregion.cc | |
parent | abb76fd9947651187fdd6cfb74daf1cb7380f0da (diff) |
reduce math weirdness (thanks to Steven Yi)
Diffstat (limited to 'libs/ardour/audioregion.cc')
-rw-r--r-- | libs/ardour/audioregion.cc | 6 |
1 files changed, 2 insertions, 4 deletions
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<Evoral::ControlList> 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); } |