Browse Source

Use linear curve for declicking fades

tags/non-daw-v1.1.0
Jonathan Moore Liles 17 years ago
parent
commit
ee576b7ff7
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      Timeline/Region.C

+ 5
- 3
Timeline/Region.C View File

@@ -760,14 +760,16 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co

/* perform declicking if necessary */

const nframes_t declick_frames = 1024;
/* FIXME: shouldn't this be wallclock time? */
const nframes_t declick_frames = 256;
const fade_type_e type = Linear;

if ( start + cnt + declick_frames > r.end )
{
/* declick end */
const nframes_t d = r.end - start;

apply_fade( buf, FADE_OUT, Cosine, cnt + (long)d - declick_frames, cnt + d, cnt );
apply_fade( buf, FADE_OUT, type , cnt + (long)d - declick_frames, cnt + d, cnt );
}

if ( sofs < declick_frames )
@@ -775,7 +777,7 @@ Region::read ( sample_t *buf, nframes_t pos, nframes_t nframes, int channel ) co
/* declick start */
const long d = 0 - sofs;

apply_fade( buf + ofs, FADE_IN, Cosine, d, d + declick_frames, cnt - ofs );
apply_fade( buf + ofs, FADE_IN, type, d, d + declick_frames, cnt - ofs );
}

// printf( "read %lu frames\n", cnt );


Loading…
Cancel
Save