diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-10-31 17:47:49 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-10-31 17:47:49 +0000 |
commit | 5d0fbaeae73a2f1652c67e5aab73771edc0a20be (patch) | |
tree | da7144a048157c47810bbbf6c544f1bc20540069 /libs | |
parent | 47f1cba718acbf82240d447a11a1e75a80dbe53b (diff) |
default crossfade is now constant power; SAE gets only 3 xfades (not correct for 2 of them, yet); fade buttons in xfade editor have tooltips
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4073 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/crossfade.cc | 57 | ||||
-rw-r--r-- | libs/ardour/utils.cc | 2 |
2 files changed, 46 insertions, 13 deletions
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index e73d79a553..7e8307a158 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -208,22 +208,55 @@ Crossfade::initialize () _fade_out.freeze (); _fade_out.clear (); - _fade_out.add (0.0, 1.0); - _fade_out.add ((_length * 0.1), 0.99); - _fade_out.add ((_length * 0.2), 0.97); - _fade_out.add ((_length * 0.8), 0.03); - _fade_out.add ((_length * 0.9), 0.01); - _fade_out.add (_length, 0.0); + +#ifdef EQUAL_POWER_MINUS_3DB + + _fade_out.add ((_length * 0.000000), 1.000000); + _fade_out.add ((_length * 0.166667), 0.948859); + _fade_out.add ((_length * 0.333333), 0.851507); + _fade_out.add ((_length * 0.500000), 0.707946); + _fade_out.add ((_length * 0.666667), 0.518174); + _fade_out.add ((_length * 0.833333), 0.282192); + _fade_out.add ((_length * 1.000000), 0.000000); + +#else // EQUAL_POWER_MINUS_6DB + + _fade_out.add ((_length * 0.000000), 1.000000); + _fade_out.add ((_length * 0.166667), 0.833033); + _fade_out.add ((_length * 0.333333), 0.666186); + _fade_out.add ((_length * 0.500000), 0.499459); + _fade_out.add ((_length * 0.666667), 0.332853); + _fade_out.add ((_length * 0.833333), 0.166366); + _fade_out.add ((_length * 1.000000), 0.000000); +#endif + _fade_out.thaw (); _fade_in.freeze (); _fade_in.clear (); - _fade_in.add (0.0, 0.0); - _fade_in.add ((_length * 0.1), 0.01); - _fade_in.add ((_length * 0.2), 0.03); - _fade_in.add ((_length * 0.8), 0.97); - _fade_in.add ((_length * 0.9), 0.99); - _fade_in.add (_length, 1.0); + +#ifdef EQUAL_POWER_MINUS_3DB + + _fade_in.add ((_length * 0.000000), 0.000000); + _fade_in.add ((_length * 0.166667), 0.282192); + _fade_in.add ((_length * 0.333333), 0.518174); + _fade_in.add ((_length * 0.500000), 0.707946); + _fade_in.add ((_length * 0.666667), 0.851507); + _fade_in.add ((_length * 0.833333), 0.948859); + _fade_in.add ((_length * 1.000000), 1.000000); + +#else // EQUAL_POWER_MINUS_SIX_DB + + _fade_in.add ((_length * 0.000000), 0.000000); + _fade_in.add ((_length * 0.166667), 0.166366); + _fade_in.add ((_length * 0.333333), 0.332853); + _fade_in.add ((_length * 0.500000), 0.499459); + _fade_in.add ((_length * 0.666667), 0.666186); + _fade_in.add ((_length * 0.833333), 0.833033); + _fade_in.add ((_length * 1.000000), 1.000000); + +#endif + _fade_in.thaw (); overlap_type = _in->coverage (_out->position(), _out->last_frame()); diff --git a/libs/ardour/utils.cc b/libs/ardour/utils.cc index 45d77f46a5..8927e2a9c6 100644 --- a/libs/ardour/utils.cc +++ b/libs/ardour/utils.cc @@ -340,7 +340,7 @@ compute_equal_power_fades (nframes_t nframes, float* in, float* out) { double step; - step = 1.0/nframes; + step = 1.0/(nframes-1); in[0] = 0.0f; |