multichannel + no NULL to bw_{balance,pan}_process + fix doc, bw_svf_process
This commit is contained in:
parent
20775c532e
commit
b2169b6792
1
TODO
1
TODO
@ -48,6 +48,7 @@ code:
|
||||
* max_delay -> set sample rate? see reverb
|
||||
* revise typedef style (see https://stackoverflow.com/questions/54752861/using-an-anonymous-struct-vs-a-named-struct-with-typedef)
|
||||
* sr-dependent vs cr-dependent coeffs? see synth poly example
|
||||
* bw_buf_copy (to be used in bw_slew_lim)?
|
||||
|
||||
build system:
|
||||
* make makefiles handle paths with spaces etc
|
||||
|
@ -186,7 +186,26 @@ void bw_example_synth_poly_process(bw_example_synth_poly *instance, const float*
|
||||
int n = instance->params[p_vco3_kbd] >= 0.5f ? instance->voices[i].note : 0;
|
||||
bw_phase_gen_set_frequency(&instance->voices[i].vco1_phase_gen_coeffs, 440.f * bw_pow2f_3(f1 + 8.333333333333333e-2f * instance->voices[i].note));
|
||||
bw_phase_gen_set_frequency(&instance->voices[i].vco2_phase_gen_coeffs, 440.f * bw_pow2f_3(f2 + 8.333333333333333e-2f * instance->voices[i].note));
|
||||
bw_phase_gen_set_frequency(&instance->voices[i].vco3_phase_gen_coeffs, 440.f * bw_pow2f_3(f2 + 8.333333333333333e-2f * n));
|
||||
bw_phase_gen_set_frequency(&instance->voices[i].vco3_phase_gen_coeffs, 440.f * bw_pow2f_3(f3 + 8.333333333333333e-2f * n));
|
||||
}
|
||||
|
||||
for (int j = 0; j < N_VOICES; j++) {
|
||||
bw_phase_gen_update_coeffs_ctrl(&instance->voices[i].vco1_phase_gen_coeffs);
|
||||
bw_phase_gen_update_coeffs_ctrl(&instance->voices[i].vco2_phase_gen_coeffs);
|
||||
bw_phase_gen_update_coeffs_ctrl(&instance->voices[i].vco3_phase_gen_coeffs);
|
||||
}
|
||||
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
for (int j = 0; j < N_VOICES; j++) {
|
||||
bw_phase_gen_update_coeffs_audio(&instance->voices[i].vco1_phase_gen_coeffs);
|
||||
bw_phase_gen_update_coeffs_audio(&instance->voices[i].vco2_phase_gen_coeffs);
|
||||
bw_phase_gen_update_coeffs_audio(&instance->voices[i].vco3_phase_gen_coeffs);
|
||||
}
|
||||
|
||||
for (int j = 0; j < N_VOICES; j++) {
|
||||
float p1, p1inc;
|
||||
bw_phase_gen_process1(&instance->voices[i].vco1_phase_gen_coeffs, &instance->voices[i].vco1_phase_gen_state, &p1, &p1inc;
|
||||
}
|
||||
}
|
||||
|
||||
//...
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_lp1 bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order allpass filter (90° shift at cutoff, approaching 180° shift
|
||||
@ -28,6 +28,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_ap1_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -117,6 +122,15 @@ static inline void bw_ap1_process(bw_ap1_coeffs *BW_RESTRICT coeffs, bw_ap1_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_ap1_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_ap1_process_multi(bw_ap1_coeffs *BW_RESTRICT coeffs, bw_ap1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_ap1_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_ap1_set_cutoff(bw_ap1_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -179,6 +193,15 @@ static inline void bw_ap1_process(bw_ap1_coeffs *BW_RESTRICT coeffs, bw_ap1_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ap1_process_multi(bw_ap1_coeffs *BW_RESTRICT coeffs, bw_ap1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_ap1_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ap1_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_ap1_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ap1_set_cutoff(bw_ap1_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_lp1_set_cutoff(&coeffs->lp1_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order allpass filter (180° shift at cutoff, approaching 360° shift
|
||||
@ -28,6 +28,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_ap2_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -117,6 +122,15 @@ static inline void bw_ap2_process(bw_ap2_coeffs *BW_RESTRICT coeffs, bw_ap2_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_ap2_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_ap2_process_multi(bw_ap2_coeffs *BW_RESTRICT coeffs, bw_ap2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_ap2_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_ap2_set_cutoff(bw_ap2_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -191,6 +205,15 @@ static inline void bw_ap2_process(bw_ap2_coeffs *BW_RESTRICT coeffs, bw_ap2_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ap2_process_multi(bw_ap2_coeffs *BW_RESTRICT coeffs, bw_ap2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_ap2_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ap2_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_ap2_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ap2_set_cutoff(bw_ap2_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_svf_set_cutoff(&coeffs->svf_coeffs, value);
|
||||
}
|
||||
|
@ -20,13 +20,21 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.3.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_gain bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Stereo balance.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_balance_process_multi()</code>.</li>
|
||||
* <li><code>bw_balance_process()</code> does not accept
|
||||
* <code>NULL</code> buffers anymore.</li>
|
||||
* <li>Fixed documentation of <code>bw_balance_process1()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.3.0</strong>:
|
||||
* <ul>
|
||||
* <li>First release.</li>
|
||||
@ -87,8 +95,8 @@ static inline void bw_balance_update_coeffs_audio(bw_balance_coeffs *BW_RESTRICT
|
||||
static inline void bw_balance_process1(const bw_balance_coeffs *BW_RESTRICT coeffs, float x_l, float x_r, float *BW_RESTRICT y_l, float *BW_RESTRICT y_r);
|
||||
/*! <<<```
|
||||
* Processes one set of input samples `x_l` (left) and `x_r` (right) using
|
||||
* `coeffs`, while using and updating `state`. The left and right output
|
||||
* samples are put into `y_l` (left) and `y_r` (right) respectively.
|
||||
* `coeffs`. The left and right output samples are put into `y_l` (left) and
|
||||
* `y_r` (right) respectively.
|
||||
*
|
||||
* #### bw_balance_process()
|
||||
* ```>>> */
|
||||
@ -96,8 +104,17 @@ static inline void bw_balance_process(bw_balance_coeffs *BW_RESTRICT coeffs, con
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the input buffers `x_l` (left) and
|
||||
* `x_r` (right) and fills the first `n_samples` of the output buffers `y_l`
|
||||
* (left) and `y_r` (right), if they are not `NULL`, while using and updating
|
||||
* `coeffs` (control and audio rate).
|
||||
* (left) and `y_r` (right), while using and updating `coeffs` (control and
|
||||
* audio rate).
|
||||
*
|
||||
* #### bw_balance_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_balance_process_multi(bw_balance_coeffs *BW_RESTRICT coeffs, const float **x_l, const float **x_r, float **y_l, float **y_r, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x_l`
|
||||
* (left) and `x_r` (right) and fills the first `n_samples` of the
|
||||
* `n_channels` output buffers `y_l` (left) and `y_r` (right), while using
|
||||
* and updating the common `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_balance_set_balance()
|
||||
* ```>>> */
|
||||
@ -170,33 +187,18 @@ static inline void bw_balance_process1(const bw_balance_coeffs *BW_RESTRICT coef
|
||||
|
||||
static inline void bw_balance_process(bw_balance_coeffs *BW_RESTRICT coeffs, const float *x_l, const float *x_r, float *y_l, float *y_r, int n_samples){
|
||||
bw_balance_update_coeffs_ctrl(coeffs);
|
||||
if (y_l != NULL) {
|
||||
if (y_r != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_balance_update_coeffs_audio(coeffs);
|
||||
bw_balance_process1(coeffs, x_l[i], x_r[i], y_l + i, y_r + i);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
static inline void bw_balance_process_multi(bw_balance_coeffs *BW_RESTRICT coeffs, const float **x_l, const float **x_r, float **y_l, float **y_r, int n_channels, int n_samples) {
|
||||
bw_balance_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_balance_update_coeffs_audio(coeffs);
|
||||
float r;
|
||||
bw_balance_process1(coeffs, x_l[i], x_r[i], y_l + i, &r);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_r != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_balance_update_coeffs_audio(coeffs);
|
||||
float l;
|
||||
bw_balance_process1(coeffs, x_l[i], x_r[i], &l, y_r + i);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_balance_update_coeffs_audio(coeffs);
|
||||
float l, r;
|
||||
bw_balance_process1(coeffs, x_l[i], x_r[i], &l, &r);
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_balance_process1(coeffs, x_l[j][i], x_r[j][i], y_l[j] + i, y_r[j] + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math }}}
|
||||
* description {{{
|
||||
* Bit depth reducer.
|
||||
@ -31,6 +31,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_bd_reduce_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Fixed unused parameter warnings.</li>
|
||||
@ -94,12 +99,20 @@ static inline float bw_bd_reduce_process1(const bw_bd_reduce_coeffs *BW_RESTRICT
|
||||
*
|
||||
* #### bw_bd_reduce_process()
|
||||
* ```>>> */
|
||||
static inline void bw_bd_reduce_process(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, const float *x, float* y, int n_samples);
|
||||
static inline void bw_bd_reduce_process(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, const float *x, float *y, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the input buffer `x` and fills the
|
||||
* first `n_samples` of the output buffer `y`, while using and updating
|
||||
* `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_bd_reduce_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_bd_reduce_process_multi(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating the common `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_bd_reduce_set_bit_depth()
|
||||
* ```>>> */
|
||||
static inline void bw_bd_reduce_set_bit_depth(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, char value);
|
||||
@ -153,12 +166,19 @@ static inline float bw_bd_reduce_process1(const bw_bd_reduce_coeffs *BW_RESTRICT
|
||||
return coeffs->ki * (bw_floorf(coeffs->k * bw_clipf(x, -coeffs->max, coeffs->max)) + 0.5f);
|
||||
}
|
||||
|
||||
static inline void bw_bd_reduce_process(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, const float *x, float* y, int n_samples) {
|
||||
static inline void bw_bd_reduce_process(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, const float *x, float *y, int n_samples) {
|
||||
bw_bd_reduce_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[i] = bw_bd_reduce_process1(coeffs, x[i]);
|
||||
}
|
||||
|
||||
static inline void bw_bd_reduce_process_multi(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_bd_reduce_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_bd_reduce_process1(coeffs, x[j][i]);
|
||||
}
|
||||
|
||||
static inline void bw_bd_reduce_set_bit_depth(bw_bd_reduce_coeffs *BW_RESTRICT coeffs, char value) {
|
||||
coeffs->bit_depth = value;
|
||||
}
|
||||
|
@ -38,6 +38,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_chorus_process_multi()</code>.</li>
|
||||
* <li>Updated mem_req/set API.</li>
|
||||
* <li>Now properly setting feedforward delay on reset.</li>
|
||||
* </ul>
|
||||
@ -138,6 +139,15 @@ static inline void bw_chorus_process(bw_chorus_coeffs *BW_RESTRICT coeffs, bw_ch
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_chorus_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_chorus_process_multi(bw_chorus_coeffs *BW_RESTRICT coeffs, bw_chorus_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_chorus_set_rate()
|
||||
* ```>>> */
|
||||
static inline void bw_chorus_set_rate(bw_chorus_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -271,6 +281,15 @@ static inline void bw_chorus_process(bw_chorus_coeffs *BW_RESTRICT coeffs, bw_ch
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_chorus_process_multi(bw_chorus_coeffs *BW_RESTRICT coeffs, bw_chorus_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_chorus_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_chorus_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_chorus_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_chorus_set_rate(bw_chorus_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_phase_gen_set_frequency(&coeffs->phase_gen_coeffs, value);
|
||||
}
|
||||
|
@ -125,6 +125,15 @@ static inline void bw_clip_process(bw_clip_coeffs *BW_RESTRICT coeffs, bw_clip_s
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_clip_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_clip_process_multi(bw_clip_coeffs *BW_RESTRICT coeffs, bw_clip_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_clip_set_bias()
|
||||
* ```>>> */
|
||||
static inline void bw_clip_set_bias(bw_clip_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -258,6 +267,21 @@ static inline void bw_clip_process(bw_clip_coeffs *BW_RESTRICT coeffs, bw_clip_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_clip_process_multi(bw_clip_coeffs *BW_RESTRICT coeffs, bw_clip_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
if (coeffs->gain_compensation)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_clip_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_clip_process1_comp(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_clip_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_clip_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_clip_set_bias(bw_clip_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->bias = value;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_comb_process_multi()</code>.</li>
|
||||
* <li>Updated mem_req/set API.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
@ -139,6 +140,15 @@ static inline void bw_comb_process(bw_comb_coeffs *BW_RESTRICT coeffs, bw_comb_s
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_comb_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_comb_process_multi(bw_comb_coeffs *BW_RESTRICT coeffs, bw_comb_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_comb_set_delay_ff()
|
||||
* ```>>> */
|
||||
static inline void bw_comb_set_delay_ff(bw_comb_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -323,6 +333,15 @@ static inline void bw_comb_process(bw_comb_coeffs *BW_RESTRICT coeffs, bw_comb_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_comb_process_multi(bw_comb_coeffs *BW_RESTRICT coeffs, bw_comb_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_comb_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_comb_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_comb_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_comb_set_delay_ff(bw_comb_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->delay_ff = value;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022 Orastron Srl unipersonale
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -31,6 +31,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_comp_process_multi()</code>.</li>
|
||||
* <li>Fixed typo in <code>bw_comp_set_ratio()</code>
|
||||
* documentation.</li>
|
||||
* </ul>
|
||||
@ -119,6 +120,16 @@ static inline void bw_comp_process(bw_comp_coeffs *BW_RESTRICT coeffs, bw_comp_s
|
||||
* `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_comp_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_comp_process_multi(bw_comp_coeffs *BW_RESTRICT coeffs, bw_comp_state **BW_RESTRICT state, const float **x, const float **x_sc, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* the first `n_samples` of the `n_channels` sidechain input buffers `x_sc`,
|
||||
* and fills the first `n_samples` of the `n_channels` output buffers `y`,
|
||||
* while using and updating both the common `coeffs` and each of the
|
||||
* `n_channels` `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_comp_set_thresh_lin()
|
||||
* ```>>> */
|
||||
static inline void bw_comp_set_thresh_lin(bw_comp_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -264,6 +275,15 @@ static inline void bw_comp_process(bw_comp_coeffs *BW_RESTRICT coeffs, bw_comp_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_comp_process_multi(bw_comp_coeffs *BW_RESTRICT coeffs, bw_comp_state **BW_RESTRICT state, const float **x, const float **x_sc, float **y, int n_channels, int n_samples) {
|
||||
bw_comp_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_comp_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_comp_process1(coeffs, state[j], x[j][i], x_sc[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_comp_set_thresh_lin(bw_comp_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->thresh = value;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_delay_process_multi()</code>.</li>
|
||||
* <li>Updated mem_req/set API.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
@ -112,14 +113,15 @@ static float bw_delay_read(const bw_delay_coeffs *BW_RESTRICT coeffs, const bw_d
|
||||
* Returns the interpolated value read from the delay line identified by
|
||||
* `coeffs` and `state` by applying a delay of `di` + `df` samples.
|
||||
*
|
||||
* `df` must be in [`0.f`, `1.f`) and `di` + `df` must not exceed the delay line
|
||||
* length (maximum delay times the sample rate).
|
||||
* `df` must be in [`0.f`, `1.f`) and `di` + `df` must not exceed the delay
|
||||
* line length (maximum delay times the sample rate).
|
||||
*
|
||||
* #### bw_delay_write()
|
||||
* ```>>> */
|
||||
static void bw_delay_write(const bw_delay_coeffs *BW_RESTRICT coeffs, bw_delay_state *BW_RESTRICT state, float x);
|
||||
/*! <<<```
|
||||
* Pushes the new sample `x` on the delay line identified by `coeffs` and `state.
|
||||
* Pushes the new sample `x` on the delay line identified by `coeffs` and
|
||||
* `state`.
|
||||
*
|
||||
* #### bw_delay_update_coeffs_ctrl()
|
||||
* ```>>> */
|
||||
@ -148,6 +150,15 @@ static inline void bw_delay_process(bw_delay_coeffs *BW_RESTRICT coeffs, bw_dela
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_delay_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_delay_process_multi(bw_delay_coeffs *BW_RESTRICT coeffs, bw_delay_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_delay_set_delay()
|
||||
* ```>>> */
|
||||
static inline void bw_delay_set_delay(bw_delay_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -255,6 +266,13 @@ static inline void bw_delay_process(bw_delay_coeffs *BW_RESTRICT coeffs, bw_dela
|
||||
y[i] = bw_delay_process1(coeffs, state, x[i]);
|
||||
}
|
||||
|
||||
static inline void bw_delay_process_multi(bw_delay_coeffs *BW_RESTRICT coeffs, bw_delay_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_delay_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_delay_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
|
||||
static inline void bw_delay_set_delay(bw_delay_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
if (value != coeffs->delay) {
|
||||
coeffs->delay = value;
|
||||
|
@ -114,6 +114,15 @@ static inline void bw_dist_process(bw_dist_coeffs *BW_RESTRICT coeffs, bw_dist_s
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_dist_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_dist_process_multi(bw_dist_coeffs *BW_RESTRICT coeffs, bw_dist_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_dist_set_distortion()
|
||||
* ```>>> */
|
||||
static inline void bw_dist_set_distortion(bw_dist_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -243,6 +252,15 @@ static inline void bw_dist_process(bw_dist_coeffs *BW_RESTRICT coeffs, bw_dist_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_dist_process_multi(bw_dist_coeffs *BW_RESTRICT coeffs, bw_dist_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_dist_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_dist_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_dist_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_dist_set_distortion(bw_dist_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_peak_set_peak_gain_dB(&coeffs->peak_coeffs, 60.f * value);
|
||||
}
|
||||
|
@ -114,6 +114,15 @@ static inline void bw_drive_process(bw_drive_coeffs *BW_RESTRICT coeffs, bw_driv
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_drive_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_drive_process_multi(bw_drive_coeffs *BW_RESTRICT coeffs, bw_drive_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_drive_set_drive()
|
||||
* ```>>> */
|
||||
static inline void bw_drive_set_drive(bw_drive_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -233,6 +242,15 @@ static inline void bw_drive_process(bw_drive_coeffs *BW_RESTRICT coeffs, bw_driv
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_drive_process_multi(bw_drive_coeffs *BW_RESTRICT coeffs, bw_drive_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_drive_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_drive_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_drive_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_drive_set_drive(bw_drive_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_peak_set_peak_gain_dB(&coeffs->peak_coeffs, 40.f * value);
|
||||
}
|
||||
|
@ -97,6 +97,15 @@ static inline void bw_drywet_process(bw_drywet_coeffs *BW_RESTRICT coeffs, const
|
||||
* wet input buffer `x_wet` and fills the first `n_samples` of the output
|
||||
* buffer `y`, while using and updating `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_drywet_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_drywet_process_multi(bw_drywet_coeffs *BW_RESTRICT coeffs, const float **x_dry, const float **x_wet, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` dry input buffers
|
||||
* `x_dry` and of the `n_channels` wet input buffers `x_wet`, and fills the
|
||||
* first `n_samples` of the `n_channels` output buffers `y`, while using and
|
||||
* updating the common `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_drywet_set_wet()
|
||||
* ```>>> */
|
||||
static inline void bw_drywet_set_wet(bw_drywet_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -158,6 +167,15 @@ static inline void bw_drywet_process(bw_drywet_coeffs *BW_RESTRICT coeffs, const
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_drywet_process_multi(bw_drywet_coeffs *BW_RESTRICT coeffs, const float **x_dry, const float **x_wet, float **y, int n_channels, int n_samples) {
|
||||
bw_drywet_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_drywet_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_drywet_process1(coeffs, x_dry[j][i], x_wet[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_drywet_set_wet(bw_drywet_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_gain_set_gain_lin(&coeffs->gain_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.3.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Envelope follower made of a full-wave rectifier followed by
|
||||
@ -28,6 +28,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_env_follow_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.3.0</strong>:
|
||||
* <ul>
|
||||
* <li>Moved header inclusions where most appropriate.</li>
|
||||
@ -122,6 +127,17 @@ static inline void bw_env_follow_process(bw_env_follow_coeffs *BW_RESTRICT coeff
|
||||
*
|
||||
* `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_env_follow_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_env_follow_process_multi(bw_env_follow_coeffs *BW_RESTRICT coeffs, bw_env_follow_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* `y` or any element of `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_env_follow_set_attack_tau()
|
||||
* ```>>> */
|
||||
static inline void bw_env_follow_set_attack_tau(bw_env_follow_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -207,6 +223,25 @@ static inline void bw_env_follow_process(bw_env_follow_coeffs *BW_RESTRICT coeff
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_env_follow_process_multi(bw_env_follow_coeffs *BW_RESTRICT coeffs, bw_env_follow_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_env_follow_update_coeffs_ctrl(coeffs);
|
||||
if (y != NULL)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_env_follow_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
const float v = bw_env_follow_process1(coeffs, state[j], x[j][i]);
|
||||
if (y[j] != NULL)
|
||||
y[j][i] = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_env_follow_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_env_follow_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_env_follow_set_attack_tau(bw_env_follow_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_one_pole_set_tau_up(&coeffs->one_pole_coeffs, value);
|
||||
}
|
||||
|
@ -42,6 +42,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_env_follow_process_multi()</code>.</li>
|
||||
* <li>Added <code>gate</code> argument to
|
||||
* <code>bw_env_gen_update_state_ctrl()</code> and
|
||||
* <code>bw_env_gen_process()</code>, and removed gate
|
||||
@ -164,7 +165,7 @@ static inline float bw_env_gen_process1(const bw_env_gen_coeffs *BW_RESTRICT coe
|
||||
*
|
||||
* #### bw_env_gen_process()
|
||||
* ```>>> */
|
||||
static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate, float* y, int n_samples);
|
||||
static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate, float *y, int n_samples);
|
||||
/*! <<<```
|
||||
* Generates and fills the first `n_samples` of the output buffer `y` using
|
||||
* the given `gate` value (`0` for off, non-`0` for on), while using and
|
||||
@ -172,6 +173,17 @@ static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_
|
||||
*
|
||||
* `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_env_gen_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_env_gen_process_multi(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state **BW_RESTRICT state, char *gate, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Generates and fills the first `n_samples` of the `n_channels` output
|
||||
* buffers `y` using the given `n_channels` `gate` values (`0` for off,
|
||||
* non-`0` for on), while using and updating both the common `coeffs` and
|
||||
* each of the `n_channels` `state`s (control and audio rate).
|
||||
*
|
||||
* `y` or any element of `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_env_gen_set_attack()
|
||||
* ```>>> */
|
||||
static inline void bw_env_gen_set_attack(bw_env_gen_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -350,7 +362,7 @@ static inline float bw_env_gen_process1(const bw_env_gen_coeffs *BW_RESTRICT coe
|
||||
return v;
|
||||
}
|
||||
|
||||
static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate, float* y, int n_samples) {
|
||||
static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate, float *y, int n_samples) {
|
||||
bw_env_gen_update_coeffs_ctrl(coeffs);
|
||||
bw_env_gen_update_state_ctrl(coeffs, state, gate);
|
||||
if (y != NULL)
|
||||
@ -361,6 +373,23 @@ static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_
|
||||
bw_env_gen_process1(coeffs, state);
|
||||
}
|
||||
|
||||
static inline void bw_env_gen_process_multi(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state **BW_RESTRICT state, char *gate, float **y, int n_channels, int n_samples) {
|
||||
bw_env_gen_update_coeffs_ctrl(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_env_gen_update_state_ctrl(coeffs, state[j], gate[j]);
|
||||
if (y != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
const float v = bw_env_gen_process1(coeffs, state[j]);
|
||||
if (y[j] != NULL)
|
||||
y[j][i] = v;
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_env_gen_process1(coeffs, state[j]);
|
||||
}
|
||||
|
||||
static inline void bw_env_gen_set_attack(bw_env_gen_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
if (coeffs->attack != value) {
|
||||
coeffs->attack = value;
|
||||
|
@ -114,6 +114,15 @@ static inline void bw_fuzz_process(bw_fuzz_coeffs *BW_RESTRICT coeffs, bw_fuzz_s
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_fuzz_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_fuzz_process_multi(bw_fuzz_coeffs *BW_RESTRICT coeffs, bw_fuzz_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_fuzz_set_fuzz()
|
||||
* ```>>> */
|
||||
static inline void bw_fuzz_set_fuzz(bw_fuzz_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -225,6 +234,15 @@ static inline void bw_fuzz_process(bw_fuzz_coeffs *BW_RESTRICT coeffs, bw_fuzz_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_fuzz_process_multi(bw_fuzz_coeffs *BW_RESTRICT coeffs, bw_fuzz_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_fuzz_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_fuzz_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_fuzz_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_fuzz_set_fuzz(bw_fuzz_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_hs1_set_high_gain_dB(&coeffs->hs1_coeffs, 35.f * value);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_gain_process_multi()</code>.</li>
|
||||
* <li>Added <code>bw_gain_get_gain()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
@ -115,6 +116,14 @@ static inline void bw_gain_process(bw_gain_coeffs *BW_RESTRICT coeffs, const flo
|
||||
* first `n_samples` of the output buffer `y`, while using and updating
|
||||
* `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_gain_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_gain_process_multi(bw_gain_coeffs *BW_RESTRICT coeffs, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating the common `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_gain_set_gain_lin()
|
||||
* ```>>> */
|
||||
static inline void bw_gain_set_gain_lin(bw_gain_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -210,6 +219,15 @@ static inline void bw_gain_process(bw_gain_coeffs *BW_RESTRICT coeffs, const flo
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_gain_process_multi(bw_gain_coeffs *BW_RESTRICT coeffs, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_gain_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_gain_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_gain_process1(coeffs, x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_gain_set_gain_lin(bw_gain_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->gain = value;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_lp1 bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order highpass filter (6 dB/oct) with gain asymptotically
|
||||
@ -28,6 +28,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_hp1_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -117,6 +122,15 @@ static inline void bw_hp1_process(bw_hp1_coeffs *BW_RESTRICT coeffs, bw_hp1_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_hp1_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_hp1_process_multi(bw_hp1_coeffs *BW_RESTRICT coeffs, bw_hp1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_hp1_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_hp1_set_cutoff(bw_hp1_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -179,6 +193,15 @@ static inline void bw_hp1_process(bw_hp1_coeffs *BW_RESTRICT coeffs, bw_hp1_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_hp1_process_multi(bw_hp1_coeffs *BW_RESTRICT coeffs, bw_hp1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_hp1_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_hp1_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_hp1_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_hp1_set_cutoff(bw_hp1_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_lp1_set_cutoff(&coeffs->lp1_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_config bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole
|
||||
* }}}
|
||||
@ -29,6 +29,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_hs1_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -118,6 +123,15 @@ static inline void bw_hs1_process(bw_hs1_coeffs *BW_RESTRICT coeffs, bw_hs1_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_hs1_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_hs1_process_multi(bw_hs1_coeffs *BW_RESTRICT coeffs, bw_hs1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_hs1_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_hs1_set_cutoff(bw_hs1_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -222,6 +236,15 @@ static inline void bw_hs1_process(bw_hs1_coeffs *BW_RESTRICT coeffs, bw_hs1_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_hs1_process_multi(bw_hs1_coeffs *BW_RESTRICT coeffs, bw_hs1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_hs1_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_hs1_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_hs1_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_hs1_set_cutoff(bw_hs1_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
if (value != coeffs->cutoff) {
|
||||
coeffs->cutoff = value;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_config bw_gain bw_math bw_mm2 bw_one_pole bw_svf
|
||||
* }}}
|
||||
@ -29,6 +29,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_hs2_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -118,6 +123,15 @@ static inline void bw_hs2_process(bw_hs2_coeffs *BW_RESTRICT coeffs, bw_hs2_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_hs2_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_hs2_process_multi(bw_hs2_coeffs *BW_RESTRICT coeffs, bw_hs2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_hs2_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_hs2_set_cutoff(bw_hs2_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -242,6 +256,15 @@ static inline void bw_hs2_process(bw_hs2_coeffs *BW_RESTRICT coeffs, bw_hs2_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_hs2_process_multi(bw_hs2_coeffs *BW_RESTRICT coeffs, bw_hs2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_hs2_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_hs2_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_hs2_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_hs2_set_cutoff(bw_hs2_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
if (coeffs->cutoff) {
|
||||
coeffs->cutoff = value;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order lowpass filter (6 dB/oct) with unitary DC gain.
|
||||
@ -30,6 +30,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_lp1_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -120,6 +125,15 @@ static inline void bw_lp1_process(bw_lp1_coeffs *BW_RESTRICT coeffs, bw_lp1_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_lp1_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_lp1_process_multi(bw_lp1_coeffs *BW_RESTRICT coeffs, bw_lp1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_lp1_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_lp1_set_cutoff(bw_lp1_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -252,6 +266,14 @@ static inline void bw_lp1_process(bw_lp1_coeffs *BW_RESTRICT coeffs, bw_lp1_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_lp1_process_multi(bw_lp1_coeffs *BW_RESTRICT coeffs, bw_lp1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_lp1_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_lp1_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_lp1_set_cutoff(bw_lp1_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->cutoff = value;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_config bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole
|
||||
* }}}
|
||||
@ -30,6 +30,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_ls1_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -119,6 +124,15 @@ static inline void bw_ls1_process(bw_ls1_coeffs *BW_RESTRICT coeffs, bw_ls1_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_ls1_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_ls1_process_multi(bw_ls1_coeffs *BW_RESTRICT coeffs, bw_ls1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_ls1_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_ls1_set_cutoff(bw_ls1_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -219,6 +233,15 @@ static inline void bw_ls1_process(bw_ls1_coeffs *BW_RESTRICT coeffs, bw_ls1_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ls1_process_multi(bw_ls1_coeffs *BW_RESTRICT coeffs, bw_ls1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_ls1_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ls1_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_ls1_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ls1_set_cutoff(bw_ls1_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
if (value != coeffs->cutoff) {
|
||||
coeffs->cutoff = value;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_config bw_gain bw_math bw_mm2 bw_one_pole bw_svf
|
||||
* }}}
|
||||
@ -30,6 +30,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_ls2_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -119,6 +124,15 @@ static inline void bw_ls2_process(bw_ls2_coeffs *BW_RESTRICT coeffs, bw_ls2_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_ls2_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_ls2_process_multi(bw_ls2_coeffs *BW_RESTRICT coeffs, bw_ls2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_ls2_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_ls2_set_cutoff(bw_ls2_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -241,6 +255,15 @@ static inline void bw_ls2_process(bw_ls2_coeffs *BW_RESTRICT coeffs, bw_ls2_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ls2_process_multi(bw_ls2_coeffs *BW_RESTRICT coeffs, bw_ls2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_ls2_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ls2_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_ls2_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ls2_set_cutoff(bw_ls2_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
if (coeffs->cutoff != value) {
|
||||
coeffs->cutoff = value;
|
||||
|
@ -20,13 +20,18 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_gain bw_lp1 bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order multimode filter.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_mm1_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -116,6 +121,15 @@ static inline void bw_mm1_process(bw_mm1_coeffs *BW_RESTRICT coeffs, bw_mm1_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_mm1_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_mm1_process_multi(bw_mm1_coeffs *BW_RESTRICT coeffs, bw_mm1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_mm1_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_mm1_set_cutoff(bw_mm1_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -232,6 +246,15 @@ static inline void bw_mm1_process(bw_mm1_coeffs *BW_RESTRICT coeffs, bw_mm1_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_mm1_process_multi(bw_mm1_coeffs *BW_RESTRICT coeffs, bw_mm1_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_mm1_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_mm1_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_mm1_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_mm1_set_cutoff(bw_mm1_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_lp1_set_cutoff(&coeffs->lp1_coeffs, value);
|
||||
}
|
||||
|
@ -20,13 +20,18 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_gain bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order multimode filter.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_mm2_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -116,6 +121,15 @@ static inline void bw_mm2_process(bw_mm2_coeffs *BW_RESTRICT coeffs, bw_mm2_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_mm2_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_mm2_process_multi(bw_mm2_coeffs *BW_RESTRICT coeffs, bw_mm2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_mm2_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_mm2_set_cutoff(bw_mm2_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -277,6 +291,15 @@ static inline void bw_mm2_process(bw_mm2_coeffs *BW_RESTRICT coeffs, bw_mm2_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_mm2_process_multi(bw_mm2_coeffs *BW_RESTRICT coeffs, bw_mm2_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_mm2_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_mm2_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_mm2_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_mm2_set_cutoff(bw_mm2_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_svf_set_cutoff(&coeffs->svf_coeffs, value);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022 Orastron Srl unipersonale
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -20,13 +20,18 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.3.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_env_follow bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Noise gate with independent sidechain input.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_noise_gate_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.3.0</strong>:
|
||||
* <ul>
|
||||
* <li>First release.</li>
|
||||
@ -111,6 +116,16 @@ static inline void bw_noise_gate_process(bw_noise_gate_coeffs *BW_RESTRICT coeff
|
||||
* `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_noise_gate_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_noise_gate_process_multi(bw_noise_gate_coeffs *BW_RESTRICT coeffs, bw_noise_gate_state **BW_RESTRICT state, const float **x, const float **x_sc, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* the first `n_samples` of the `n_channels` sidechain input buffers `x_sc`,
|
||||
* and fills the first `n_samples` of the `n_channels` output buffers `y`,
|
||||
* while using and updating both the common `coeffs` and each of the
|
||||
* `n_channels` `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_noise_gate_set_thresh_lin()
|
||||
* ```>>> */
|
||||
static inline void bw_noise_gate_set_thresh_lin(bw_noise_gate_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -233,6 +248,15 @@ static inline void bw_noise_gate_process(bw_noise_gate_coeffs *BW_RESTRICT coeff
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_noise_gate_process_multi(bw_noise_gate_coeffs *BW_RESTRICT coeffs, bw_noise_gate_state **BW_RESTRICT state, const float **x, const float **x_sc, float **y, int n_channels, int n_samples) {
|
||||
bw_noise_gate_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_noise_gate_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_noise_gate_process1(coeffs, state[j], x[j][i], x_sc[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_noise_gate_set_thresh_lin(bw_noise_gate_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->thresh = value;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order notch filter with unitary gain at DC and asymptotically as
|
||||
@ -28,6 +28,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_notch_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added initial input value to
|
||||
@ -117,6 +122,15 @@ static inline void bw_notch_process(bw_notch_coeffs *BW_RESTRICT coeffs, bw_notc
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_notch_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_notch_process_multi(bw_notch_coeffs *BW_RESTRICT coeffs, bw_notch_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_notch_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_notch_set_cutoff(bw_notch_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -190,6 +204,15 @@ static inline void bw_notch_process(bw_notch_coeffs *BW_RESTRICT coeffs, bw_notc
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_notch_process_multi(bw_notch_coeffs *BW_RESTRICT coeffs, bw_notch_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_notch_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_notch_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_notch_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_notch_set_cutoff(bw_notch_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_svf_set_cutoff(&coeffs->svf_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math }}}
|
||||
* description {{{
|
||||
* One-pole (6 dB/oct) lowpass filter with unitary DC gain, separate attack
|
||||
@ -30,6 +30,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_one_pole_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Fixed unused parameter warnings.</li>
|
||||
@ -164,6 +169,17 @@ static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, b
|
||||
*
|
||||
* `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_one_pole_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_one_pole_process_multi(bw_one_pole_coeffs *BW_RESTRICT coeffs, bw_one_pole_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* `y` or any element of `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_one_pole_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_one_pole_set_cutoff(bw_one_pole_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -448,6 +464,106 @@ static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, b
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_one_pole_process_multi(bw_one_pole_coeffs *BW_RESTRICT coeffs, bw_one_pole_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_one_pole_update_coeffs_ctrl(coeffs);
|
||||
if (y != NULL) {
|
||||
if (coeffs->mA1u != coeffs->mA1d) {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_asym_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
|
||||
else
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_asym_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_asym(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (coeffs->mA1u != coeffs->mA1d) {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_asym_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_asym_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_asym(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_one_pole_set_cutoff(bw_one_pole_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_one_pole_set_cutoff_up(coeffs, value);
|
||||
bw_one_pole_set_cutoff_down(coeffs, value);
|
||||
|
@ -78,7 +78,7 @@ static inline float bw_osc_filt_process1(bw_osc_filt_state *BW_RESTRICT state, f
|
||||
*
|
||||
* #### bw_osc_filt_process()
|
||||
* ```>>> */
|
||||
static inline void bw_osc_filt_process(bw_osc_filt_state *BW_RESTRICT state, const float *x, float* y, int n_samples);
|
||||
static inline void bw_osc_filt_process(bw_osc_filt_state *BW_RESTRICT state, const float *x, float *y, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the input buffer `x` and fills the
|
||||
* first `n_samples` of the output buffer `y`, while using and updating
|
||||
@ -107,7 +107,7 @@ static inline float bw_osc_filt_process1(bw_osc_filt_state *BW_RESTRICT state, f
|
||||
return y;
|
||||
}
|
||||
|
||||
static inline void bw_osc_filt_process(bw_osc_filt_state *BW_RESTRICT state, const float *x, float* y, int n_samples) {
|
||||
static inline void bw_osc_filt_process(bw_osc_filt_state *BW_RESTRICT state, const float *x, float *y, int n_samples) {
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[i] = bw_osc_filt_process1(state, x[i]);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Pulse oscillator waveshaper with variable pulse width (actually, duty
|
||||
@ -31,6 +31,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_osc_pulse_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Fixed unused parameter warnings.</li>
|
||||
@ -116,11 +121,24 @@ static inline void bw_osc_pulse_process(bw_osc_pulse_coeffs *BW_RESTRICT coeffs,
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the input buffer `x`, containing the
|
||||
* normalized phase signal, and fills the first `n_samples` of the output
|
||||
* buffer `y`, while using and updating `coeffs`.
|
||||
* buffer `y`, while using and updating `coeffs` (control and audio rate).
|
||||
*
|
||||
* If antialiasing is enabled, `x_phase_inc` must contain phase increment
|
||||
* values, otherwise it is ignored and can be `NULL`.
|
||||
*
|
||||
* #### bw_osc_pulse_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_osc_pulse_process_multi(bw_osc_pulse_coeffs *BW_RESTRICT coeffs, const float **x, const float **x_phase_inc, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x`,
|
||||
* containing the normalized phase signals, and fills the first `n_samples`
|
||||
* of the `n_channels` output buffers `y`, while using and updating the
|
||||
* common `coeffs` (control and audio rate).
|
||||
*
|
||||
* If antialiasing is enabled, `x_phase_inc` must contain `n_channels`
|
||||
* buffers of phase increment values, otherwise it is ignored and can be
|
||||
* `NULL`.
|
||||
*
|
||||
* #### bw_osc_pulse_set_antialiasing()
|
||||
* ```>>> */
|
||||
static inline void bw_osc_pulse_set_antialiasing(bw_osc_pulse_coeffs *BW_RESTRICT coeffs, char value);
|
||||
@ -229,6 +247,21 @@ static inline void bw_osc_pulse_process(bw_osc_pulse_coeffs *BW_RESTRICT coeffs,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_osc_pulse_process_multi(bw_osc_pulse_coeffs *BW_RESTRICT coeffs, const float **x, const float **x_phase_inc, float **y, int n_channels, int n_samples) {
|
||||
if (coeffs->antialiasing)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_osc_pulse_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_osc_pulse_process1_antialias(coeffs, x[j][i], x_phase_inc[j][i]);
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_osc_pulse_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_osc_pulse_process1(coeffs, x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_osc_pulse_set_antialiasing(bw_osc_pulse_coeffs *BW_RESTRICT coeffs, char value) {
|
||||
coeffs->antialiasing = value;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_osc_pulse_process_multi()</code>.</li>
|
||||
* <li>Fixed typo in <code>bw_osc_tri_process1\*()</code>
|
||||
* documentation.</li>
|
||||
* </ul>
|
||||
@ -127,6 +128,19 @@ static inline void bw_osc_tri_process(bw_osc_tri_coeffs *BW_RESTRICT coeffs, con
|
||||
* If antialiasing is enabled, `x_phase_inc` must contain phase increment
|
||||
* values, otherwise it is ignored and can be `NULL`.
|
||||
*
|
||||
* #### bw_osc_tri_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_osc_tri_process_multi(bw_osc_tri_coeffs *BW_RESTRICT coeffs, const float **x, const float **x_phase_inc, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x`,
|
||||
* containing the normalized phase signals, and fills the first `n_samples`
|
||||
* of the `n_channels` output buffers `y`, while using and updating the
|
||||
* common `coeffs` (control and audio rate).
|
||||
*
|
||||
* If antialiasing is enabled, `x_phase_inc` must contain `n_channels`
|
||||
* buffers of phase increment values, otherwise it is ignored and can be
|
||||
* `NULL`.
|
||||
*
|
||||
* #### bw_osc_tri_set_antialiasing()
|
||||
* ```>>> */
|
||||
static inline void bw_osc_tri_set_antialiasing(bw_osc_tri_coeffs *BW_RESTRICT coeffs, char value);
|
||||
@ -241,6 +255,21 @@ static inline void bw_osc_tri_process(bw_osc_tri_coeffs *BW_RESTRICT coeffs, con
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_osc_tri_process_multi(bw_osc_tri_coeffs *BW_RESTRICT coeffs, const float **x, const float **x_phase_inc, float **y, int n_channels, int n_samples) {
|
||||
if (coeffs->antialiasing)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_osc_tri_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_osc_tri_process1_antialias(coeffs, x[j][i], x_phase_inc[j][i]);
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_osc_tri_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_osc_tri_process1(coeffs, x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_osc_tri_set_antialiasing(bw_osc_tri_coeffs *BW_RESTRICT coeffs, char value) {
|
||||
coeffs->antialiasing = value;
|
||||
}
|
||||
|
@ -27,6 +27,13 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_pan_process_multi()</code>.</li>
|
||||
* <li><code>bw_pan_process()</code> does not accept <code>NULL</code>
|
||||
* buffers anymore.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.3.0</strong>:
|
||||
* <ul>
|
||||
* <li>First release.</li>
|
||||
@ -95,9 +102,17 @@ static inline void bw_pan_process1(const bw_pan_coeffs *BW_RESTRICT coeffs, floa
|
||||
static inline void bw_pan_process(bw_pan_coeffs *BW_RESTRICT coeffs, const float *x, float *y_l, float *y_r, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the input buffer `x` and fills the
|
||||
* first `n_samples` of the output buffers `y_l` (left) and `y_r` (right), if
|
||||
* they are not `NULL`, while using and updating `coeffs` (control and audio
|
||||
* rate).
|
||||
* first `n_samples` of the output buffers `y_l` (left) and `y_r` (right),
|
||||
* while using and updating `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_pan_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_pan_process_multi(bw_pan_coeffs *BW_RESTRICT coeffs, const float **x, float **y_l, float **y_r, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y_l`
|
||||
* (left) and `y_r` (right), while using and updating the common `coeffs`
|
||||
* (control and audio rate).
|
||||
*
|
||||
* #### bw_pan_set_pan()
|
||||
* ```>>> */
|
||||
@ -171,33 +186,18 @@ static inline void bw_pan_process1(const bw_pan_coeffs *BW_RESTRICT coeffs, floa
|
||||
|
||||
static inline void bw_pan_process(bw_pan_coeffs *BW_RESTRICT coeffs, const float *x, float *y_l, float *y_r, int n_samples) {
|
||||
bw_pan_update_coeffs_ctrl(coeffs);
|
||||
if (y_l != NULL) {
|
||||
if (y_r != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_pan_update_coeffs_audio(coeffs);
|
||||
bw_pan_process1(coeffs, x[i], y_l + i, y_r + i);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
static inline void bw_pan_process_multi(bw_pan_coeffs *BW_RESTRICT coeffs, const float **x, float **y_l, float **y_r, int n_channels, int n_samples) {
|
||||
bw_pan_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_pan_update_coeffs_audio(coeffs);
|
||||
float r;
|
||||
bw_pan_process1(coeffs, x[i], y_l + i, &r);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_r != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_pan_update_coeffs_audio(coeffs);
|
||||
float l;
|
||||
bw_pan_process1(coeffs, x[i], &l, y_r + i);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_pan_update_coeffs_audio(coeffs);
|
||||
float l, r;
|
||||
bw_pan_process1(coeffs, x[i], &l, &r);
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_pan_process1(coeffs, x[j][i], y_l[j] + i, y_r[j] + i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_peak_process_multi()</code>.</li>
|
||||
* <li>Fixed documentation for <code>bw_peak_set_peak_gain_lin()</code>
|
||||
* and <code>bw_peak_set_gain_dB()</code>.</li>
|
||||
* </ul>
|
||||
@ -132,6 +133,15 @@ static inline void bw_peak_process(bw_peak_coeffs *BW_RESTRICT coeffs, bw_peak_s
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_peak_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_peak_process_multi(bw_peak_coeffs *BW_RESTRICT coeffs, bw_peak_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_peak_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_peak_set_cutoff(bw_peak_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -280,6 +290,15 @@ static inline void bw_peak_process(bw_peak_coeffs *BW_RESTRICT coeffs, bw_peak_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_peak_process_multi(bw_peak_coeffs *BW_RESTRICT coeffs, bw_peak_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_peak_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_peak_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_peak_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_peak_set_cutoff(bw_peak_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_mm2_set_cutoff(&coeffs->mm2_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Phase generator with portamento and exponential frequency modulation.
|
||||
@ -29,6 +29,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_phase_gen_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Fixed unused parameter warnings.</li>
|
||||
@ -129,7 +134,7 @@ static inline void bw_phase_gen_process1_mod(const bw_phase_gen_coeffs *BW_RESTR
|
||||
*
|
||||
* #### bw_phase_gen_process()
|
||||
* ```>>> */
|
||||
static inline void bw_phase_gen_process(bw_phase_gen_coeffs *BW_RESTRICT coeffs, bw_phase_gen_state *BW_RESTRICT state, const float *x_mod, float* y, float *y_phase_inc, int n_samples);
|
||||
static inline void bw_phase_gen_process(bw_phase_gen_coeffs *BW_RESTRICT coeffs, bw_phase_gen_state *BW_RESTRICT state, const float *x_mod, float *y, float *y_phase_inc, int n_samples);
|
||||
/*! <<<```
|
||||
* Generates and fills the first `n_samples` of the output buffer `y`, while
|
||||
* using and updating both `coeffs` and `state` (control and audio rate).
|
||||
@ -139,6 +144,21 @@ static inline void bw_phase_gen_process(bw_phase_gen_coeffs *BW_RESTRICT coeffs,
|
||||
*
|
||||
* If `y_inc` is not `NULL`, it is filled with phase increment values.
|
||||
*
|
||||
* #### bw_phase_gen_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_phase_gen_process_multi(bw_phase_gen_coeffs *BW_RESTRICT coeffs, bw_phase_gen_state **BW_RESTRICT state, const float **x_mod, float **y, float **y_phase_inc, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Generates and fills the first `n_samples` of the `n_channels` output
|
||||
* buffers `y`, while using and updating both the common `coeffs` and each of
|
||||
* the `n_channels` `state`s (control and audio rate).
|
||||
*
|
||||
* If `x_mod` and the channel-specific element are not `NULL`, this is used
|
||||
* as a source of exponential frequency modulation (scale `1.f`/octave) for
|
||||
* that channel.
|
||||
*
|
||||
* If `y_inc` and the channel-specific element are not `NULL`, this is filled
|
||||
* with phase increment values for that channel.
|
||||
*
|
||||
* #### bw_phase_gen_set_frequency()
|
||||
* ```>>> */
|
||||
static inline void bw_phase_gen_set_frequency(bw_phase_gen_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -295,6 +315,111 @@ static inline void bw_phase_gen_process(bw_phase_gen_coeffs *BW_RESTRICT coeffs,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_phase_gen_process_multi(bw_phase_gen_coeffs *BW_RESTRICT coeffs, bw_phase_gen_state **BW_RESTRICT state, const float **x_mod, float **y, float **y_phase_inc, int n_channels, int n_samples) {
|
||||
bw_phase_gen_update_coeffs_ctrl(coeffs);
|
||||
if (y != NULL) {
|
||||
if (x_mod != NULL) {
|
||||
if (y_phase_inc != NULL)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
if (x_mod[j])
|
||||
bw_phase_gen_process1_mod(coeffs, state[j], x_mod[j][i], &v, &v_phase_inc);
|
||||
else
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
if (y[j])
|
||||
y[j][i] = v;
|
||||
if (y_phase_inc[j])
|
||||
y_phase_inc[j][i] = v_phase_inc;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
if (x_mod[j])
|
||||
bw_phase_gen_process1_mod(coeffs, state[j], x_mod[j][i], &v, &v_phase_inc);
|
||||
else
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
if (y[j])
|
||||
y[j][i] = v;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_phase_inc != NULL)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
if (y[j])
|
||||
y[j][i] = v;
|
||||
if (y_phase_inc[j])
|
||||
y_phase_inc[j][i] = v_phase_inc;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
if (y[j])
|
||||
y[j][i] = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (x_mod != NULL) {
|
||||
if (y_phase_inc != NULL)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
if (x_mod[j])
|
||||
bw_phase_gen_process1_mod(coeffs, state[j], x_mod[j][i], &v, &v_phase_inc);
|
||||
else
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
if (y_phase_inc[j])
|
||||
y_phase_inc[j][i] = v_phase_inc;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
if (x_mod[j])
|
||||
bw_phase_gen_process1_mod(coeffs, state[j], x_mod[j][i], &v, &v_phase_inc);
|
||||
else
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_phase_inc != NULL)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
if (y_phase_inc[j])
|
||||
y_phase_inc[j][i] = v_phase_inc;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phase_gen_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v, v_phase_inc;
|
||||
bw_phase_gen_process1(coeffs, state[j], &v, &v_phase_inc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_phase_gen_set_frequency(bw_phase_gen_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->frequency = value;
|
||||
}
|
||||
|
@ -33,6 +33,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_phaser_process_multi()</code>.</li>
|
||||
* <li>Now properly setting allpass cutoff on reset.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
@ -118,6 +119,15 @@ static inline void bw_phaser_process(bw_phaser_coeffs *BW_RESTRICT coeffs, bw_ph
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_phaser_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_phaser_process_multi(bw_phaser_coeffs *BW_RESTRICT coeffs, bw_phaser_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_phaser_set_rate()
|
||||
* ```>>> */
|
||||
static inline void bw_phaser_set_rate(bw_phaser_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -227,6 +237,15 @@ static inline void bw_phaser_process(bw_phaser_coeffs *BW_RESTRICT coeffs, bw_ph
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_phaser_process_multi(bw_phaser_coeffs *BW_RESTRICT coeffs, bw_phaser_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_phaser_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_phaser_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_phaser_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_phaser_set_rate(bw_phaser_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_phase_gen_set_frequency(&coeffs->phase_gen_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.3.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_env_follow bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Digital peak programme meter with adjustable integration time constant.
|
||||
@ -30,6 +30,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_ppm_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.3.0</strong>:
|
||||
* <ul>
|
||||
* <li>First release.</li>
|
||||
@ -116,6 +121,19 @@ static inline void bw_ppm_process(bw_ppm_coeffs *BW_RESTRICT coeffs, bw_ppm_stat
|
||||
*
|
||||
* `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_ppm_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_ppm_process_multi(bw_ppm_coeffs *BW_RESTRICT coeffs, bw_ppm_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* Output sample values are in dBFS.
|
||||
*
|
||||
* `y` or any element of `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_ppm_set_integration_time()
|
||||
* ```>>> */
|
||||
static inline void bw_ppm_set_integration_tau(bw_ppm_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -195,6 +213,25 @@ static inline void bw_ppm_process(bw_ppm_coeffs *BW_RESTRICT coeffs, bw_ppm_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ppm_process_multi(bw_ppm_coeffs *BW_RESTRICT coeffs, bw_ppm_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_ppm_update_coeffs_ctrl(coeffs);
|
||||
if (y != NULL)
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ppm_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
const float v = bw_ppm_process1(coeffs, state[j], x[j][i]);
|
||||
if (y[j] != NULL)
|
||||
y[j][i] = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ppm_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_ppm_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ppm_set_integration_tau(bw_ppm_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_env_follow_set_attack_tau(&coeffs->env_follow_coeffs, value);
|
||||
}
|
||||
|
@ -119,16 +119,28 @@ static inline void bw_reverb_update_coeffs_audio(bw_reverb_coeffs *BW_RESTRICT c
|
||||
* ```>>> */
|
||||
static inline void bw_reverb_process1(const bw_reverb_coeffs *BW_RESTRICT coeffs, bw_reverb_state *BW_RESTRICT state, float xl, float xr, float *yl, float *yr);
|
||||
/*! <<<```
|
||||
* Processes two input samples `xl` and `xr` using `coeffs`, while using and
|
||||
* updating `state`. Writes the corresponding output samples `yl` and `yr`.
|
||||
* Processes one set of input samples `xl` (left) and `xr` (right) using
|
||||
* `coeffs`, while using and updating `state`. The left and right output
|
||||
* samples are put into `yl` (left) and `yr` (right) respectively.
|
||||
*
|
||||
* #### bw_reverb_process()
|
||||
* ```>>> */
|
||||
static inline void bw_reverb_process(bw_reverb_coeffs *BW_RESTRICT coeffs, bw_reverb_state *BW_RESTRICT state, const float *xl, const float *xr, float *yl, float *yr, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the input buffers `xl` and `xr` and
|
||||
* fills the first `n_samples` of the output buffers `yl` and `yr`, while
|
||||
* using and updating both `coeffs` and `state` (control and audio rate).
|
||||
* Processes the first `n_samples` of the input buffers `xl` (left) and `xr`
|
||||
* (right) and fills the first `n_samples` of the output buffers `yl` (left)
|
||||
* and `yr` (right), while using and updating both `coeffs` and `state`
|
||||
* (control and audio rate).
|
||||
*
|
||||
* #### bw_reverb_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_reverb_process_multi(bw_reverb_coeffs *BW_RESTRICT coeffs, bw_reverb_state **BW_RESTRICT state, const float **xl, const float **xr, float **yl, float **yr, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `xl`
|
||||
* (left) and `xr` (right) and fills the first `n_samples` of the
|
||||
* `n_channels` output buffers `yl` (left) and `yr` (right), while using and
|
||||
* updating both the common `coeffs` and each of the `n_channels` `state`s
|
||||
* (control and audio rate).
|
||||
*
|
||||
* #### bw_reverb_set_predelay()
|
||||
* ```>>> */
|
||||
@ -551,6 +563,15 @@ static inline void bw_reverb_process(bw_reverb_coeffs *BW_RESTRICT coeffs, bw_re
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_reverb_process_multi(bw_reverb_coeffs *BW_RESTRICT coeffs, bw_reverb_state **BW_RESTRICT state, const float **xl, const float **xr, float **yl, float **yr, int n_channels, int n_samples) {
|
||||
bw_reverb_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_reverb_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
bw_reverb_process1(coeffs, state[j], xl[j][i], xr[j][i], yl[j] + i, yr[j] + i);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_reverb_set_predelay(bw_reverb_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->predelay = coeffs->T * bw_roundf(coeffs->fs * value);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_ringmod_process_multi()</code>.</li>
|
||||
* <li>Fixed inverted-polarity modulation.</li>
|
||||
* <li>"modulator signal" -> "modulation signal" in documentation.</li>
|
||||
* </ul>
|
||||
@ -104,6 +105,15 @@ static inline void bw_ringmod_process(bw_ringmod_coeffs *BW_RESTRICT coeffs, con
|
||||
* output buffer `y`, while using and updating `coeffs` (control and audio
|
||||
* rate).
|
||||
*
|
||||
* #### bw_ringmod_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_ringmod_process_multi(bw_ringmod_coeffs *BW_RESTRICT coeffs, const float **x_mod, const float **x_car, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` modulation input
|
||||
* buffers `x_mod` and of the `n_channels` carrier input buffers `x_car`, and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating the common `coeffs` (control and audio rate).
|
||||
*
|
||||
* #### bw_ringmod_set_amount()
|
||||
* ```>>> */
|
||||
static inline void bw_ringmod_set_amount(bw_ringmod_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -167,6 +177,14 @@ static inline void bw_ringmod_process(bw_ringmod_coeffs *BW_RESTRICT coeffs, con
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ringmod_process_multi(bw_ringmod_coeffs *BW_RESTRICT coeffs, const float **x_mod, const float **x_car, float **y, int n_channels, int n_samples) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_ringmod_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_ringmod_process1(coeffs, x_mod[j][i], x_car[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_ringmod_set_amount(bw_ringmod_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->mod_amount = value;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_satur_process_multi()</code>.</li>
|
||||
* <li>Fixed gain coefficient reset bug.</li>
|
||||
* <li>Fixed initial state bug.</li>
|
||||
* </ul>
|
||||
@ -136,6 +137,15 @@ static inline void bw_satur_process(bw_satur_coeffs *BW_RESTRICT coeffs, bw_satu
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_satur_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_satur_process_multi(bw_satur_coeffs *BW_RESTRICT coeffs, bw_satur_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_satur_set_bias()
|
||||
* ```>>> */
|
||||
static inline void bw_satur_set_bias(bw_satur_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -275,6 +285,15 @@ static inline void bw_satur_process(bw_satur_coeffs *BW_RESTRICT coeffs, bw_satu
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_satur_process_multi(bw_satur_coeffs *BW_RESTRICT coeffs, bw_satur_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_satur_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_satur_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_satur_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_satur_set_bias(bw_satur_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->bias = value;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Brickworks
|
||||
*
|
||||
* Copyright (C) 2022 Orastron Srl unipersonale
|
||||
* Copyright (C) 2022, 2023 Orastron Srl unipersonale
|
||||
*
|
||||
* Brickworks is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.2.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math }}}
|
||||
* description {{{
|
||||
* Slew-rate limiter with separate maximum increasing and decreasing rates.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_slew_lim_process_multi()</code>.</li>
|
||||
* <li>Fixed documentation of <code>bw_slew_lim_process()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.2.0</strong>:
|
||||
* <ul>
|
||||
* <li>Refactored API.</li>
|
||||
@ -123,9 +129,22 @@ static inline float bw_slew_lim_process1_down(const bw_slew_lim_coeffs *BW_RESTR
|
||||
* ```>>> */
|
||||
static inline void bw_slew_lim_process(bw_slew_lim_coeffs *BW_RESTRICT coeffs, bw_slew_lim_state *BW_RESTRICT state, const float *x, float *y, int n_samples);
|
||||
/*! <<<```
|
||||
* Lets the given `instance` process `n_samples` samples from the input
|
||||
* buffer `x` and fills the corresponding `n_samples` samples in the output
|
||||
* buffer `y`.
|
||||
* Processes the first `n_samples` of the input buffer `x` and fills the
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_slew_lim_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_slew_lim_process_multi(bw_slew_lim_coeffs *BW_RESTRICT coeffs, bw_slew_lim_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* `y` or any element of `y` may be `NULL`.
|
||||
*
|
||||
* #### bw_slew_lim_set_max_rate()
|
||||
* ```>>> */
|
||||
@ -242,7 +261,7 @@ static inline float bw_slew_lim_process1_down(const bw_slew_lim_coeffs *BW_RESTR
|
||||
|
||||
static inline void bw_slew_lim_process(bw_slew_lim_coeffs *BW_RESTRICT coeffs, bw_slew_lim_state *BW_RESTRICT state, const float *x, float *y, int n_samples) {
|
||||
bw_slew_lim_update_coeffs_ctrl(coeffs);
|
||||
if (y) {
|
||||
if (y != NULL) {
|
||||
if (coeffs->max_rate_up != INFINITY) {
|
||||
if (coeffs->max_rate_down != INFINITY)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
@ -278,6 +297,64 @@ static inline void bw_slew_lim_process(bw_slew_lim_coeffs *BW_RESTRICT coeffs, b
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_slew_lim_process_multi(bw_slew_lim_coeffs *BW_RESTRICT coeffs, bw_slew_lim_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_slew_lim_update_coeffs_ctrl(coeffs);
|
||||
if (y != NULL) {
|
||||
if (coeffs->max_rate_up != INFINITY) {
|
||||
if (coeffs->max_rate_down != INFINITY)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_slew_lim_process1(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_slew_lim_process1(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
if (y[j] != NULL)
|
||||
y[j][i] = bw_slew_lim_process1_up(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
bw_slew_lim_process1_up(coeffs, state[j], x[j][i]);
|
||||
} else {
|
||||
if (coeffs->max_rate_down != INFINITY)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[i] = bw_slew_lim_process1_down(coeffs, state, x[i]);
|
||||
else
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_slew_lim_process1_down(coeffs, state, x[i]);
|
||||
else
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
if (y[j] != NULL)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
y[j][i] = x[j][i];
|
||||
state[j]->y_z1 = x[j][n_samples - 1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (coeffs->max_rate_up != INFINITY) {
|
||||
if (coeffs->max_rate_down != INFINITY)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_slew_lim_process1(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_slew_lim_process1_up(coeffs, state[j], x[j][i]);
|
||||
} else {
|
||||
if (coeffs->max_rate_down != INFINITY)
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
for (int i = 0; i < n_samples; i++)
|
||||
bw_slew_lim_process1_down(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
state[j]->y_z1 = x[j][n_samples - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_slew_lim_set_max_rate(bw_slew_lim_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_slew_lim_set_max_rate_up(coeffs, value);
|
||||
bw_slew_lim_set_max_rate_down(coeffs, value);
|
||||
|
125
include/bw_svf.h
125
include/bw_svf.h
@ -27,9 +27,12 @@
|
||||
* bandpass, and highpass outputs.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
<ul>
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_svf_process_multi()</code>.</li>
|
||||
* <li>Fixed bug in <code>bw_svf_process()</code> when only
|
||||
* <code>y_hp</code> is <code>NULL</code>.</li>
|
||||
* <li>Fixed prewarping-related stability bug.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
@ -140,6 +143,18 @@ static inline void bw_svf_process(bw_svf_coeffs *BW_RESTRICT coeffs, bw_svf_stat
|
||||
* (bandpass), and `y_hp` (highpass), if they are not `NULL`, while using and
|
||||
* updating both `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_svf_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_svf_process_multi(bw_svf_coeffs *BW_RESTRICT coeffs, bw_svf_state **BW_RESTRICT state, const float **x, float **y_lp, float **y_bp, float **y_hp, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y_lp`
|
||||
* (lowpass), `y_bp` (bandpass), and `y_hp` (highpass), while using and
|
||||
* updating both the common `coeffs` and each of the `n_channels` `state`s
|
||||
* (control and audio rate).
|
||||
*
|
||||
* `y_lp`, `y_bp`, and `y_hp`, or any of their elements may be `NULL`.
|
||||
*
|
||||
* #### bw_svf_set_cutoff()
|
||||
* ```>>> */
|
||||
static inline void bw_svf_set_cutoff(bw_svf_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -310,8 +325,8 @@ static inline void bw_svf_process(bw_svf_coeffs *BW_RESTRICT coeffs, bw_svf_stat
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
float v_lp;
|
||||
bw_svf_process1(coeffs, state, x[i], &v_lp, y_bp + i, y_hp + i);
|
||||
float v_hp;
|
||||
bw_svf_process1(coeffs, state, x[i], y_lp + i, y_bp + i, &v_hp);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -362,6 +377,110 @@ static inline void bw_svf_process(bw_svf_coeffs *BW_RESTRICT coeffs, bw_svf_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_svf_process_multi(bw_svf_coeffs *BW_RESTRICT coeffs, bw_svf_state **BW_RESTRICT state, const float **x, float **y_lp, float **y_bp, float **y_hp, int n_channels, int n_samples) {
|
||||
if (y_lp != NULL) {
|
||||
if (y_bp != NULL) {
|
||||
if (y_hp != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_lp[j])
|
||||
y_lp[j][i] = v_lp;
|
||||
if (y_bp[j])
|
||||
y_bp[j][i] = v_bp;
|
||||
if (y_hp[j])
|
||||
y_hp[j][i] = v_hp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_lp[j])
|
||||
y_lp[j][i] = v_lp;
|
||||
if (y_bp[j])
|
||||
y_bp[j][i] = v_bp;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_hp != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_lp[j])
|
||||
y_lp[j][i] = v_lp;
|
||||
if (y_hp[j])
|
||||
y_hp[j][i] = v_hp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_lp[j])
|
||||
y_lp[j][i] = v_lp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_bp != NULL) {
|
||||
if (y_hp != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_bp[j])
|
||||
y_bp[j][i] = v_bp;
|
||||
if (y_hp[j])
|
||||
y_hp[j][i] = v_hp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_bp[j])
|
||||
y_bp[j][i] = v_bp;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (y_hp != NULL) {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
if (y_hp[j])
|
||||
y_hp[j][i] = v_hp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_svf_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++) {
|
||||
float v_lp, v_bp, v_hp;
|
||||
bw_svf_process1(coeffs, state[j], x[j][i], &v_lp, &v_bp, &v_hp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_svf_set_cutoff(bw_svf_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
coeffs->cutoff = value;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_config bw_math bw_one_pole bw_osc_sin bw_phase_gen bw_ringmod
|
||||
* }}}
|
||||
@ -29,6 +29,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_trem_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>First release.</li>
|
||||
@ -111,6 +116,15 @@ static inline void bw_trem_process(bw_trem_coeffs *BW_RESTRICT coeffs, bw_trem_s
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_trem_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_trem_process_multi(bw_trem_coeffs *BW_RESTRICT coeffs, bw_trem_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_trem_set_rate()
|
||||
* ```>>> */
|
||||
static inline void bw_trem_set_rate(bw_trem_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -192,6 +206,15 @@ static inline void bw_trem_process(bw_trem_coeffs *BW_RESTRICT coeffs, bw_trem_s
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_trem_process_multi(bw_trem_coeffs *BW_RESTRICT coeffs, bw_trem_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_trem_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_trem_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_trem_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_trem_set_rate(bw_trem_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_phase_gen_set_frequency(&coeffs->phase_gen_coeffs, value);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.4.0 }}}
|
||||
* version {{{ 0.5.0 }}}
|
||||
* requires {{{ bw_common bw_config bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Wah effect.
|
||||
@ -29,6 +29,11 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>0.5.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>bw_wah_process_multi()</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.4.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now specifying <code>0.f</code> as initial input value for
|
||||
@ -125,6 +130,15 @@ static inline void bw_wah_process(bw_wah_coeffs *BW_RESTRICT coeffs, bw_wah_stat
|
||||
* first `n_samples` of the output buffer `y`, while using and updating both
|
||||
* `coeffs` and `state` (control and audio rate).
|
||||
*
|
||||
* #### bw_wah_process_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_wah_process_multi(bw_wah_coeffs *BW_RESTRICT coeffs, bw_wah_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples);
|
||||
/*! <<<```
|
||||
* Processes the first `n_samples` of the `n_channels` input buffers `x` and
|
||||
* fills the first `n_samples` of the `n_channels` output buffers `y`, while
|
||||
* using and updating both the common `coeffs` and each of the `n_channels`
|
||||
* `state`s (control and audio rate).
|
||||
*
|
||||
* #### bw_wah_set_wah()
|
||||
* ```>>> */
|
||||
static inline void bw_wah_set_wah(bw_wah_coeffs *BW_RESTRICT coeffs, float value);
|
||||
@ -192,6 +206,15 @@ static inline void bw_wah_process(bw_wah_coeffs *BW_RESTRICT coeffs, bw_wah_stat
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_wah_process_multi(bw_wah_coeffs *BW_RESTRICT coeffs, bw_wah_state **BW_RESTRICT state, const float **x, float **y, int n_channels, int n_samples) {
|
||||
bw_wah_update_coeffs_ctrl(coeffs);
|
||||
for (int i = 0; i < n_samples; i++) {
|
||||
bw_wah_update_coeffs_audio(coeffs);
|
||||
for (int j = 0; j < n_channels; j++)
|
||||
y[j][i] = bw_wah_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bw_wah_set_wah(bw_wah_coeffs *BW_RESTRICT coeffs, float value) {
|
||||
bw_svf_set_cutoff(&coeffs->svf_coeffs, 400.f + (2e3f - 400.f) * value * value * value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user