mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-29 01:47:43 +01:00
reduce math weirdness (thanks to Steven Yi)
This commit is contained in:
parent
abb76fd994
commit
1c83df80db
1 changed files with 2 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue