mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 04:39:33 +01:00
Symmetric x-fade, use equivalent of -6dB per step for 7 steps.
This commit is contained in:
parent
2d82446f59
commit
7953df93bf
1 changed files with 2 additions and 6 deletions
|
|
@ -1035,9 +1035,7 @@ AudioRegion::set_fade_in (FadeShape shape, framecnt_t len)
|
|||
for (int i = 2; i < num_steps; i++) {
|
||||
const double offset = 1.0 - breakpoint;
|
||||
float coeff = 1.0 - breakpoint;
|
||||
for (int j = 0; j < i; j++) {
|
||||
coeff *= 0.5; //6dB drop per step
|
||||
}
|
||||
coeff *= powf(0.5, (i-1) * 7.0 / (double)num_steps); // -6dB per step for 7 steps
|
||||
_fade_in->fast_simple_add (len * (breakpoint + (offset * (double)i / (double)num_steps)), coeff);
|
||||
}
|
||||
_fade_in->fast_simple_add (len, VERY_SMALL_SIGNAL);
|
||||
|
|
@ -1116,9 +1114,7 @@ AudioRegion::set_fade_out (FadeShape shape, framecnt_t len)
|
|||
for (int i = 2; i < num_steps; i++) {
|
||||
const double offset = 1.0 - breakpoint;
|
||||
float coeff = 1.0 - breakpoint;
|
||||
for (int j = 0; j < i; j++) {
|
||||
coeff *= 0.5; // 6dB drop per step
|
||||
}
|
||||
coeff *= powf(0.5, (i-1) * 7.0 / (double)num_steps); // -6dB per step for 7 steps
|
||||
_fade_out->fast_simple_add (len * (breakpoint + (offset * (double)i / (double)num_steps)), coeff);
|
||||
}
|
||||
_fade_out->fast_simple_add (len, VERY_SMALL_SIGNAL);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue