From f470af1a92536b60da38d1113e5709fc562a8aca Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Tue, 19 Sep 2023 10:22:36 +0200 Subject: [PATCH] finalized bw_phaser + examples + improved docs --- examples/fx_phaser/src/bw_example_fx_phaser.c | 2 +- examples/fx_phaser/vst3/Makefile | 3 + examples/fxpp_phaser/vst3/Makefile | 3 + include/bw_hs1.h | 22 +- include/bw_hs2.h | 25 +- include/bw_ls1.h | 25 +- include/bw_ls2.h | 28 +- include/bw_math.h | 2 +- include/bw_peak.h | 35 +- include/bw_phaser.h | 547 +++++++++++++++--- 10 files changed, 562 insertions(+), 130 deletions(-) diff --git a/examples/fx_phaser/src/bw_example_fx_phaser.c b/examples/fx_phaser/src/bw_example_fx_phaser.c index 6c31d57..78d1993 100644 --- a/examples/fx_phaser/src/bw_example_fx_phaser.c +++ b/examples/fx_phaser/src/bw_example_fx_phaser.c @@ -30,7 +30,7 @@ void bw_example_fx_phaser_set_sample_rate(bw_example_fx_phaser *instance, float void bw_example_fx_phaser_reset(bw_example_fx_phaser *instance) { bw_phaser_reset_coeffs(&instance->phaser_coeffs); - bw_phaser_reset_state(&instance->phaser_coeffs, &instance->phaser_state); + bw_phaser_reset_state(&instance->phaser_coeffs, &instance->phaser_state, 0.f); } void bw_example_fx_phaser_process(bw_example_fx_phaser *instance, const float** x, float** y, int n_samples) { diff --git a/examples/fx_phaser/vst3/Makefile b/examples/fx_phaser/vst3/Makefile index c309ff7..519ea42 100644 --- a/examples/fx_phaser/vst3/Makefile +++ b/examples/fx_phaser/vst3/Makefile @@ -4,3 +4,6 @@ NAME := bw_example_fx_phaser SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fx_phaser.c include ${ROOT_DIR}/../../common/vst3/vst3.mk + +CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG +#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP diff --git a/examples/fxpp_phaser/vst3/Makefile b/examples/fxpp_phaser/vst3/Makefile index 81c1042..8d84c38 100644 --- a/examples/fxpp_phaser/vst3/Makefile +++ b/examples/fxpp_phaser/vst3/Makefile @@ -4,3 +4,6 @@ NAME := bw_example_fxpp_phaser SOURCES = ${SOURCES_COMMON} ${ROOT_DIR}/../src/bw_example_fxpp_phaser.cpp include ${ROOT_DIR}/../../common/vst3/vst3.mk + +CXXFLAGS += -DRELEASE=1 -DNDEBUG -DBW_NO_DEBUG +#CXXFLAGS += -DDEVELOPMENT=1 -DBW_DEBUG_DEEP diff --git a/include/bw_hs1.h b/include/bw_hs1.h index df663ab..1fa41d6 100644 --- a/include/bw_hs1.h +++ b/include/bw_hs1.h @@ -211,9 +211,10 @@ static inline void bw_hs1_set_cutoff( * * `value` must be finite and positive. * - * By the time `bw_hs1_update_coeffs_ctrl()`, `bw_hs1_update_coeffs_audio()`, - * `bw_hs1_process1()`, `bw_hs1_process()`, or `bw_hs1_process_multi()` is - * called, `cutoff * bw_sqrtf(high_gain)` must be in [`1e-6f`, `1e12f`]. + * By the time `bw_hs1_reset_coeffs()`, `bw_hs1_update_coeffs_ctrl()`, + * `bw_hs1_update_coeffs_audio()`, `bw_hs1_process1()`, `bw_hs1_process()`, + * or `bw_hs1_process_multi()` is called, `cutoff * bw_sqrtf(high_gain)` must + * be in [`1e-6f`, `1e12f`]. * * Default value: `1e3f`. * @@ -254,9 +255,10 @@ static inline void bw_hs1_set_high_gain_lin( * * Valid range: [`1e-30f`, `1e30f`]. * - * By the time `bw_hs1_update_coeffs_ctrl()`, `bw_hs1_update_coeffs_audio()`, - * `bw_hs1_process1()`, `bw_hs1_process()`, or `bw_hs1_process_multi()` is - * called, `cutoff * bw_sqrtf(high_gain)` must be in [`1e-6f`, `1e12f`]. + * By the time `bw_hs1_reset_coeffs()`, `bw_hs1_update_coeffs_ctrl()`, + * `bw_hs1_update_coeffs_audio()`, `bw_hs1_process1()`, `bw_hs1_process()`, + * or `bw_hs1_process_multi()` is called, `cutoff * bw_sqrtf(high_gain)` must + * be in [`1e-6f`, `1e12f`]. * * Default value: `1.f`. * @@ -271,9 +273,10 @@ static inline void bw_hs1_set_high_gain_dB( * * Valid range: [`-600.f`, `600.f`]. * - * By the time `bw_hs1_update_coeffs_ctrl()`, `bw_hs1_update_coeffs_audio()`, - * `bw_hs1_process1()`, `bw_hs1_process()`, or `bw_hs1_process_multi()` is - * called, `cutoff * bw_sqrtf(high_gain)` must be in [`1e-6f`, `1e12f`]. + * By the time `bw_hs1_reset_coeffs()`, `bw_hs1_update_coeffs_ctrl()`, + * `bw_hs1_update_coeffs_audio()`, `bw_hs1_process1()`, `bw_hs1_process()`, + * or `bw_hs1_process_multi()` is called, `cutoff * bw_sqrtf(high_gain)` must + * be in [`1e-6f`, `1e12f`]. * * Default value: `0.f`. * @@ -414,6 +417,7 @@ static inline void bw_hs1_reset_coeffs( BW_ASSERT(coeffs != NULL); BW_ASSERT_DEEP(bw_hs1_coeffs_is_valid(coeffs)); BW_ASSERT_DEEP(coeffs->state >= bw_hs1_coeffs_state_set_sample_rate); + BW_ASSERT_DEEP(coeffs->cutoff * bw_sqrtf(coeffs->high_gain) >= 1e-6f && coeffs->cutoff * bw_sqrtf(coeffs->high_gain) <= 1e12f); coeffs->update = 1; bw_hs1_update_mm1_params(coeffs); diff --git a/include/bw_hs2.h b/include/bw_hs2.h index f008908..25ba068 100644 --- a/include/bw_hs2.h +++ b/include/bw_hs2.h @@ -212,10 +212,10 @@ static inline void bw_hs2_set_cutoff( * * `value` must be finite and positive. * - * By the time `bw_hs2_update_coeffs_ctrl()`, `bw_hs2_update_coeffs_audio()`, - * `bw_hs2_process1()`, `bw_hs2_process()`, or `bw_hs2_process_multi()` is - * called, `cutoff * bw_sqrtf(bw_sqrtf(high_gain))` must be in [`1e-6f`, - * `1e12f`]. + * By the time `bw_hs2_reset_coeffs()`, `bw_hs2_update_coeffs_ctrl()`, + * `bw_hs2_update_coeffs_audio()`, `bw_hs2_process1()`, `bw_hs2_process()`, + * or `bw_hs2_process_multi()` is called, + * `cutoff * bw_sqrtf(bw_sqrtf(high_gain))` must be in [`1e-6f`, `1e12f`]. * * Default value: `1e3f`. * @@ -268,10 +268,10 @@ static inline void bw_hs2_set_high_gain_lin( * * Valid range: [`1e-30f`, `1e30f`]. * - * By the time `bw_hs2_update_coeffs_ctrl()`, `bw_hs2_update_coeffs_audio()`, - * `bw_hs2_process1()`, `bw_hs2_process()`, or `bw_hs2_process_multi()` is - * called, `cutoff * bw_sqrtf(bw_sqrtf(high_gain))` must be in [`1e-6f`, - * `1e12f`]. + * By the time `bw_hs2_reset_coeffs()`, `bw_hs2_update_coeffs_ctrl()`, + * `bw_hs2_update_coeffs_audio()`, `bw_hs2_process1()`, `bw_hs2_process()`, + * or `bw_hs2_process_multi()` is called, + * `cutoff * bw_sqrtf(bw_sqrtf(high_gain))` must be in [`1e-6f`, `1e12f`]. * * Default value: `1.f`. * @@ -286,10 +286,10 @@ static inline void bw_hs2_set_high_gain_dB( * * Valid range: [`-600.f`, `600.f`]. * - * By the time `bw_hs2_update_coeffs_ctrl()`, `bw_hs2_update_coeffs_audio()`, - * `bw_hs2_process1()`, `bw_hs2_process()`, or `bw_hs2_process_multi()` is - * called, `cutoff * bw_sqrtf(bw_sqrtf(high_gain))` must be in [`1e-6f`, - * `1e12f`]. + * By the time `bw_hs2_reset_coeffs()`, `bw_hs2_update_coeffs_ctrl()`, + * `bw_hs2_update_coeffs_audio()`, `bw_hs2_process1()`, `bw_hs2_process()`, + * or `bw_hs2_process_multi()` is called, + * `cutoff * bw_sqrtf(bw_sqrtf(high_gain))` must be in [`1e-6f`, `1e12f`]. * * Default value: `0.f`. * @@ -440,6 +440,7 @@ static inline void bw_hs2_reset_coeffs( BW_ASSERT(coeffs != NULL); BW_ASSERT_DEEP(bw_hs2_coeffs_is_valid(coeffs)); BW_ASSERT_DEEP(coeffs->state >= bw_hs2_coeffs_state_set_sample_rate); + BW_ASSERT_DEEP(coeffs->cutoff * bw_sqrtf(bw_sqrtf(coeffs->high_gain)) >= 1e-6f && coeffs->cutoff * bw_sqrtf(bw_sqrtf(coeffs->high_gain)) <= 1e12f); coeffs->param_changed = ~0; bw_hs2_update_mm2_params(coeffs); diff --git a/include/bw_ls1.h b/include/bw_ls1.h index a6cbad3..3f5709b 100644 --- a/include/bw_ls1.h +++ b/include/bw_ls1.h @@ -212,10 +212,10 @@ static inline void bw_ls1_set_cutoff( * * `value` must be finite and positive. * - * By the time `bw_ls1_update_coeffs_ctrl()`, `bw_ls1_update_coeffs_audio()`, - * `bw_ls1_process1()`, `bw_ls1_process()`, or `bw_ls1_process_multi()` is - * called, `cutoff * bw_rcpf(bw_sqrtf(dc_gain))` must be in [`1e-6f`, - * `1e12f`]. + * By the time `bw_ls1_reset_coeffs()`, `bw_ls1_update_coeffs_ctrl()`, + * `bw_ls1_update_coeffs_audio()`, `bw_ls1_process1()`, `bw_ls1_process()`, + * or `bw_ls1_process_multi()` is called, + * `cutoff * bw_rcpf(bw_sqrtf(dc_gain))` must be in [`1e-6f`, `1e12f`]. * * Default value: `1e3f`. * @@ -255,10 +255,10 @@ static inline void bw_ls1_set_dc_gain_lin( * * Valid range: [`1e-30f`, `1e30f`]. * - * By the time `bw_ls1_update_coeffs_ctrl()`, `bw_ls1_update_coeffs_audio()`, - * `bw_ls1_process1()`, `bw_ls1_process()`, or `bw_ls1_process_multi()` is - * called, `cutoff * bw_rcpf(bw_sqrtf(dc_gain))` must be in [`1e-6f`, - * `1e12f`]. + * By the time `bw_ls1_reset_coeffs()`, `bw_ls1_update_coeffs_ctrl()`, + * `bw_ls1_update_coeffs_audio()`, `bw_ls1_process1()`, `bw_ls1_process()`, + * or `bw_ls1_process_multi()` is called, + * `cutoff * bw_rcpf(bw_sqrtf(dc_gain))` must be in [`1e-6f`, `1e12f`]. * * Default value: `1.f`. * @@ -272,10 +272,10 @@ static inline void bw_ls1_set_dc_gain_dB( * * Valid range: [`-600.f`, `600.f`]. * - * By the time `bw_ls1_update_coeffs_ctrl()`, `bw_ls1_update_coeffs_audio()`, - * `bw_ls1_process1()`, `bw_ls1_process()`, or `bw_ls1_process_multi()` is - * called, `cutoff * bw_rcpf(bw_sqrtf(dc_gain))` must be in [`1e-6f`, - * `1e12f`]. + * By the time `bw_ls1_reset_coeffs()`, `bw_ls1_update_coeffs_ctrl()`, + * `bw_ls1_update_coeffs_audio()`, `bw_ls1_process1()`, `bw_ls1_process()`, + * or `bw_ls1_process_multi()` is called, + * `cutoff * bw_rcpf(bw_sqrtf(dc_gain))` must be in [`1e-6f`, `1e12f`]. * * Default value: `0.f`. * @@ -415,6 +415,7 @@ static inline void bw_ls1_reset_coeffs( BW_ASSERT(coeffs != NULL); BW_ASSERT_DEEP(bw_ls1_coeffs_is_valid(coeffs)); BW_ASSERT_DEEP(coeffs->state >= bw_ls1_coeffs_state_set_sample_rate); + BW_ASSERT_DEEP(coeffs->cutoff * bw_rcpf(bw_sqrtf(coeffs->dc_gain)) >= 1e-6f && coeffs->cutoff * bw_rcpf(bw_sqrtf(coeffs->dc_gain)) <= 1e12f); coeffs->update = 1; bw_ls1_update_mm1_params(coeffs); diff --git a/include/bw_ls2.h b/include/bw_ls2.h index 5f2524e..b744290 100644 --- a/include/bw_ls2.h +++ b/include/bw_ls2.h @@ -211,10 +211,11 @@ static inline void bw_ls2_set_cutoff( * * `value` must be finite and positive. * - * By the time `bw_ls2_update_coeffs_ctrl()`, `bw_ls2_update_coeffs_audio()`, - * `bw_ls2_process1()`, `bw_ls2_process()`, or `bw_ls2_process_multi()` is - * called, `cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(dc_gain)))` must be in - * [`1e-6f`, `1e12f`]. + * By the time ``bw_ls2_reset_coeffs(), `bw_ls2_update_coeffs_ctrl()`, + * `bw_ls2_update_coeffs_audio()`, `bw_ls2_process1()`, `bw_ls2_process()`, + * or `bw_ls2_process_multi()` is called, + * `cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(dc_gain)))` must be in [`1e-6f`, + * `1e12f`]. * * Default value: `1e3f`. * @@ -266,10 +267,11 @@ static inline void bw_ls2_set_dc_gain_lin( * * Valid range: [`1e-30f`, `1e30f`]. * - * By the time `bw_ls2_update_coeffs_ctrl()`, `bw_ls2_update_coeffs_audio()`, - * `bw_ls2_process1()`, `bw_ls2_process()`, or `bw_ls2_process_multi()` is - * called, `cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(dc_gain)))` must be in - * [`1e-6f`, `1e12f`]. + * By the time ``bw_ls2_reset_coeffs(), `bw_ls2_update_coeffs_ctrl()`, + * `bw_ls2_update_coeffs_audio()`, `bw_ls2_process1()`, `bw_ls2_process()`, + * or `bw_ls2_process_multi()` is called, + * `cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(dc_gain)))` must be in [`1e-6f`, + * `1e12f`]. * * Default value: `1.f`. * @@ -283,10 +285,11 @@ static inline void bw_ls2_set_dc_gain_dB( * * Valid range: [`-600.f`, `600.f`]. * - * By the time `bw_ls2_update_coeffs_ctrl()`, `bw_ls2_update_coeffs_audio()`, - * `bw_ls2_process1()`, `bw_ls2_process()`, or `bw_ls2_process_multi()` is - * called, `cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(dc_gain)))` must be in - * [`1e-6f`, `1e12f`]. + * By the time ``bw_ls2_reset_coeffs(), `bw_ls2_update_coeffs_ctrl()`, + * `bw_ls2_update_coeffs_audio()`, `bw_ls2_process1()`, `bw_ls2_process()`, + * or `bw_ls2_process_multi()` is called, + * `cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(dc_gain)))` must be in [`1e-6f`, + * `1e12f`]. * * Default value: `0.f`. * @@ -437,6 +440,7 @@ static inline void bw_ls2_reset_coeffs( BW_ASSERT(coeffs != NULL); BW_ASSERT_DEEP(bw_ls2_coeffs_is_valid(coeffs)); BW_ASSERT_DEEP(coeffs->state >= bw_ls2_coeffs_state_set_sample_rate); + BW_ASSERT_DEEP(coeffs->cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(coeffs->dc_gain))) >= 1e-6f && coeffs->cutoff * bw_rcpf(bw_sqrtf(bw_sqrtf(coeffs->dc_gain))) <= 1e12f); coeffs->param_changed = ~0; bw_ls2_update_mm2_params(coeffs); diff --git a/include/bw_math.h b/include/bw_math.h index 6cfa6f6..d8710e4 100644 --- a/include/bw_math.h +++ b/include/bw_math.h @@ -486,7 +486,7 @@ static inline float bw_sqrtf( /*! <<<``` * Returns an approximation of the square root of `x`. * - * `x` must be finite and greater than or equal to `0.f`. + * `x` must be finite and non-negative. * * Absolute error < 1.09e-19 or relative error < 0.0007%, whatever is worse. * diff --git a/include/bw_peak.h b/include/bw_peak.h index bdb70d6..8073aba 100644 --- a/include/bw_peak.h +++ b/include/bw_peak.h @@ -272,9 +272,10 @@ static inline void bw_peak_set_peak_gain_lin( * Valid range: [`1e-30f`, `1e30f`]. * * If actually using the bandwidth parameter to control Q, by the time - * `bw_peak_update_coeffs_ctrl()`, `bw_peak_update_coeffs_audio()`, - * `bw_peak_process1()`, `bw_peak_process()`, or `bw_peak_process_multi()` is - * called, `bw_sqrtf(bw_pow2f(bandwidth) * peak_gain) * + * `bw_peak_reset_coeffs()`, `bw_peak_update_coeffs_ctrl()`, + * `bw_peak_update_coeffs_audio()`, `bw_peak_process1()`, + * `bw_peak_process()`, or `bw_peak_process_multi()` is called, + * `bw_sqrtf(bw_pow2f(bandwidth) * peak_gain) * * bw_rcpf(bw_pow2f(bandwidth) - 1.f)` must be in [`1e-6f`, `1e6f`]. * * Default value: `1.f`. @@ -290,9 +291,10 @@ static inline void bw_peak_set_peak_gain_dB( * Valid range: [`-600.f`, `600.f`]. * * If actually using the bandwidth parameter to control Q, by the time - * `bw_peak_update_coeffs_ctrl()`, `bw_peak_update_coeffs_audio()`, - * `bw_peak_process1()`, `bw_peak_process()`, or `bw_peak_process_multi()` is - * called, `bw_sqrtf(bw_pow2f(bandwidth) * peak_gain) * + * `bw_peak_reset_coeffs()`, `bw_peak_update_coeffs_ctrl()`, + * `bw_peak_update_coeffs_audio()`, `bw_peak_process1()`, + * `bw_peak_process()`, or `bw_peak_process_multi()` is called, + * `bw_sqrtf(bw_pow2f(bandwidth) * peak_gain) * * bw_rcpf(bw_pow2f(bandwidth) - 1.f)` must be in [`1e-6f`, `1e6f`]. * * Default value: `0.f`. @@ -308,9 +310,10 @@ static inline void bw_peak_set_bandwidth( * Valid range: [`1e-6f`, `90.f`]. * * If actually using the bandwidth parameter to control Q, by the time - * `bw_peak_update_coeffs_ctrl()`, `bw_peak_update_coeffs_audio()`, - * `bw_peak_process1()`, `bw_peak_process()`, or `bw_peak_process_multi()` is - * called, `bw_sqrtf(bw_pow2f(bandwidth) * peak_gain) * + * `bw_peak_reset_coeffs()`, `bw_peak_update_coeffs_ctrl()`, + * `bw_peak_update_coeffs_audio()`, `bw_peak_process1()`, + * `bw_peak_process()`, or `bw_peak_process_multi()` is called, + * `bw_sqrtf(bw_pow2f(bandwidth) * peak_gain) * * bw_rcpf(bw_pow2f(bandwidth) - 1.f)` must be in [`1e-6f`, `1e6f`]. * * Default value: `2.543106606327224f`. @@ -478,6 +481,10 @@ static inline void bw_peak_reset_coeffs( BW_ASSERT(coeffs != NULL); BW_ASSERT_DEEP(bw_peak_coeffs_is_valid(coeffs)); BW_ASSERT_DEEP(coeffs->state >= bw_peak_coeffs_state_set_sample_rate); + BW_ASSERT_DEEP(coeffs->use_bandwidth + ? bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) >= 1e-6f + && bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) <= 1e6f + : 1); coeffs->param_changed = ~0; bw_peak_update_mm2_params(coeffs); @@ -547,7 +554,7 @@ static inline void bw_peak_update_coeffs_ctrl( BW_ASSERT_DEEP(coeffs->use_bandwidth ? bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) >= 1e-6f && bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) <= 1e6f - : coeffs->Q >= 1e-6 && coeffs->Q <= 1e6); + : 1); bw_peak_update_mm2_params(coeffs); bw_mm2_update_coeffs_ctrl(&coeffs->mm2_coeffs); @@ -564,7 +571,7 @@ static inline void bw_peak_update_coeffs_audio( BW_ASSERT_DEEP(coeffs->use_bandwidth ? bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) >= 1e-6f && bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) <= 1e6f - : coeffs->Q >= 1e-6 && coeffs->Q <= 1e6); + : 1); bw_mm2_update_coeffs_audio(&coeffs->mm2_coeffs); @@ -582,7 +589,7 @@ static inline float bw_peak_process1( BW_ASSERT_DEEP(coeffs->use_bandwidth ? bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) >= 1e-6f && bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) <= 1e6f - : coeffs->Q >= 1e-6 && coeffs->Q <= 1e6); + : 1); BW_ASSERT(state != NULL); BW_ASSERT_DEEP(bw_peak_state_is_valid(coeffs, state)); BW_ASSERT(bw_is_finite(x)); @@ -609,7 +616,7 @@ static inline void bw_peak_process( BW_ASSERT_DEEP(coeffs->use_bandwidth ? bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) >= 1e-6f && bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) <= 1e6f - : coeffs->Q >= 1e-6 && coeffs->Q <= 1e6); + : 1); BW_ASSERT(state != NULL); BW_ASSERT_DEEP(bw_peak_state_is_valid(coeffs, state)); BW_ASSERT(x != NULL); @@ -642,7 +649,7 @@ static inline void bw_peak_process_multi( BW_ASSERT_DEEP(coeffs->use_bandwidth ? bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) >= 1e-6f && bw_sqrtf(bw_pow2f(coeffs->bandwidth) * coeffs->peak_gain) * bw_rcpf(bw_pow2f(coeffs->bandwidth) - 1.f) <= 1e6f - : coeffs->Q >= 1e-6 && coeffs->Q <= 1e6); + : 1); BW_ASSERT(state != NULL); BW_ASSERT(x != NULL); BW_ASSERT(y != NULL); diff --git a/include/bw_phaser.h b/include/bw_phaser.h index e6682bf..1850fec 100644 --- a/include/bw_phaser.h +++ b/include/bw_phaser.h @@ -32,6 +32,14 @@ *