changed default gain compensation value in bw_{clip,satur}

This commit is contained in:
Stefano D'Angelo 2023-08-15 06:48:19 +02:00
parent da30569d61
commit fe02a79329
10 changed files with 15 additions and 10 deletions

5
TODO
View File

@ -10,15 +10,12 @@ code:
* common smoothing policy (as control rate as possible?) - smoothing control?
* svf bandpass out polarity too confusing (inverted in mm2)?
* get_y_z1, common strategy?
* bw_satur gain compensation to divide by actual gain (derivative) rather than gain parameter?
* add initial state (x0) to reset state of all modules?
* bw_comb: should also modulate feedback?
* bw_comb: integer target delay values?
* bw_svf/lp1 automatically limited (max) prewarp frequency to avoid instability?
* prewarp control in all derived filtering modules
* src inside distortions? w/ control from outside?
* bw_fuzz gain compensation?
* make gain of distortions homogeneous?
* max_delay -> set sample rate? see reverb
* mem req -> return value of set sample rate?
* peak gain + Q ???
@ -68,6 +65,8 @@ code:
* one pole, slew lim, maybe others: process const input? (return also if const out)
* pan process with no out: should just reset coeffs?
* float in [0,1] or [-1,1] for velocity, pitch bend, mod wheel in examples
* bw_satur gain compensation, divide by actual gain (derivative) mode? what about around flat line? bw_clip?
* gain compensation in distortions?
build system:
* make makefiles handle paths with spaces etc

View File

@ -24,6 +24,7 @@ void bw_example_fx_clip_init(bw_example_fx_clip *instance) {
bw_clip_init(&instance->clip_coeffs);
bw_src_int_init(&instance->src_up_coeffs, 2);
bw_src_int_init(&instance->src_down_coeffs, -2);
bw_clip_set_gain_compensation(&instance->clip_coeffs, 1);
}
void bw_example_fx_clip_set_sample_rate(bw_example_fx_clip *instance, float sample_rate) {

View File

@ -24,6 +24,7 @@ void bw_example_fx_satur_init(bw_example_fx_satur *instance) {
bw_satur_init(&instance->satur_coeffs);
bw_src_int_init(&instance->src_up_coeffs, 2);
bw_src_int_init(&instance->src_down_coeffs, -2);
bw_satur_set_gain_compensation(&instance->satur_coeffs, 1);
}
void bw_example_fx_satur_set_sample_rate(bw_example_fx_satur *instance, float sample_rate) {

View File

@ -21,7 +21,7 @@
#include "bw_example_fxpp_clip.h"
void bw_example_fxpp_clip_init(bw_example_fxpp_clip *instance) {
(void)instance;
instance->clip.setGainCompensation(true);
}
void bw_example_fxpp_clip_set_sample_rate(bw_example_fxpp_clip *instance, float sample_rate) {

View File

@ -21,7 +21,7 @@
#include "bw_example_fxpp_satur.h"
void bw_example_fxpp_satur_init(bw_example_fxpp_satur *instance) {
(void)instance;
instance->satur.setGainCompensation(true);
}
void bw_example_fxpp_satur_set_sample_rate(bw_example_fxpp_satur *instance, float sample_rate) {

View File

@ -47,6 +47,7 @@
* <ul>
* <li>Version <strong>1.0.0</strong>:
* <ul>
* <li>Changed default value for gain compensation to off.</li>
* <li><code>bw_clip_process()</code> and
* <code>bw_clip_process_multi()</code> now use <code>size_t</code>
* to count samples and channels.</li>
@ -184,7 +185,7 @@ static inline void bw_clip_set_gain_compensation(bw_clip_coeffs *BW_RESTRICT coe
* Sets whether the output should be divided by gain (`value` non-`0`) or not
* (`0`).
*
* Default value: `1` (on).
* Default value: `0` (off).
* }}} */
#ifdef __cplusplus
@ -230,7 +231,7 @@ static inline void bw_clip_init(bw_clip_coeffs *BW_RESTRICT coeffs) {
bw_one_pole_set_sticky_thresh(&coeffs->smooth_coeffs, 1e-3f);
coeffs->bias = 0.f;
coeffs->gain = 1.f;
coeffs->gain_compensation = 1;
coeffs->gain_compensation = 0;
}
static inline void bw_clip_set_sample_rate(bw_clip_coeffs *BW_RESTRICT coeffs, float sample_rate) {

View File

@ -220,7 +220,9 @@ static inline void bw_dist_init(bw_dist_coeffs *BW_RESTRICT coeffs) {
bw_peak_set_bandwidth(&coeffs->peak_coeffs, 10.f);
bw_clip_set_bias(&coeffs->clip_coeffs, 0.75f / 4.25f);
bw_clip_set_gain(&coeffs->clip_coeffs, 1.f / 4.25f);
bw_clip_set_gain_compensation(&coeffs->clip_coeffs, 1);
bw_satur_set_gain(&coeffs->satur_coeffs, 1.f / 0.7f);
bw_satur_set_gain_compensation(&coeffs->clip_coeffs, 1);
bw_lp1_set_cutoff(&coeffs->lp1_coeffs, 475.f + (20e3f - 475.f) * 0.125f);
}

View File

@ -223,6 +223,7 @@ static inline void bw_drive_init(bw_drive_coeffs *BW_RESTRICT coeffs) {
bw_peak_set_cutoff(&coeffs->peak_coeffs, 500.f);
bw_peak_set_bandwidth(&coeffs->peak_coeffs, 9.5f);
bw_satur_set_gain(&coeffs->satur_coeffs, 1.5f);
bw_satur_set_gain_compensation(&coeffs->satur_coeffs, 1);
bw_lp1_set_cutoff(&coeffs->lp1_coeffs, 400.f + (5e3f - 400.f) * 0.125f);
}

View File

@ -214,7 +214,6 @@ static inline void bw_fuzz_init(bw_fuzz_coeffs *BW_RESTRICT coeffs) {
bw_peak_set_cutoff(&coeffs->peak_coeffs, 500.f);
bw_peak_set_bandwidth(&coeffs->peak_coeffs, 6.6f);
bw_satur_set_bias(&coeffs->satur_coeffs, 0.145f);
bw_satur_set_gain_compensation(&coeffs->satur_coeffs, 0);
bw_hp1_set_cutoff(&coeffs->hp1_out_coeffs, 30.f);
}

View File

@ -47,6 +47,7 @@
* <ul>
* <li>Version <strong>1.0.0</strong>:
* <ul>
* <li>Changed default value for gain compensation to off.</li>
* <li><code>bw_satur_process()</code> and
* <code>bw_satur_process_multi()</code> now use
* <code>size_t</code> to count samples and channels.</li>
@ -197,7 +198,7 @@ static inline void bw_satur_set_gain_compensation(bw_satur_coeffs *BW_RESTRICT c
* Sets whether the output should be divided by gain (`value` non-`0`) or not
* (`0`).
*
* Default value: `1` (on).
* Default value: `0` (off).
* }}} */
#ifdef __cplusplus
@ -249,7 +250,7 @@ static inline void bw_satur_init(bw_satur_coeffs *BW_RESTRICT coeffs) {
bw_one_pole_set_sticky_thresh(&coeffs->smooth_coeffs, 1e-3f);
coeffs->bias = 0.f;
coeffs->gain = 1.f;
coeffs->gain_compensation = 1;
coeffs->gain_compensation = 0;
}
static inline void bw_satur_set_sample_rate(bw_satur_coeffs *BW_RESTRICT coeffs, float sample_rate) {