Adjust Volume Control Transfer function to make it a bit slower at very low volumes. Add PDF of transfer function and Mac Grapher source document.

This commit is contained in:
Mike Brady
2014-05-17 13:11:25 +01:00
parent 08199b9910
commit db5ef58f82
3 changed files with 4 additions and 4 deletions
+4 -4
View File
@@ -186,11 +186,11 @@ double vol2attn(double vol, long max_db, long min_db) {
// We build the transfer function from one or more lines. We characterise each line with two numbers:
// the first is where on x the line starts when y=0 (from 0 to -30); the second is where on y the line stops when when x is -30.
// thus, if the line was characterised as {0,-30}, it would be an identity transfer.
// Assuming, for example, a dynamic range of lv=-70 to hv=0
// Assuming, for example, a dynamic range of lv=-60 to hv=0
// Typically we'll use three lines -- a three order transfer function
// First: {0,25} giving a gentle slope
// Second: {-17,-25-(lv+25)/2} giving a faster slope from y=0 at x=-17 to y=-50 at x=-30
// Third: {-23,lv} giving a fast slope from y=0 at x=-23 to y=-70 at x=-30
// Second: {-12,-25-(lv+25)/2} giving a faster slope from y=0 at x=-12 to y=-42.5 at x=-30
// Third: {-19,lv} giving a fast slope from y=0 at x=-19 to y=-60 at x=-30
#define order 3
@@ -202,7 +202,7 @@ double vol2attn(double vol, long max_db, long min_db) {
double first_slope = -2500.0; // this is the slope of the attenuation at the high end -- 25dB for the full rotation.
if (-range_db>first_slope)
first_slope = range_db;
double lines[order][2] = {{0,first_slope},{-17,first_slope-(range_db+first_slope)/2},{-23,-range_db}};
double lines[order][2] = {{0,first_slope},{-12,first_slope-(range_db+first_slope)/2},{-19,-range_db}};
int i;
for (i=0;i<order;i++) {
if (vol<=lines[i][0]) {