diff options
author | Ryan Billing <ryjobil@gmail.com> | 2013-10-04 01:57:00 +1300 |
---|---|---|
committer | Michael Giacomelli <giac2000@hotmail.com> | 2013-12-15 22:24:08 +0100 |
commit | d0918b98fa0cfba21208a4fb5ed153687b8f02c3 (patch) | |
tree | 006ef2bb902dfd83101fbfa3fe63b07f47d9e8e6 /apps | |
parent | 5b5f0755d6d7fd9e3fdfdb479caeb7fafd0a9960 (diff) | |
download | rockbox-d0918b98fa0cfba21208a4fb5ed153687b8f02c3.tar.gz rockbox-d0918b98fa0cfba21208a4fb5ed153687b8f02c3.zip |
DSP Compressor: Sidechain, Exponential Atk/Rls
This is an improvement to the current compressor which I have added
to my own Sansa Fuze V2 build. I am submitting here in case others
find it interesting.
Features added to the existing compressor:
Attack, Look-ahead, Sidechain Filtering.
Exponential attack and release characteristic response.
Benefits from adding missing features:
Attack:
Preserve perceived "brightness" of tone by letting onset transients
come through at a higher level than the rest of the compressed program
material.
Look-ahead:
With Attack comes clipping on the leading several cycles of a transient
onset. With look-ahead function, this can be pre-emptively mitigated with
a slower gain change (less distortion). Look-ahead limiting is implemented
to prevent clipping while keeping gain change ramp to an interval near 3ms
instead of instant attack.
The existing compressor implementation distorts the leading edge of a
transient by causing instant gain change, resulting in log() distortion.
This sounds "woofy" to me.
Exponential Attack/Release:
eMore natural sounding. On attack, this is a true straight line of 10dB per
attack interval. Release is a little different, however, sounds natural as
an analog compressor.
Sidechain Filtering:
Mild high-pass filter reduces response to low frequency onsets. For example,
a hard kick drum is less likely to make the whole of the program material
appear to fade in and out. Combined with a moderate attack time, such a
transient will ride through with minimal audible artifact.
Overall these changes make dynamic music sound more "open", more natural. The
goal of a compressor is to make dyanamic music sound louder without necessarily
sounding as though it has been compressed. I believe these changes come closer to this goal.
Enjoy. If not, I am enjoying it
Change-Id: I664eace546c364b815b4dc9ed4a72849231a0eb2
Reviewed-on: http://gerrit.rockbox.org/626
Tested: Purling Nayuki <cyq.yzfl@gmail.com>
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 17 | ||||
-rw-r--r-- | apps/menus/sound_menu.c | 5 | ||||
-rw-r--r-- | apps/settings_list.c | 6 |
3 files changed, 26 insertions, 2 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index d0dc5c5fc4..dcad532f7a 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -11911,6 +11911,23 @@ | |||
11911 | </voice> | 11911 | </voice> |
11912 | </phrase> | 11912 | </phrase> |
11913 | <phrase> | 11913 | <phrase> |
11914 | id: LANG_COMPRESSOR_ATTACK | ||
11915 | desc: in sound settings | ||
11916 | user: core | ||
11917 | <source> | ||
11918 | *: none | ||
11919 | swcodec: "Attack Time" | ||
11920 | </source> | ||
11921 | <dest> | ||
11922 | *: none | ||
11923 | swcodec: "Attack Time" | ||
11924 | </dest> | ||
11925 | <voice> | ||
11926 | *: none | ||
11927 | swcodec: "Attack Time" | ||
11928 | </voice> | ||
11929 | </phrase> | ||
11930 | <phrase> | ||
11914 | id: LANG_COMPRESSOR_RELEASE | 11931 | id: LANG_COMPRESSOR_RELEASE |
11915 | desc: in sound settings | 11932 | desc: in sound settings |
11916 | user: core | 11933 | user: core |
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c index fd192cb661..28cc257193 100644 --- a/apps/menus/sound_menu.c +++ b/apps/menus/sound_menu.c | |||
@@ -140,12 +140,15 @@ static int timestretch_callback(int action,const struct menu_item_ex *this_item) | |||
140 | MENUITEM_SETTING(compressor_knee, | 140 | MENUITEM_SETTING(compressor_knee, |
141 | &global_settings.compressor_settings.knee, | 141 | &global_settings.compressor_settings.knee, |
142 | lowlatency_callback); | 142 | lowlatency_callback); |
143 | MENUITEM_SETTING(compressor_attack, | ||
144 | &global_settings.compressor_settings.attack_time, | ||
145 | lowlatency_callback); | ||
143 | MENUITEM_SETTING(compressor_release, | 146 | MENUITEM_SETTING(compressor_release, |
144 | &global_settings.compressor_settings.release_time, | 147 | &global_settings.compressor_settings.release_time, |
145 | lowlatency_callback); | 148 | lowlatency_callback); |
146 | MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON, | 149 | MAKE_MENU(compressor_menu,ID2P(LANG_COMPRESSOR), NULL, Icon_NOICON, |
147 | &compressor_threshold, &compressor_gain, &compressor_ratio, | 150 | &compressor_threshold, &compressor_gain, &compressor_ratio, |
148 | &compressor_knee, &compressor_release); | 151 | &compressor_knee, &compressor_attack, &compressor_release); |
149 | #endif | 152 | #endif |
150 | 153 | ||
151 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 154 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
diff --git a/apps/settings_list.c b/apps/settings_list.c index 6ffb2b551b..bd2bfce36f 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1653,7 +1653,11 @@ const struct settings_list settings[] = { | |||
1653 | CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.knee, | 1653 | CHOICE_SETTING(F_SOUNDSETTING|F_NO_WRAP, compressor_settings.knee, |
1654 | LANG_COMPRESSOR_KNEE, 1, "compressor knee", | 1654 | LANG_COMPRESSOR_KNEE, 1, "compressor knee", |
1655 | "hard knee,soft knee", compressor_set, 2, | 1655 | "hard knee,soft knee", compressor_set, 2, |
1656 | ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)), | 1656 | ID2P(LANG_COMPRESSOR_HARD_KNEE), ID2P(LANG_COMPRESSOR_SOFT_KNEE)), |
1657 | INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.attack_time, | ||
1658 | LANG_COMPRESSOR_ATTACK, 5, | ||
1659 | "compressor attack time", UNIT_MS, 0, 30, | ||
1660 | 5, NULL, NULL, compressor_set), | ||
1657 | INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.release_time, | 1661 | INT_SETTING_NOWRAP(F_SOUNDSETTING, compressor_settings.release_time, |
1658 | LANG_COMPRESSOR_RELEASE, 500, | 1662 | LANG_COMPRESSOR_RELEASE, 500, |
1659 | "compressor release time", UNIT_MS, 100, 1000, | 1663 | "compressor release time", UNIT_MS, 100, 1000, |