using size_t and improved bw_common
This commit is contained in:
parent
c1e16c4338
commit
da517ed4bc
7
TODO
7
TODO
@ -8,8 +8,7 @@ code:
|
||||
* audio rate optional pulse width/slope inputs?
|
||||
* should rather use backward Euler in bw_onepole?
|
||||
* one pole process const input? (return also if const out)
|
||||
* check const restrict etc.
|
||||
* define BW_RESTRICT to __restrict or similar when the compiler supports it
|
||||
* check const restrict size_t etc.
|
||||
* empty functions etc. to keep consistency and forward compatibility?
|
||||
* float in [-1,1] for velocity, pitch bend, mod wheel
|
||||
* should clip slope in triangle?
|
||||
@ -19,7 +18,6 @@ code:
|
||||
* pan process with no out: should just reset coeffs?
|
||||
* get_y_z1, common strategy?
|
||||
* sqrt(0) and corner cases, common strategy?
|
||||
* use BW_SIZE_T, check constant types
|
||||
* bw_satur gain compensation to divide by actual gain (derivative) rather than gain parameter?
|
||||
* cite papers, thank authors
|
||||
* add initial state (x0) to reset state of lp1, ap1, mm1, hs1, ls1, others? all?
|
||||
@ -50,9 +48,6 @@ code:
|
||||
* bw_buf invert src dest order?
|
||||
* check unititialized warnings
|
||||
* voice alloc mode -> voice alloc priority
|
||||
* should remove bw_config?
|
||||
* use custom NDEBUG?
|
||||
* NULL (C) vs BW_SIZE_T (non-C)...?
|
||||
* clearly specify that state is tied to a particular set of coeffs (1:N)
|
||||
* modulation vs process (multi) no update (post 1.0.0)???
|
||||
|
||||
|
@ -1 +1,6 @@
|
||||
#ifndef PLATFORM_H
|
||||
#define PLATFORM_H
|
||||
|
||||
#define NDEBUG
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef PLATFORM_H
|
||||
#define PLATFORM_H
|
||||
|
||||
#define BW_NO_MATH_H
|
||||
#define INFINITY (__builtin_inff())
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
CC := clang
|
||||
CFLAGS := \
|
||||
-DNDEBUG \
|
||||
-DBW_NO_DEBUG \
|
||||
-I${ROOT_DIR}/../src \
|
||||
-I${ROOT_DIR}/../../common/web \
|
||||
-I${ROOT_DIR}/../../../include \
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_lp1 bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order allpass filter (90° shift at cutoff, approaching 180° shift
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order allpass filter (180° shift at cutoff, approaching 360° shift
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Stereo balance.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Bit depth reducer.
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ utility }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common }}}
|
||||
* description {{{
|
||||
* Common operations on buffers.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added debugging code.</li>
|
||||
@ -67,55 +73,55 @@ extern "C" {
|
||||
/*! api {{{
|
||||
* #### bw_buf_fill()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_fill(float *dest, float k, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_fill(float *dest, float k, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Sets the first `n_elems` in `dest` to `k`.
|
||||
*
|
||||
* #### bw_buf_neg()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_neg(float *dest, const float *src, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_neg(float *dest, const float *src, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Inverts the sign of the first `n_elems` in `src` and stores the results in
|
||||
* the first `n_elems` of `dest`.
|
||||
*
|
||||
* #### bw_buf_add()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_add(float *dest, const float *src, float k, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_add(float *dest, const float *src, float k, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Adds `k` to the first `n_elems` in `src` and stores the results in the
|
||||
* first `n_elems` of `dest`.
|
||||
*
|
||||
* #### bw_buf_scale()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_scale(float *dest, const float *src, float k, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_scale(float *dest, const float *src, float k, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Multiplies the first `n_elems` in `src` by `k` and stores the results in
|
||||
* the first `n_elems` of `dest`.
|
||||
*
|
||||
* #### bw_buf_mix()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_mix(float *dest, const float *src1, const float *src2, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_mix(float *dest, const float *src1, const float *src2, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Adds the first `n_elems` of `src1` and `src2` and stores the results in
|
||||
* the first `n_elems` of `dest`.
|
||||
*
|
||||
* #### bw_buf_mul()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_mul(float *dest, const float *src1, const float *src2, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_mul(float *dest, const float *src1, const float *src2, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Multiplies the first `n_elems` of `src1` and `src2` and stores the results
|
||||
* in the first `n_elems` of `dest`.
|
||||
*
|
||||
* #### bw_buf_fill_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_fill_multi(float **dest, float k, BW_SIZE_T n_channels, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_fill_multi(float **dest, float k, size_t n_channels, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Sets the first `n_elems` in each of the `n_channels` buffers `dest` to
|
||||
* `k`.
|
||||
*
|
||||
* #### bw_buf_neg_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_neg_multi(float **dest, const float **src, BW_SIZE_T n_channels, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_neg_multi(float **dest, const float **src, size_t n_channels, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Inverts the sign of the first `n_elems` in each of the `n_channels`
|
||||
* buffers `src` and stores the results in the first `n_elems` in each of the
|
||||
@ -123,7 +129,7 @@ static inline void bw_buf_neg_multi(float **dest, const float **src, BW_SIZE_T n
|
||||
*
|
||||
* #### bw_buf_add_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_add_multi(float **dest, const float **src, float k, BW_SIZE_T n_channels, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_add_multi(float **dest, const float **src, float k, size_t n_channels, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Adds `k` to the first `n_elems` in each of the `n_channels` buffers `src`
|
||||
* and stores the results in the first `n_elems` in each of the `n_channels`
|
||||
@ -131,7 +137,7 @@ static inline void bw_buf_add_multi(float **dest, const float **src, float k, BW
|
||||
*
|
||||
* #### bw_buf_scale_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_scale_multi(float **dest, const float **src, float k, BW_SIZE_T n_channels, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_scale_multi(float **dest, const float **src, float k, size_t n_channels, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Multiplies the first `n_elems` in each of the `n_channels` buffers `src`
|
||||
* by `k` and stores the results in the first `n_elems` in each of the
|
||||
@ -139,7 +145,7 @@ static inline void bw_buf_scale_multi(float **dest, const float **src, float k,
|
||||
*
|
||||
* #### bw_buf_mix_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_mix_multi(float **dest, const float **src1, const float **src2, BW_SIZE_T n_channels, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_mix_multi(float **dest, const float **src1, const float **src2, size_t n_channels, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Adds the first `n_elems` in each of the `n_channels` buffers `src1` and
|
||||
* `src2` and stores the results in the first `n_elems` in each of the
|
||||
@ -147,7 +153,7 @@ static inline void bw_buf_mix_multi(float **dest, const float **src1, const floa
|
||||
*
|
||||
* #### bw_buf_mul_multi()
|
||||
* ```>>> */
|
||||
static inline void bw_buf_mul_multi(float **dest, const float **src1, const float **src2, BW_SIZE_T n_channels, BW_SIZE_T n_elems);
|
||||
static inline void bw_buf_mul_multi(float **dest, const float **src1, const float **src2, size_t n_channels, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Multiplies the first `n_elems` in each of the `n_channels` buffers `src1`
|
||||
* and `src2` and stores the results in the first `n_elems` in each of the
|
||||
@ -159,109 +165,109 @@ static inline void bw_buf_mul_multi(float **dest, const float **src1, const floa
|
||||
/* WARNING: This part of the file is not part of the public API. Its content may
|
||||
* change at any time in future versions. Please, do not use it directly. */
|
||||
|
||||
static inline void bw_buf_fill(float *dest, float k, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_fill(float *dest, float k, size_t n_elems) {
|
||||
BW_ASSERT(!(dest == NULL && n_elems != 0));
|
||||
BW_ASSERT(!bw_is_nan(k));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_elems; i++)
|
||||
for (size_t i = 0; i < n_elems; i++)
|
||||
dest[i] = k;
|
||||
|
||||
BW_ASSERT_DEEP(!bw_has_nan(dest, n_elems));
|
||||
}
|
||||
|
||||
static inline void bw_buf_neg(float *dest, const float *src, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_neg(float *dest, const float *src, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src == NULL) && n_elems != 0));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src, n_elems));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_elems; i++)
|
||||
for (size_t i = 0; i < n_elems; i++)
|
||||
dest[i] = -src[i];
|
||||
|
||||
BW_ASSERT_DEEP(!bw_has_nan(dest, n_elems));
|
||||
}
|
||||
|
||||
static inline void bw_buf_add(float *dest, const float *src, float k, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_add(float *dest, const float *src, float k, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src == NULL) && n_elems != 0));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src, n_elems));
|
||||
BW_ASSERT(!bw_is_nan(k));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_elems; i++)
|
||||
for (size_t i = 0; i < n_elems; i++)
|
||||
dest[i] = k + src[i];
|
||||
|
||||
BW_ASSERT_DEEP(!bw_has_nan(dest, n_elems));
|
||||
}
|
||||
|
||||
static inline void bw_buf_scale(float *dest, const float *src, float k, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_scale(float *dest, const float *src, float k, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src == NULL) && n_elems != 0));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src, n_elems));
|
||||
BW_ASSERT(!bw_is_nan(k));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_elems; i++)
|
||||
for (size_t i = 0; i < n_elems; i++)
|
||||
dest[i] = k * src[i];
|
||||
|
||||
BW_ASSERT_DEEP(!bw_has_nan(dest, n_elems));
|
||||
}
|
||||
|
||||
static inline void bw_buf_mix(float *dest, const float *src1, const float *src2, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_mix(float *dest, const float *src1, const float *src2, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src1 == NULL || src2 == NULL) && n_elems != 0));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src1, n_elems));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src2, n_elems));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_elems; i++)
|
||||
for (size_t i = 0; i < n_elems; i++)
|
||||
dest[i] = src1[i] + src2[i];
|
||||
|
||||
BW_ASSERT_DEEP(!bw_has_nan(dest, n_elems));
|
||||
}
|
||||
|
||||
static inline void bw_buf_mul(float *dest, const float *src1, const float *src2, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_mul(float *dest, const float *src1, const float *src2, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src1 == NULL || src2 == NULL) && n_elems != 0));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src1, n_elems));
|
||||
BW_ASSERT_DEEP(!bw_has_nan(src2, n_elems));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_elems; i++)
|
||||
for (size_t i = 0; i < n_elems; i++)
|
||||
dest[i] = src1[i] * src2[i];
|
||||
|
||||
BW_ASSERT_DEEP(!bw_has_nan(dest, n_elems));
|
||||
}
|
||||
|
||||
static inline void bw_buf_fill_multi(float **dest, float k, BW_SIZE_T n_channels, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_fill_multi(float **dest, float k, size_t n_channels, size_t n_elems) {
|
||||
BW_ASSERT(!(dest == NULL && n_channels != 0));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_channels; i++)
|
||||
for (size_t i = 0; i < n_channels; i++)
|
||||
bw_buf_fill(dest[i], k, n_elems);
|
||||
}
|
||||
|
||||
static inline void bw_buf_neg_multi(float **dest, const float **src, BW_SIZE_T n_channels, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_neg_multi(float **dest, const float **src, size_t n_channels, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src == NULL) && n_channels != 0));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_channels; i++)
|
||||
for (size_t i = 0; i < n_channels; i++)
|
||||
bw_buf_neg(dest[i], src[i], n_elems);
|
||||
}
|
||||
|
||||
static inline void bw_buf_add_multi(float **dest, const float **src, float k, BW_SIZE_T n_channels, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_add_multi(float **dest, const float **src, float k, size_t n_channels, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src == NULL) && n_channels != 0));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_channels; i++)
|
||||
for (size_t i = 0; i < n_channels; i++)
|
||||
bw_buf_add(dest[i], src[i], k, n_elems);
|
||||
}
|
||||
|
||||
static inline void bw_buf_scale_multi(float **dest, const float **src, float k, BW_SIZE_T n_channels, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_scale_multi(float **dest, const float **src, float k, size_t n_channels, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src == NULL) && n_channels != 0));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_channels; i++)
|
||||
for (size_t i = 0; i < n_channels; i++)
|
||||
bw_buf_scale(dest[i], src[i], k, n_elems);
|
||||
}
|
||||
|
||||
static inline void bw_buf_mix_multi(float **dest, const float **src1, const float **src2, BW_SIZE_T n_channels, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_mix_multi(float **dest, const float **src1, const float **src2, size_t n_channels, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src1 == NULL || src2 == NULL) && n_channels != 0));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_channels; i++)
|
||||
for (size_t i = 0; i < n_channels; i++)
|
||||
bw_buf_mix(dest[i], src1[i], src2[i], n_elems);
|
||||
}
|
||||
|
||||
static inline void bw_buf_mul_multi(float **dest, const float **src1, const float **src2, BW_SIZE_T n_channels, BW_SIZE_T n_elems) {
|
||||
static inline void bw_buf_mul_multi(float **dest, const float **src1, const float **src2, size_t n_channels, size_t n_elems) {
|
||||
BW_ASSERT(!((dest == NULL || src1 == NULL || src2 == NULL) && n_channels != 0));
|
||||
|
||||
for (BW_SIZE_T i = 0; i < n_channels; i++)
|
||||
for (size_t i = 0; i < n_channels; i++)
|
||||
bw_buf_mul(dest[i], src1[i], src2[i], n_elems);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_buf bw_comb bw_common bw_delay bw_gain bw_math bw_one_pole bw_osc_sin
|
||||
* bw_phase_gen
|
||||
@ -36,6 +36,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
@ -95,7 +101,7 @@ static inline void bw_chorus_set_sample_rate(bw_chorus_coeffs *BW_RESTRICT coeff
|
||||
*
|
||||
* #### bw_chorus_mem_req()
|
||||
* ```>>> */
|
||||
static inline BW_SIZE_T bw_chorus_mem_req(const bw_chorus_coeffs *BW_RESTRICT coeffs);
|
||||
static inline size_t bw_chorus_mem_req(const bw_chorus_coeffs *BW_RESTRICT coeffs);
|
||||
/*! <<<```
|
||||
* Returns the size, in bytes, of contiguous memory to be supplied to
|
||||
* `bw_chorus_mem_set()` using `coeffs`.
|
||||
@ -240,7 +246,7 @@ static inline void bw_chorus_set_sample_rate(bw_chorus_coeffs *BW_RESTRICT coeff
|
||||
bw_comb_set_sample_rate(&coeffs->comb_coeffs, sample_rate);
|
||||
}
|
||||
|
||||
static inline BW_SIZE_T bw_chorus_mem_req(const bw_chorus_coeffs *BW_RESTRICT coeffs) {
|
||||
static inline size_t bw_chorus_mem_req(const bw_chorus_coeffs *BW_RESTRICT coeffs) {
|
||||
return bw_comb_mem_req(&coeffs->comb_coeffs);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Antialiased hard clipper with parametric bias and gain
|
||||
@ -38,6 +38,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_buf bw_common bw_delay bw_gain bw_math bw_one_pole
|
||||
* }}}
|
||||
@ -37,6 +37,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
@ -96,7 +102,7 @@ static inline void bw_comb_set_sample_rate(bw_comb_coeffs *BW_RESTRICT coeffs, f
|
||||
*
|
||||
* #### bw_comb_mem_req()
|
||||
* ```>>> */
|
||||
static inline BW_SIZE_T bw_comb_mem_req(const bw_comb_coeffs *BW_RESTRICT coeffs);
|
||||
static inline size_t bw_comb_mem_req(const bw_comb_coeffs *BW_RESTRICT coeffs);
|
||||
/*! <<<```
|
||||
* Returns the size, in bytes, of contiguous memory to be supplied to
|
||||
* `bw_comb_mem_set()` using `coeffs`.
|
||||
@ -219,9 +225,9 @@ struct _bw_comb_coeffs {
|
||||
// Coefficients
|
||||
float fs;
|
||||
|
||||
BW_SIZE_T dffi;
|
||||
size_t dffi;
|
||||
float dfff;
|
||||
BW_SIZE_T dfbi;
|
||||
size_t dfbi;
|
||||
float dfbf;
|
||||
|
||||
// Parameters
|
||||
@ -258,7 +264,7 @@ static inline void bw_comb_set_sample_rate(bw_comb_coeffs *BW_RESTRICT coeffs, f
|
||||
coeffs->fs = sample_rate;
|
||||
}
|
||||
|
||||
static inline BW_SIZE_T bw_comb_mem_req(const bw_comb_coeffs *BW_RESTRICT coeffs) {
|
||||
static inline size_t bw_comb_mem_req(const bw_comb_coeffs *BW_RESTRICT coeffs) {
|
||||
return bw_delay_mem_req(&coeffs->delay_coeffs);
|
||||
}
|
||||
|
||||
@ -272,11 +278,11 @@ static inline void _bw_comb_do_update_coeffs(bw_comb_coeffs *BW_RESTRICT coeffs,
|
||||
float delay_fb_cur = bw_one_pole_get_y_z1(&coeffs->smooth_delay_fb_state);
|
||||
if (force || delay_ff_cur != coeffs->delay_ff) {
|
||||
delay_ff_cur = bw_one_pole_process1_sticky_abs(&coeffs->smooth_coeffs, &coeffs->smooth_delay_ff_state, coeffs->delay_ff);
|
||||
const BW_SIZE_T len = bw_delay_get_length(&coeffs->delay_coeffs);
|
||||
const size_t len = bw_delay_get_length(&coeffs->delay_coeffs);
|
||||
const float dff = bw_maxf(coeffs->fs * delay_ff_cur, 0.f);
|
||||
float dffif;
|
||||
bw_intfracf(dff, &dffif, &coeffs->dfff);
|
||||
coeffs->dffi = (BW_SIZE_T)dffif;
|
||||
coeffs->dffi = (size_t)dffif;
|
||||
if (coeffs->dffi >= len) {
|
||||
coeffs->dffi = len;
|
||||
coeffs->dfff = 0.f;
|
||||
@ -284,11 +290,11 @@ static inline void _bw_comb_do_update_coeffs(bw_comb_coeffs *BW_RESTRICT coeffs,
|
||||
}
|
||||
if (force || delay_fb_cur != coeffs->delay_fb) {
|
||||
delay_fb_cur = bw_one_pole_process1_sticky_abs(&coeffs->smooth_coeffs, &coeffs->smooth_delay_fb_state, coeffs->delay_fb);
|
||||
const BW_SIZE_T len = bw_delay_get_length(&coeffs->delay_coeffs);
|
||||
const size_t len = bw_delay_get_length(&coeffs->delay_coeffs);
|
||||
const float dfb = bw_maxf(coeffs->fs * delay_fb_cur, 1.f) - 1.f;
|
||||
float dfbif;
|
||||
bw_intfracf(dfb, &dfbif, &coeffs->dfbf);
|
||||
coeffs->dfbi = (BW_SIZE_T)dfbif;
|
||||
coeffs->dfbi = (size_t)dfbif;
|
||||
if (coeffs->dfbi >= len) {
|
||||
coeffs->dfbi = len;
|
||||
coeffs->dfbf = 0.f;
|
||||
|
@ -20,13 +20,27 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ foundation }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* description {{{
|
||||
* A common header to make sure that a bunch of basic definitions are
|
||||
* available and consistent for all Brickworks modules.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed <code>BW_SIZE_T</code> and went for <code>size_t</code>
|
||||
* instead.</li>
|
||||
* <li>Made control over inclusion of standard library headers more
|
||||
* explicit via <code>BW_NO_STDLIB</code>,
|
||||
* <code>BW_NO_STDDEF_H</code>, <code>BW_NO_STDINT_H</code>, and
|
||||
* <code>BW_NO_MATH_H</code>.</li>
|
||||
* <li>Introduced <code>BW_NO_DEBUG</code> to replace
|
||||
* <code>NDEBUG</code> and prevented useless inclusion of
|
||||
* <code>assert.h</code>.</li>
|
||||
* <li>Avoided using reserved identifiers.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Added <code>BW_ASSERT</code>, <code>bw_is_inf()</code>,
|
||||
@ -63,45 +77,69 @@
|
||||
* }}}
|
||||
*/
|
||||
|
||||
#ifndef _BW_COMMON_H
|
||||
#define _BW_COMMON_H
|
||||
#ifndef BW_COMMON_H
|
||||
#define BW_COMMON_H
|
||||
|
||||
/*! api {{{
|
||||
* #### NULL and BW_SIZE_T
|
||||
* If `NULL` or `BW_SIZE_T` are not defined, then `stddef.h` is `#include`d.
|
||||
*
|
||||
* If `BW_SIZE_T` is not defined, then it is defined as `size_t`.
|
||||
* #### Basic definitions
|
||||
*
|
||||
* Brickworks requires definitions of:
|
||||
*
|
||||
* * `NULL` and `size_t`, normally supplied by `stddef.h`;
|
||||
* * `(u)int{8,16,32,64}_t`, `INT{8,16,32,64}_{MIN,MAX}`, and
|
||||
* `UINT{8,16,32,64}_MAX`, normally supplied by `stdint.h`;
|
||||
* * `INFINITY`, normally supplied by `math.h`.
|
||||
*
|
||||
* You can control whether those definitions are taken from said headers
|
||||
* or you can supply them yourselves. In particular:
|
||||
*
|
||||
* * if `BW_NO_STDLIB` or `BW_NO_STDDEF_H` is defined, then `stddef.h` is not
|
||||
* `#include`d;
|
||||
* * if `BW_NO_STDLIB` or `BW_NO_STDINT_H` is defined, then `stdint.h` is not
|
||||
* `#include`d;
|
||||
* * if `BW_NO_STDLIB` or `BW_NO_MATH_H` is defined, then `math.h` is not
|
||||
* `#include`d.
|
||||
*
|
||||
* >>> */
|
||||
#if !defined(NULL) || !defined(BW_SIZE_T)
|
||||
#if !defined(BW_NO_STDLIB) && !defined(BW_NO_STDDEF_H)
|
||||
# include <stddef.h>
|
||||
# if !defined(BW_SIZE_T)
|
||||
# define BW_SIZE_T size_t
|
||||
# endif
|
||||
#endif
|
||||
/*! ...
|
||||
*
|
||||
* #### Exact-width integer types
|
||||
* If <code class="hljs">(u)int{8,16,32,64}_t</code>,
|
||||
* `INT{8,16,32,64}_{MIN,MAX}`, and `UINT{8,16,32,64}_MAX` are not defined,
|
||||
* then `stdint.h` is `#include`d (actually, only testing against
|
||||
* `INT32_MAX` but expecting the others to be finally defined).
|
||||
* >>> */
|
||||
#ifndef INT32_MAX
|
||||
|
||||
#ifndef NULL
|
||||
# error NULL not defined
|
||||
#endif
|
||||
|
||||
#if !defined(BW_NO_STDLIB) && !defined(BW_NO_STDINT_H)
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
/*! ...
|
||||
*
|
||||
* #### INFINITY
|
||||
* If `INFINITY` is not defined, then `math.h` is `#include`d.
|
||||
* >>> */
|
||||
#ifndef INFINITY
|
||||
|
||||
#if !defined(INT8_MIN) || !defined(INT8_MAX) \
|
||||
|| !defined(INT16_MIN) || !defined(INT16_MAX) \
|
||||
|| !defined(INT32_MIN) || !defined(INT32_MAX) \
|
||||
|| !defined(INT64_MIN) || !defined(INT64_MAX) \
|
||||
|| !defined(UINT8_MAX) || !defined(UINT16_MAX) \
|
||||
|| !defined(UINT32_MAX) || !defined(UINT64_MAX)
|
||||
# error At least one definition in INT{8,16,32,64}_{MIN,MAX} or UINT{8,16,32,64}_MAX is missing
|
||||
#endif
|
||||
|
||||
#if !defined(BW_NO_STDLIB) && !defined(BW_NO_MATH_H)
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
||||
#ifndef INFINITY
|
||||
# error INFINITY not defined
|
||||
#endif
|
||||
/*! ...
|
||||
*
|
||||
* #### BW_RESTRICT
|
||||
* If `BW_RESTRICT` is not defined, then it is defined as `restrict` if C99
|
||||
* is supported.
|
||||
*
|
||||
* `BW_RESTRICT` is a preprocessor definition that wraps the `restrict`
|
||||
* keyword.
|
||||
*
|
||||
* If it is not defined already, then it gets defined as `restrict` if C99 is
|
||||
* supported, otherwise it has no effect (typically when compiling C++ code).
|
||||
*
|
||||
* >>> */
|
||||
#ifndef BW_RESTRICT
|
||||
# if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
|
||||
@ -113,28 +151,35 @@
|
||||
/*! ...
|
||||
*
|
||||
* #### BW_ASSERT and BW_ASSERT_DEEP
|
||||
* If `NDEBUG` is defined then "calls" to both `BW_ASSERT` and
|
||||
*
|
||||
* Both macros are `assert()`-like. `BW_ASSERT` is meant to perform
|
||||
* rapid/basic validity checks (e.g., input pointer is not `NULL`, input
|
||||
* `float` number is finite), while `BW_ASSERT_DEEP` should be used for
|
||||
* deeper checks (e.g., validate data structures and internal states).
|
||||
*
|
||||
* If `BW_NO_DEBUG` is defined then "calls" to both `BW_ASSERT` and
|
||||
* `BW_ASSERT_DEEP` will be stripped away by the preprocessor.
|
||||
*
|
||||
* Whether `NDEBUG` is defined or not, "calls" to `BW_ASSERT_DEEP` will still
|
||||
* be stripped anyway if `BW_DEBUG_DEEP` is not defined.
|
||||
* Whether `BW_NO_DEBUG` is defined or not, "calls" to `BW_ASSERT_DEEP` will
|
||||
* still be stripped anyway if `BW_DEBUG_DEEP` is not defined.
|
||||
*
|
||||
* In all other cases, `BW_ASSERT` and `BW_ASSERT_DEEP` can either be
|
||||
* provided by you, otherwise `BW_ASSERT` is defined as `assert` (and
|
||||
* `assert.h` is `#include`d) and `BW_ASSERT_DEEP` is defined as `BW_ASSERT`.
|
||||
* Otherwise, `BW_ASSERT` and `BW_ASSERT_DEEP` can either be provided by you,
|
||||
* otherwise `BW_ASSERT` is defined as `assert` (`assert.h` is `#include`d
|
||||
* and `BW_NO_STDLIB` must not be defined -- please mid that `assert.h` is
|
||||
* still influenced by `NDEBUG`), and `BW_ASSERT_DEEP` is defined as
|
||||
* `BW_ASSERT`.
|
||||
*
|
||||
* `BW_ASSERT` is meant to perform rapid/basic validity checks (e.g., input
|
||||
* pointer is not `NULL`, input `float` number is finite), while
|
||||
* `BW_ASSERT_DEEP` should be used for deeper checks (e.g., validate data
|
||||
* structures and internal states).
|
||||
* >>> */
|
||||
#ifdef NDEBUG
|
||||
#ifdef BW_NO_DEBUG
|
||||
# undef BW_ASSERT
|
||||
# undef BW_ASSERT_DEEP
|
||||
# define BW_ASSERT(ignore) ((void)0)
|
||||
# define BW_ASSERT_DEEP(ignore) ((void)0)
|
||||
#else
|
||||
# if !defined(BW_ASSERT) || !defined(BW_ASSERT_DEEP)
|
||||
# ifndef BW_ASSERT
|
||||
# ifdef BW_NO_STDLIB
|
||||
# error BW_NO_STDLIB defined but BW_ASSERT not defined
|
||||
# endif
|
||||
# include <assert.h>
|
||||
# endif
|
||||
# ifndef BW_ASSERT
|
||||
@ -172,21 +217,21 @@ static inline char bw_is_finite(float x);
|
||||
*
|
||||
* #### bw_has_inf()
|
||||
* ```>>> */
|
||||
static inline char bw_has_inf(const float *x, BW_SIZE_T n_elems);
|
||||
static inline char bw_has_inf(const float *x, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Scans the fist `n_elems` in buffer `x` and returns non-`0` if it contains
|
||||
* at least one positive or negative inifinity value, `0` otherwise.
|
||||
*
|
||||
* #### bw_has_nan()
|
||||
* ```>>> */
|
||||
static inline char bw_has_nan(const float *x, BW_SIZE_T n_elems);
|
||||
static inline char bw_has_nan(const float *x, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Scans the fist `n_elems` in buffer `x` and returns non-`0` if it contains
|
||||
* at least one NaN value, `0` otherwise.
|
||||
*
|
||||
* #### bw_has_only_finite()
|
||||
* ```>>> */
|
||||
static inline char bw_has_only_finite(const float *x, BW_SIZE_T n_elems);
|
||||
static inline char bw_has_only_finite(const float *x, size_t n_elems);
|
||||
/*! <<<```
|
||||
* Scans the fist `n_elems` in buffer `x` and returns non-`0` if it only
|
||||
* finds finite values (neither NaN nor positive or negative infinity), `0`
|
||||
@ -222,23 +267,23 @@ static inline char bw_is_finite(float x) {
|
||||
return (v.u & 0x7f800000) != 0x7f800000;
|
||||
}
|
||||
|
||||
static inline char bw_has_inf(const float *x, BW_SIZE_T n_elems) {
|
||||
static inline char bw_has_inf(const float *x, size_t n_elems) {
|
||||
char ret = 0;
|
||||
for (BW_SIZE_T i = 0; i < n_elems && !ret; i++)
|
||||
for (size_t i = 0; i < n_elems && !ret; i++)
|
||||
ret = bw_is_inf(x[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline char bw_has_nan(const float *x, BW_SIZE_T n_elems) {
|
||||
static inline char bw_has_nan(const float *x, size_t n_elems) {
|
||||
char ret = 0;
|
||||
for (BW_SIZE_T i = 0; i < n_elems && !ret; i++)
|
||||
for (size_t i = 0; i < n_elems && !ret; i++)
|
||||
ret = bw_is_nan(x[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline char bw_has_only_finite(const float *x, BW_SIZE_T n_elems) {
|
||||
static inline char bw_has_only_finite(const float *x, size_t n_elems) {
|
||||
char ret = 1;
|
||||
for (BW_SIZE_T i = 0; i < n_elems && ret; i++)
|
||||
for (size_t i = 0; i < n_elems && ret; i++)
|
||||
ret = bw_is_finite(x[i]);
|
||||
return ret;
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_env_follow bw_gain bw_math bw_one_pole
|
||||
* }}}
|
||||
@ -29,6 +29,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_buf bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Interpolated delay line, not smoothed.
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
@ -89,7 +95,7 @@ static inline void bw_delay_set_sample_rate(bw_delay_coeffs *BW_RESTRICT coeffs,
|
||||
*
|
||||
* #### bw_delay_mem_req()
|
||||
* ```>>> */
|
||||
static inline BW_SIZE_T bw_delay_mem_req(const bw_delay_coeffs *BW_RESTRICT coeffs);
|
||||
static inline size_t bw_delay_mem_req(const bw_delay_coeffs *BW_RESTRICT coeffs);
|
||||
/*! <<<```
|
||||
* Returns the size, in bytes, of contiguous memory to be supplied to
|
||||
* `bw_delay_mem_set()` using `coeffs`.
|
||||
@ -114,7 +120,7 @@ static inline void bw_delay_reset_state(const bw_delay_coeffs *BW_RESTRICT coeff
|
||||
*
|
||||
* #### bw_delay_read()
|
||||
* ```>>> */
|
||||
static float bw_delay_read(const bw_delay_coeffs *BW_RESTRICT coeffs, const bw_delay_state *BW_RESTRICT state, BW_SIZE_T di, float df);
|
||||
static float bw_delay_read(const bw_delay_coeffs *BW_RESTRICT coeffs, const bw_delay_state *BW_RESTRICT state, size_t di, float df);
|
||||
/*! <<<```
|
||||
* Returns the interpolated value read from the delay line identified by
|
||||
* `coeffs` and `state` by applying a delay of `di` + `df` samples.
|
||||
@ -175,7 +181,7 @@ static inline void bw_delay_set_delay(bw_delay_coeffs *BW_RESTRICT coeffs, float
|
||||
*
|
||||
* #### bw_delay_get_length()
|
||||
* ```>>> */
|
||||
static inline BW_SIZE_T bw_delay_get_length(const bw_delay_coeffs *BW_RESTRICT coeffs);
|
||||
static inline size_t bw_delay_get_length(const bw_delay_coeffs *BW_RESTRICT coeffs);
|
||||
/*! <<<```
|
||||
* Returns the length of the delay line in samples.
|
||||
* }}} */
|
||||
@ -191,9 +197,9 @@ static inline BW_SIZE_T bw_delay_get_length(const bw_delay_coeffs *BW_RESTRICT c
|
||||
struct _bw_delay_coeffs {
|
||||
// Coefficients
|
||||
float fs;
|
||||
BW_SIZE_T len;
|
||||
size_t len;
|
||||
|
||||
BW_SIZE_T di;
|
||||
size_t di;
|
||||
float df;
|
||||
|
||||
// Parameters
|
||||
@ -204,7 +210,7 @@ struct _bw_delay_coeffs {
|
||||
|
||||
struct _bw_delay_state {
|
||||
float *buf;
|
||||
BW_SIZE_T idx;
|
||||
size_t idx;
|
||||
};
|
||||
|
||||
static inline void bw_delay_init(bw_delay_coeffs *BW_RESTRICT coeffs, float max_delay) {
|
||||
@ -214,10 +220,10 @@ static inline void bw_delay_init(bw_delay_coeffs *BW_RESTRICT coeffs, float max_
|
||||
|
||||
static inline void bw_delay_set_sample_rate(bw_delay_coeffs *BW_RESTRICT coeffs, float sample_rate) {
|
||||
coeffs->fs = sample_rate;
|
||||
coeffs->len = (BW_SIZE_T)bw_ceilf(coeffs->fs * coeffs->max_delay) + 1;
|
||||
coeffs->len = (size_t)bw_ceilf(coeffs->fs * coeffs->max_delay) + 1;
|
||||
}
|
||||
|
||||
static inline BW_SIZE_T bw_delay_mem_req(const bw_delay_coeffs *BW_RESTRICT coeffs) {
|
||||
static inline size_t bw_delay_mem_req(const bw_delay_coeffs *BW_RESTRICT coeffs) {
|
||||
return coeffs->len * sizeof(float);
|
||||
}
|
||||
|
||||
@ -236,9 +242,9 @@ static inline void bw_delay_reset_state(const bw_delay_coeffs *BW_RESTRICT coeff
|
||||
state->idx = 0;
|
||||
}
|
||||
|
||||
static float bw_delay_read(const bw_delay_coeffs *BW_RESTRICT coeffs, const bw_delay_state *BW_RESTRICT state, BW_SIZE_T di, float df) {
|
||||
const BW_SIZE_T n = (state->idx + (state->idx >= di ? 0 : coeffs->len)) - di;
|
||||
const BW_SIZE_T p = (n ? n : coeffs->len) - 1;
|
||||
static float bw_delay_read(const bw_delay_coeffs *BW_RESTRICT coeffs, const bw_delay_state *BW_RESTRICT state, size_t di, float df) {
|
||||
const size_t n = (state->idx + (state->idx >= di ? 0 : coeffs->len)) - di;
|
||||
const size_t p = (n ? n : coeffs->len) - 1;
|
||||
return state->buf[n] + df * (state->buf[p] - state->buf[n]);
|
||||
}
|
||||
|
||||
@ -252,7 +258,7 @@ static inline void bw_delay_update_coeffs_ctrl(bw_delay_coeffs *BW_RESTRICT coef
|
||||
if (coeffs->delay_changed) {
|
||||
float i;
|
||||
bw_intfracf(coeffs->fs * coeffs->delay, &i, &coeffs->df);
|
||||
coeffs->di = (BW_SIZE_T)i;
|
||||
coeffs->di = (size_t)i;
|
||||
coeffs->delay_changed = 0;
|
||||
}
|
||||
}
|
||||
@ -286,7 +292,7 @@ static inline void bw_delay_set_delay(bw_delay_coeffs *BW_RESTRICT coeffs, float
|
||||
}
|
||||
}
|
||||
|
||||
static inline BW_SIZE_T bw_delay_get_length(const bw_delay_coeffs *BW_RESTRICT coeffs) {
|
||||
static inline size_t bw_delay_get_length(const bw_delay_coeffs *BW_RESTRICT coeffs) {
|
||||
return coeffs->len;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_clip bw_common bw_gain bw_hp1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak
|
||||
* bw_satur bw_svf
|
||||
@ -32,6 +32,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_peak bw_satur bw_svf
|
||||
* }}}
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Dry/wet mixer.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Envelope follower made of a full-wave rectifier followed by
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Linear ADSR envelope generator.
|
||||
@ -40,6 +40,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_gain bw_hp1 bw_hs1 bw_lp1 bw_math bw_mm1 bw_one_pole bw_satur
|
||||
* bw_svf
|
||||
@ -32,6 +32,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Gain.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_lp1 bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order highpass filter (6 dB/oct) with gain asymptotically
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order high shelf filter (6 dB/oct) with unitary DC gain.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order high shelf filter (12 dB/oct) with unitary DC gain.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order lowpass filter (6 dB/oct) with unitary DC gain.
|
||||
@ -30,6 +30,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order low shelf filter (6 dB/oct) with gain asymptotically
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order low shelf filter (12 dB/oct) with gain asymptotically
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_lp1 bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* First-order multimode filter.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order multimode filter.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_env_follow bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Noise gate with independent sidechain input.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_rand }}}
|
||||
* description {{{
|
||||
* Generator of white noise with uniform distribution.
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order notch filter with unitary gain at DC and asymptotically as
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* One-pole (6 dB/oct) lowpass filter with unitary DC gain, separate attack
|
||||
@ -30,6 +30,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li><code>bw_one_pole_process()</code> and
|
||||
@ -172,7 +178,7 @@ static inline float bw_one_pole_process1_asym_sticky_rel(const bw_one_pole_coeff
|
||||
*
|
||||
* #### bw_one_pole_process()
|
||||
* ```>>> */
|
||||
static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, bw_one_pole_state *BW_RESTRICT state, const float *x, float *y, BW_SIZE_T n_samples);
|
||||
static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, bw_one_pole_state *BW_RESTRICT state, const float *x, float *y, size_t 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 both
|
||||
@ -182,7 +188,7 @@ static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, b
|
||||
*
|
||||
* #### 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, BW_SIZE_T n_channels, BW_SIZE_T n_samples);
|
||||
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, size_t n_channels, size_t 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
|
||||
@ -606,7 +612,7 @@ static inline float bw_one_pole_process1_asym_sticky_rel(const bw_one_pole_coeff
|
||||
return y;
|
||||
}
|
||||
|
||||
static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, bw_one_pole_state *BW_RESTRICT state, const float *x, float *y, BW_SIZE_T n_samples) {
|
||||
static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, bw_one_pole_state *BW_RESTRICT state, const float *x, float *y, size_t n_samples) {
|
||||
BW_ASSERT(coeffs != NULL);
|
||||
BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs));
|
||||
BW_ASSERT_DEEP(coeffs->state >= _bw_one_pole_coeffs_state_reset_coeffs);
|
||||
@ -621,28 +627,28 @@ static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, b
|
||||
if (coeffs->mA1u != coeffs->mA1d) {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[i] = bw_one_pole_process1_asym_sticky_abs(coeffs, state, x[i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[i] = bw_one_pole_process1_asym_sticky_rel(coeffs, state, x[i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[i] = bw_one_pole_process1_asym(coeffs, state, x[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[i] = bw_one_pole_process1_sticky_abs(coeffs, state, x[i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[i] = bw_one_pole_process1_sticky_rel(coeffs, state, x[i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[i] = bw_one_pole_process1(coeffs, state, x[i]);
|
||||
}
|
||||
}
|
||||
@ -650,28 +656,28 @@ static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, b
|
||||
if (coeffs->mA1u != coeffs->mA1d) {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym_sticky_abs(coeffs, state, x[i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym_sticky_rel(coeffs, state, x[i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym(coeffs, state, x[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_sticky_abs(coeffs, state, x[i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_sticky_rel(coeffs, state, x[i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1(coeffs, state, x[i]);
|
||||
}
|
||||
}
|
||||
@ -684,7 +690,7 @@ static inline void bw_one_pole_process(bw_one_pole_coeffs *BW_RESTRICT coeffs, b
|
||||
BW_ASSERT_DEEP(!bw_has_nan(y, n_samples));
|
||||
}
|
||||
|
||||
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, BW_SIZE_T n_channels, BW_SIZE_T n_samples) {
|
||||
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, size_t n_channels, size_t n_samples) {
|
||||
BW_ASSERT(coeffs != NULL);
|
||||
BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs));
|
||||
BW_ASSERT_DEEP(coeffs->state >= _bw_one_pole_coeffs_state_reset_coeffs);
|
||||
@ -695,59 +701,59 @@ static inline void bw_one_pole_process_multi(bw_one_pole_coeffs *BW_RESTRICT coe
|
||||
if (coeffs->mA1u != coeffs->mA1d) {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_asym_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
|
||||
else
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_asym_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_asym_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_asym(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t 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 (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
if (y[j] != NULL)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
y[j][i] = bw_one_pole_process1(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
bw_one_pole_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
@ -755,34 +761,34 @@ static inline void bw_one_pole_process_multi(bw_one_pole_coeffs *BW_RESTRICT coe
|
||||
if (coeffs->mA1u != coeffs->mA1d) {
|
||||
if (coeffs->st2 != 0.f) {
|
||||
if (coeffs->sticky_mode == bw_one_pole_sticky_mode_abs)
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_asym_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_asym_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
for (size_t 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 (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_sticky_abs(coeffs, state[j], x[j][i]);
|
||||
else
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1_sticky_rel(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
else {
|
||||
for (BW_SIZE_T i = 0; i < n_samples; i++)
|
||||
for (BW_SIZE_T j = 0; j < n_channels; j++)
|
||||
for (size_t i = 0; i < n_samples; i++)
|
||||
for (size_t j = 0; j < n_channels; j++)
|
||||
bw_one_pole_process1(coeffs, state[j], x[j][i]);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common }}}
|
||||
* description {{{
|
||||
* Post-filter to decolorate oscillator waveshapers when antialiasing is on.
|
||||
@ -33,6 +33,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Pulse oscillator waveshaper with variable pulse width (actually, duty
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Sawtooth oscillator waveshaper with PolyBLEP antialiasing.
|
||||
@ -30,6 +30,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Sinusoidal oscillator waveshaper.
|
||||
@ -30,6 +30,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Triangle oscillator waveshaper with variable slope (increasing time over
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Stereo panner.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Second-order peak filter with unitary gain at DC and asymptotically
|
||||
@ -35,6 +35,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Phase generator with portamento and exponential frequency modulation.
|
||||
@ -29,6 +29,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_ap1 bw_common bw_lp1 bw_math bw_one_pole bw_osc_sin bw_phase_gen
|
||||
* }}}
|
||||
@ -30,6 +30,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common }}}
|
||||
* description {{{
|
||||
* Pinking filter.
|
||||
@ -34,6 +34,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_env_follow bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Digital peak programme meter with adjustable integration time constant.
|
||||
@ -30,6 +30,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_buf bw_common bw_delay bw_drywet bw_gain bw_lp1 bw_math bw_one_pole
|
||||
* bw_osc_sin bw_phase_gen
|
||||
@ -35,6 +35,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
@ -85,7 +91,7 @@ static inline void bw_reverb_set_sample_rate(bw_reverb_coeffs *BW_RESTRICT coeff
|
||||
*
|
||||
* #### bw_reverb_mem_req()
|
||||
* ```>>> */
|
||||
static inline BW_SIZE_T bw_reverb_mem_req(const bw_reverb_coeffs *BW_RESTRICT coeffs);
|
||||
static inline size_t bw_reverb_mem_req(const bw_reverb_coeffs *BW_RESTRICT coeffs);
|
||||
/*! <<<```
|
||||
* Returns the size, in bytes, of contiguous memory to be supplied to
|
||||
* `bw_reverb_mem_set()` using `coeffs`.
|
||||
@ -233,30 +239,30 @@ struct _bw_reverb_coeffs {
|
||||
// Coefficients
|
||||
float fs;
|
||||
float T;
|
||||
BW_SIZE_T id1;
|
||||
BW_SIZE_T id2;
|
||||
BW_SIZE_T id3;
|
||||
BW_SIZE_T id4;
|
||||
BW_SIZE_T dd2;
|
||||
BW_SIZE_T dd4;
|
||||
BW_SIZE_T d1;
|
||||
BW_SIZE_T d2;
|
||||
BW_SIZE_T d3;
|
||||
BW_SIZE_T d4;
|
||||
BW_SIZE_T dl1;
|
||||
BW_SIZE_T dl2;
|
||||
BW_SIZE_T dl3;
|
||||
BW_SIZE_T dl4;
|
||||
BW_SIZE_T dl5;
|
||||
BW_SIZE_T dl6;
|
||||
BW_SIZE_T dl7;
|
||||
BW_SIZE_T dr1;
|
||||
BW_SIZE_T dr2;
|
||||
BW_SIZE_T dr3;
|
||||
BW_SIZE_T dr4;
|
||||
BW_SIZE_T dr5;
|
||||
BW_SIZE_T dr6;
|
||||
BW_SIZE_T dr7;
|
||||
size_t id1;
|
||||
size_t id2;
|
||||
size_t id3;
|
||||
size_t id4;
|
||||
size_t dd2;
|
||||
size_t dd4;
|
||||
size_t d1;
|
||||
size_t d2;
|
||||
size_t d3;
|
||||
size_t d4;
|
||||
size_t dl1;
|
||||
size_t dl2;
|
||||
size_t dl3;
|
||||
size_t dl4;
|
||||
size_t dl5;
|
||||
size_t dl6;
|
||||
size_t dl7;
|
||||
size_t dr1;
|
||||
size_t dr2;
|
||||
size_t dr3;
|
||||
size_t dr4;
|
||||
size_t dr5;
|
||||
size_t dr6;
|
||||
size_t dr7;
|
||||
|
||||
float s;
|
||||
float diff2;
|
||||
@ -338,33 +344,33 @@ static inline void bw_reverb_set_sample_rate(bw_reverb_coeffs *BW_RESTRICT coeff
|
||||
bw_one_pole_reset_coeffs(&coeffs->smooth_coeffs);
|
||||
coeffs->fs = sample_rate;
|
||||
coeffs->T = 1.f / sample_rate;
|
||||
coeffs->id1 = (BW_SIZE_T)bw_roundf(coeffs->fs * (142.f / 29761.f));
|
||||
coeffs->id2 = (BW_SIZE_T)bw_roundf(coeffs->fs * (107.f / 29761.f));
|
||||
coeffs->id3 = (BW_SIZE_T)bw_roundf(coeffs->fs * (379.f / 29761.f));
|
||||
coeffs->id4 = (BW_SIZE_T)bw_roundf(coeffs->fs * (277.f / 29761.f));
|
||||
coeffs->dd2 = (BW_SIZE_T)bw_roundf(coeffs->fs * (1800.f / 29761.f));
|
||||
coeffs->dd4 = (BW_SIZE_T)bw_roundf(coeffs->fs * (2656.f / 29761.f));
|
||||
coeffs->d1 = (BW_SIZE_T)bw_roundf(coeffs->fs * (4453.f / 29761.f));
|
||||
coeffs->d2 = (BW_SIZE_T)bw_roundf(coeffs->fs * (3720.f / 29761.f));
|
||||
coeffs->d3 = (BW_SIZE_T)bw_roundf(coeffs->fs * (4217.f / 29761.f));
|
||||
coeffs->d4 = (BW_SIZE_T)bw_roundf(coeffs->fs * (3163.f / 29761.f));
|
||||
coeffs->dl1 = (BW_SIZE_T)bw_roundf(coeffs->fs * (266.f / 29761.f));
|
||||
coeffs->dl2 = (BW_SIZE_T)bw_roundf(coeffs->fs * (2974.f / 29761.f));
|
||||
coeffs->dl3 = (BW_SIZE_T)bw_roundf(coeffs->fs * (1913.f / 29761.f));
|
||||
coeffs->dl4 = (BW_SIZE_T)bw_roundf(coeffs->fs * (1996.f / 29761.f));
|
||||
coeffs->dl5 = (BW_SIZE_T)bw_roundf(coeffs->fs * (1990.f / 29761.f));
|
||||
coeffs->dl6 = (BW_SIZE_T)bw_roundf(coeffs->fs * (187.f / 29761.f));
|
||||
coeffs->dl7 = (BW_SIZE_T)bw_roundf(coeffs->fs * (1066.f / 29761.f));
|
||||
coeffs->dr1 = (BW_SIZE_T)bw_roundf(coeffs->fs * (353.f / 29761.f));
|
||||
coeffs->dr2 = (BW_SIZE_T)bw_roundf(coeffs->fs * (3627.f / 29761.f));
|
||||
coeffs->dr3 = (BW_SIZE_T)bw_roundf(coeffs->fs * (1228.f / 29761.f));
|
||||
coeffs->dr4 = (BW_SIZE_T)bw_roundf(coeffs->fs * (2673.f / 29761.f));
|
||||
coeffs->dr5 = (BW_SIZE_T)bw_roundf(coeffs->fs * (2111.f / 29761.f));
|
||||
coeffs->dr6 = (BW_SIZE_T)bw_roundf(coeffs->fs * (335.f / 29761.f));
|
||||
coeffs->dr7 = (BW_SIZE_T)bw_roundf(coeffs->fs * (121.f / 29761.f));
|
||||
coeffs->id1 = (size_t)bw_roundf(coeffs->fs * (142.f / 29761.f));
|
||||
coeffs->id2 = (size_t)bw_roundf(coeffs->fs * (107.f / 29761.f));
|
||||
coeffs->id3 = (size_t)bw_roundf(coeffs->fs * (379.f / 29761.f));
|
||||
coeffs->id4 = (size_t)bw_roundf(coeffs->fs * (277.f / 29761.f));
|
||||
coeffs->dd2 = (size_t)bw_roundf(coeffs->fs * (1800.f / 29761.f));
|
||||
coeffs->dd4 = (size_t)bw_roundf(coeffs->fs * (2656.f / 29761.f));
|
||||
coeffs->d1 = (size_t)bw_roundf(coeffs->fs * (4453.f / 29761.f));
|
||||
coeffs->d2 = (size_t)bw_roundf(coeffs->fs * (3720.f / 29761.f));
|
||||
coeffs->d3 = (size_t)bw_roundf(coeffs->fs * (4217.f / 29761.f));
|
||||
coeffs->d4 = (size_t)bw_roundf(coeffs->fs * (3163.f / 29761.f));
|
||||
coeffs->dl1 = (size_t)bw_roundf(coeffs->fs * (266.f / 29761.f));
|
||||
coeffs->dl2 = (size_t)bw_roundf(coeffs->fs * (2974.f / 29761.f));
|
||||
coeffs->dl3 = (size_t)bw_roundf(coeffs->fs * (1913.f / 29761.f));
|
||||
coeffs->dl4 = (size_t)bw_roundf(coeffs->fs * (1996.f / 29761.f));
|
||||
coeffs->dl5 = (size_t)bw_roundf(coeffs->fs * (1990.f / 29761.f));
|
||||
coeffs->dl6 = (size_t)bw_roundf(coeffs->fs * (187.f / 29761.f));
|
||||
coeffs->dl7 = (size_t)bw_roundf(coeffs->fs * (1066.f / 29761.f));
|
||||
coeffs->dr1 = (size_t)bw_roundf(coeffs->fs * (353.f / 29761.f));
|
||||
coeffs->dr2 = (size_t)bw_roundf(coeffs->fs * (3627.f / 29761.f));
|
||||
coeffs->dr3 = (size_t)bw_roundf(coeffs->fs * (1228.f / 29761.f));
|
||||
coeffs->dr4 = (size_t)bw_roundf(coeffs->fs * (2673.f / 29761.f));
|
||||
coeffs->dr5 = (size_t)bw_roundf(coeffs->fs * (2111.f / 29761.f));
|
||||
coeffs->dr6 = (size_t)bw_roundf(coeffs->fs * (335.f / 29761.f));
|
||||
coeffs->dr7 = (size_t)bw_roundf(coeffs->fs * (121.f / 29761.f));
|
||||
}
|
||||
|
||||
static inline BW_SIZE_T bw_reverb_mem_req(const bw_reverb_coeffs *BW_RESTRICT coeffs) {
|
||||
static inline size_t bw_reverb_mem_req(const bw_reverb_coeffs *BW_RESTRICT coeffs) {
|
||||
return bw_delay_mem_req(&coeffs->predelay_coeffs)
|
||||
+ bw_delay_mem_req(&coeffs->delay_id1_coeffs)
|
||||
+ bw_delay_mem_req(&coeffs->delay_id2_coeffs)
|
||||
@ -506,10 +512,10 @@ static inline void bw_reverb_process1(const bw_reverb_coeffs *BW_RESTRICT coeffs
|
||||
|
||||
float dd1if, dd1f;
|
||||
bw_intfracf(coeffs->fs * ((672.f / 29761.f) + coeffs->s), &dd1if, &dd1f);
|
||||
const BW_SIZE_T dd1i = (BW_SIZE_T)dd1if;
|
||||
const size_t dd1i = (size_t)dd1if;
|
||||
float dd3if, dd3f;
|
||||
bw_intfracf(coeffs->fs * ((908.f / 29761.f) + coeffs->s), &dd3if, &dd3f);
|
||||
const BW_SIZE_T dd3i = (BW_SIZE_T)dd3if;
|
||||
const size_t dd3i = (size_t)dd3if;
|
||||
|
||||
const float n24 = bw_delay_read(&coeffs->delay_dd1_coeffs, &state->delay_dd1_state, dd1i, dd1f);
|
||||
const float n23 = s1 + 0.7f * n24;
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Ring modulator with variable modulation amount.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* Antialiased tanh-based saturation with parametric bias and gain
|
||||
@ -38,6 +38,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Slew-rate limiter with separate maximum increasing and decreasing rates.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Sample rate reducer.
|
||||
@ -31,6 +31,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Aribtrary-ratio IIR sample rate converter.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math }}}
|
||||
* description {{{
|
||||
* Integer-ratio IIR sample rate converter.
|
||||
@ -33,6 +33,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole }}}
|
||||
* description {{{
|
||||
* State variable filter (2nd order, 12 dB/oct) model with separated lowpass,
|
||||
@ -28,6 +28,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{
|
||||
* bw_common bw_math bw_one_pole bw_osc_sin bw_phase_gen bw_ringmod
|
||||
* }}}
|
||||
@ -29,6 +29,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -20,13 +20,19 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ utility }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_note_queue }}}
|
||||
* description {{{
|
||||
* Basic voice allocator with low/high note priority.
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>BW_SIZE_T</code> to count voices in
|
||||
@ -91,7 +97,7 @@ typedef struct {
|
||||
*
|
||||
* #### bw_voice_alloc()
|
||||
* ```>>> */
|
||||
void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *BW_RESTRICT queue, void **BW_RESTRICT voices, BW_SIZE_T n_voices);
|
||||
void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *BW_RESTRICT queue, void **BW_RESTRICT voices, size_t n_voices);
|
||||
/*! <<<```
|
||||
* It performs voice allocation according to `opts` and using the events in
|
||||
* `queue`.
|
||||
@ -105,7 +111,7 @@ void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *
|
||||
/* WARNING: This part of the file is not part of the public API. Its content may
|
||||
* change at any time in future versions. Please, do not use it directly. */
|
||||
|
||||
void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *BW_RESTRICT queue, void **BW_RESTRICT voices, BW_SIZE_T n_voices) {
|
||||
void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *BW_RESTRICT queue, void **BW_RESTRICT voices, size_t n_voices) {
|
||||
BW_ASSERT(opts != NULL);
|
||||
BW_ASSERT(opts->priority == bw_voice_alloc_priority_low || opts->priority == bw_voice_alloc_priority_high);
|
||||
BW_ASSERT(n_voices == 0 || opts->note_on != NULL);
|
||||
@ -118,7 +124,7 @@ void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *
|
||||
|
||||
for (unsigned char i = 0; i < queue->n_events; i++) {
|
||||
bw_note_queue_event *ev = queue->events + i;
|
||||
for (BW_SIZE_T j = 0; j < n_voices; j++)
|
||||
for (size_t j = 0; j < n_voices; j++)
|
||||
if (!opts->is_free(voices[j]) && opts->get_note(voices[j]) == ev->note) {
|
||||
if (!ev->status.pressed || ev->went_off)
|
||||
opts->note_off(voices[j], ev->status.velocity);
|
||||
@ -128,15 +134,15 @@ void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *
|
||||
}
|
||||
|
||||
if (ev->status.pressed) {
|
||||
for (BW_SIZE_T j = 0; j < n_voices; j++)
|
||||
for (size_t j = 0; j < n_voices; j++)
|
||||
if (opts->is_free(voices[j])) {
|
||||
opts->note_on(voices[j], ev->note, ev->status.velocity);
|
||||
goto next_event;
|
||||
}
|
||||
|
||||
BW_SIZE_T k = n_voices;
|
||||
size_t k = n_voices;
|
||||
int v = ev->note;
|
||||
for (BW_SIZE_T j = 0; j < n_voices; j++) {
|
||||
for (size_t j = 0; j < n_voices; j++) {
|
||||
int n = opts->get_note(voices[j]);
|
||||
if (!queue->status[n].pressed && (k == n_voices || (opts->priority == bw_voice_alloc_priority_low ? n > v : n < v))) {
|
||||
v = n;
|
||||
@ -148,7 +154,7 @@ void bw_voice_alloc(const bw_voice_alloc_opts *BW_RESTRICT opts, bw_note_queue *
|
||||
continue;
|
||||
}
|
||||
|
||||
for (BW_SIZE_T j = 0; j < n_voices; j++) {
|
||||
for (size_t j = 0; j < n_voices; j++) {
|
||||
int n = opts->get_note(voices[j]);
|
||||
if (opts->priority == bw_voice_alloc_priority_low ? n > v : n < v) {
|
||||
v = n;
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
/*!
|
||||
* module_type {{{ dsp }}}
|
||||
* version {{{ 0.6.0 }}}
|
||||
* version {{{ 1.0.0 }}}
|
||||
* requires {{{ bw_common bw_math bw_one_pole bw_svf }}}
|
||||
* description {{{
|
||||
* Wah effect.
|
||||
@ -29,6 +29,12 @@
|
||||
* }}}
|
||||
* changelog {{{
|
||||
* <ul>
|
||||
* <li>Version <strong>1.0.0</strong>:
|
||||
* <ul>
|
||||
* <li>Now using <code>size_t</code> instead of
|
||||
* <code>BW_SIZE_T</code>.</li>
|
||||
* </ul>
|
||||
* </li>
|
||||
* <li>Version <strong>0.6.0</strong>:
|
||||
* <ul>
|
||||
* <li>Removed dependency on bw_config.</li>
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::AP1
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class AP1 {
|
||||
public:
|
||||
AP1();
|
||||
@ -58,26 +58,26 @@ private:
|
||||
bw_ap1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline AP1<N_CHANNELS>::AP1() {
|
||||
bw_ap1_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ap1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP1<N_CHANNELS>::reset(float x0) {
|
||||
bw_ap1_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_ap1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -85,7 +85,7 @@ inline void AP1<N_CHANNELS>::process(
|
||||
bw_ap1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ap1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::AP2
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class AP2 {
|
||||
public:
|
||||
AP2();
|
||||
@ -59,26 +59,26 @@ private:
|
||||
bw_ap2_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline AP2<N_CHANNELS>::AP2() {
|
||||
bw_ap2_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP2<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ap2_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP2<N_CHANNELS>::reset(float x0) {
|
||||
bw_ap2_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_ap2_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP2<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -86,12 +86,12 @@ inline void AP2<N_CHANNELS>::process(
|
||||
bw_ap2_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP2<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ap2_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void AP2<N_CHANNELS>::setQ(float value) {
|
||||
bw_ap2_set_Q(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Balance
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Balance {
|
||||
public:
|
||||
Balance();
|
||||
@ -58,22 +58,22 @@ private:
|
||||
bw_balance_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Balance<N_CHANNELS>::Balance() {
|
||||
bw_balance_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Balance<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_balance_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Balance<N_CHANNELS>::reset() {
|
||||
bw_balance_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Balance<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x_l,
|
||||
std::array<const float *, N_CHANNELS> x_r,
|
||||
@ -83,7 +83,7 @@ inline void Balance<N_CHANNELS>::process(
|
||||
bw_balance_process_multi(&coeffs, x_l.data(), x_r.data(), y_l.data(), y_r.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Balance<N_CHANNELS>::setBalance(float value) {
|
||||
bw_balance_set_balance(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::BDReduce
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class BDReduce {
|
||||
public:
|
||||
BDReduce();
|
||||
@ -55,17 +55,17 @@ private:
|
||||
bw_bd_reduce_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline BDReduce<N_CHANNELS>::BDReduce() {
|
||||
bw_bd_reduce_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void BDReduce<N_CHANNELS>::reset() {
|
||||
bw_bd_reduce_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void BDReduce<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -73,7 +73,7 @@ inline void BDReduce<N_CHANNELS>::process(
|
||||
bw_bd_reduce_process_multi(&coeffs, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void BDReduce<N_CHANNELS>::setBitDepth(char value) {
|
||||
bw_bd_reduce_set_bit_depth(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::bufFill
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void bufFill(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
float k,
|
||||
@ -38,7 +38,7 @@ void bufFill(
|
||||
*
|
||||
* ##### Brickworks::bufNeg
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void bufNeg(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src,
|
||||
@ -47,7 +47,7 @@ void bufNeg(
|
||||
*
|
||||
* ##### Brickworks::bufAdd
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void bufAdd(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src,
|
||||
@ -57,7 +57,7 @@ void bufAdd(
|
||||
*
|
||||
* ##### Brickworks::bufScale
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void bufScale(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src,
|
||||
@ -67,7 +67,7 @@ void bufScale(
|
||||
*
|
||||
* ##### Brickworks::bufMix
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void bufMix(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src1,
|
||||
@ -77,7 +77,7 @@ void bufMix(
|
||||
*
|
||||
* ##### Brickworks::bufMul
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void bufMul(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src1,
|
||||
@ -91,7 +91,7 @@ void bufMul(
|
||||
/* WARNING: This part of the file is not part of the public API. Its content may
|
||||
* change at any time in future versions. Please, do not use it directly. */
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void bufFill(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
float k,
|
||||
@ -99,7 +99,7 @@ inline void bufFill(
|
||||
bw_buf_fill_multi(dest.data(), k, N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void bufNeg(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src,
|
||||
@ -107,7 +107,7 @@ inline void bufNeg(
|
||||
bw_buf_neg_multi(dest.data(), src.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void bufAdd(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src,
|
||||
@ -116,7 +116,7 @@ inline void bufAdd(
|
||||
bw_buf_add_multi(dest.data(), src.data(), k, N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void bufScale(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src,
|
||||
@ -125,7 +125,7 @@ inline void bufScale(
|
||||
bw_buf_scale_multi(dest.data(), src.data(), k, N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void bufMix(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src1,
|
||||
@ -134,7 +134,7 @@ inline void bufMix(
|
||||
bw_buf_mix_multi(dest.data(), src1.data(), src2.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void bufMul(
|
||||
std::array<float *, N_CHANNELS> dest,
|
||||
std::array<const float *, N_CHANNELS> src1,
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Chorus
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Chorus {
|
||||
public:
|
||||
Chorus(float maxDelay = 0.01f);
|
||||
@ -65,40 +65,40 @@ private:
|
||||
void *mem;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Chorus<N_CHANNELS>::Chorus(float maxDelay) {
|
||||
bw_chorus_init(&coeffs, maxDelay);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
mem = nullptr;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Chorus<N_CHANNELS>::~Chorus() {
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_chorus_set_sample_rate(&coeffs, sampleRate);
|
||||
BW_SIZE_T req = bw_chorus_mem_req(&coeffs);
|
||||
size_t req = bw_chorus_mem_req(&coeffs);
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
mem = operator new(req * N_CHANNELS);
|
||||
void *m = mem;
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
bw_chorus_mem_set(&coeffs, states + i, m);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::reset() {
|
||||
bw_chorus_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_chorus_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -106,32 +106,32 @@ inline void Chorus<N_CHANNELS>::process(
|
||||
bw_chorus_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setRate(float value) {
|
||||
bw_chorus_set_rate(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setDelay(float value) {
|
||||
bw_chorus_set_delay(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setAmount(float value) {
|
||||
bw_chorus_set_amount(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setCoeffX(float value) {
|
||||
bw_chorus_set_coeff_x(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setCoeffMod(float value) {
|
||||
bw_chorus_set_coeff_mod(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Chorus<N_CHANNELS>::setCoeffFB(float value) {
|
||||
bw_chorus_set_coeff_fb(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Clip
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Clip {
|
||||
public:
|
||||
Clip();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_clip_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Clip<N_CHANNELS>::Clip() {
|
||||
bw_clip_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Clip<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_clip_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Clip<N_CHANNELS>::reset() {
|
||||
bw_clip_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_clip_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Clip<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void Clip<N_CHANNELS>::process(
|
||||
bw_clip_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Clip<N_CHANNELS>::setBias(float value) {
|
||||
bw_clip_set_bias(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Clip<N_CHANNELS>::setGain(float value) {
|
||||
bw_clip_set_gain(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Clip<N_CHANNELS>::setGainCompensation(bool value) {
|
||||
bw_clip_set_gain_compensation(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Comb
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Comb {
|
||||
public:
|
||||
Comb(float maxDelay = 1.f);
|
||||
@ -64,40 +64,40 @@ private:
|
||||
void *mem;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Comb<N_CHANNELS>::Comb(float maxDelay) {
|
||||
bw_comb_init(&coeffs, maxDelay);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
mem = nullptr;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Comb<N_CHANNELS>::~Comb() {
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_comb_set_sample_rate(&coeffs, sampleRate);
|
||||
BW_SIZE_T req = bw_comb_mem_req(&coeffs);
|
||||
size_t req = bw_comb_mem_req(&coeffs);
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
mem = operator new(req * N_CHANNELS);
|
||||
void *m = mem;
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
bw_comb_mem_set(&coeffs, states + i, m);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::reset() {
|
||||
bw_comb_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_comb_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -105,27 +105,27 @@ inline void Comb<N_CHANNELS>::process(
|
||||
bw_comb_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::setDelayFF(float value) {
|
||||
bw_comb_set_delay_ff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::setDelayFB(float value) {
|
||||
bw_comb_set_delay_fb(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::setCoeffBlend(float value) {
|
||||
bw_comb_set_coeff_blend(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::setCoeffFF(float value) {
|
||||
bw_comb_set_coeff_ff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comb<N_CHANNELS>::setCoeffFB(float value) {
|
||||
bw_comb_set_coeff_fb(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Comp
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Comp {
|
||||
public:
|
||||
Comp();
|
||||
@ -65,26 +65,26 @@ private:
|
||||
bw_comp_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Comp<N_CHANNELS>::Comp() {
|
||||
bw_comp_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_comp_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::reset() {
|
||||
bw_comp_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_comp_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<const float *, N_CHANNELS> xSC,
|
||||
@ -93,37 +93,37 @@ inline void Comp<N_CHANNELS>::process(
|
||||
bw_comp_process_multi(&coeffs, statesP, x.data(), xSC.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setTreshLin(float value) {
|
||||
bw_comp_set_thresh_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setTreshDBFS(float value) {
|
||||
bw_comp_set_thresh_dBFS(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setRatio(float value) {
|
||||
bw_comp_set_ratio(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setAttackTau(float value) {
|
||||
bw_comp_set_attack_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setReleaseTau(float value) {
|
||||
bw_comp_set_release_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setGainLin(float value) {
|
||||
bw_comp_set_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Comp<N_CHANNELS>::setGainDB(float value) {
|
||||
bw_comp_set_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Delay
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Delay {
|
||||
public:
|
||||
Delay(float maxDelay = 1.f);
|
||||
@ -42,12 +42,12 @@ public:
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples);
|
||||
|
||||
float read(BW_SIZE_T channel, BW_SIZE_T di, float df);
|
||||
void write(BW_SIZE_T channel, float x);
|
||||
float read(size_t channel, size_t di, float df);
|
||||
void write(size_t channel, float x);
|
||||
|
||||
void setDelay(float value);
|
||||
|
||||
BW_SIZE_T getLength();
|
||||
size_t getLength();
|
||||
/*! <<<...
|
||||
* }
|
||||
* ```
|
||||
@ -65,40 +65,40 @@ private:
|
||||
void *mem;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Delay<N_CHANNELS>::Delay(float maxDelay) {
|
||||
bw_delay_init(&coeffs, maxDelay);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
mem = nullptr;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Delay<N_CHANNELS>::~Delay() {
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Delay<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_delay_set_sample_rate(&coeffs, sampleRate);
|
||||
BW_SIZE_T req = bw_delay_mem_req(&coeffs);
|
||||
size_t req = bw_delay_mem_req(&coeffs);
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
mem = operator new(req * N_CHANNELS);
|
||||
void *m = mem;
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
bw_delay_mem_set(&coeffs, states + i, m);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Delay<N_CHANNELS>::reset() {
|
||||
bw_delay_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_delay_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Delay<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -106,23 +106,23 @@ inline void Delay<N_CHANNELS>::process(
|
||||
bw_delay_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline float Delay<N_CHANNELS>::read(BW_SIZE_T channel, BW_SIZE_T di, float df) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline float Delay<N_CHANNELS>::read(size_t channel, size_t di, float df) {
|
||||
return bw_delay_read(&coeffs, states + channel, di, df);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline void Delay<N_CHANNELS>::write(BW_SIZE_T channel, float x) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Delay<N_CHANNELS>::write(size_t channel, float x) {
|
||||
bw_delay_write(&coeffs, states + channel, x);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Delay<N_CHANNELS>::setDelay(float value) {
|
||||
bw_delay_set_delay(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline BW_SIZE_T Delay<N_CHANNELS>::getLength() {
|
||||
template<size_t N_CHANNELS>
|
||||
inline size_t Delay<N_CHANNELS>::getLength() {
|
||||
return bw_delay_get_length(&coeffs);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Dist
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Dist {
|
||||
public:
|
||||
Dist();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_dist_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Dist<N_CHANNELS>::Dist() {
|
||||
bw_dist_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Dist<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_dist_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Dist<N_CHANNELS>::reset() {
|
||||
bw_dist_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_dist_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Dist<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void Dist<N_CHANNELS>::process(
|
||||
bw_dist_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Dist<N_CHANNELS>::setDistortion(float value) {
|
||||
bw_dist_set_distortion(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Dist<N_CHANNELS>::setTone(float value) {
|
||||
bw_dist_set_tone(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Dist<N_CHANNELS>::setVolume(float value) {
|
||||
bw_dist_set_volume(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Drive
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Drive {
|
||||
public:
|
||||
Drive();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_drive_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Drive<N_CHANNELS>::Drive() {
|
||||
bw_drive_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Drive<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_drive_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Drive<N_CHANNELS>::reset() {
|
||||
bw_drive_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_drive_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Drive<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void Drive<N_CHANNELS>::process(
|
||||
bw_drive_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Drive<N_CHANNELS>::setDrive(float value) {
|
||||
bw_drive_set_drive(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Drive<N_CHANNELS>::setTone(float value) {
|
||||
bw_drive_set_tone(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Drive<N_CHANNELS>::setVolume(float value) {
|
||||
bw_drive_set_volume(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::DryWet
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class DryWet {
|
||||
public:
|
||||
DryWet();
|
||||
@ -58,22 +58,22 @@ private:
|
||||
bw_drywet_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline DryWet<N_CHANNELS>::DryWet() {
|
||||
bw_drywet_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void DryWet<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_drywet_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void DryWet<N_CHANNELS>::reset() {
|
||||
bw_drywet_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void DryWet<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x_dry,
|
||||
std::array<const float *, N_CHANNELS> x_wet,
|
||||
@ -82,12 +82,12 @@ inline void DryWet<N_CHANNELS>::process(
|
||||
bw_drywet_process_multi(&coeffs, x_dry.data(), x_wet.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void DryWet<N_CHANNELS>::setWet(float value) {
|
||||
bw_drywet_set_wet(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void DryWet<N_CHANNELS>::setSmoothTau(float value) {
|
||||
bw_drywet_set_smooth_tau(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::EnvFollow
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class EnvFollow {
|
||||
public:
|
||||
EnvFollow();
|
||||
@ -44,7 +44,7 @@ public:
|
||||
void setAttackTau(float value);
|
||||
void setReleaseTau(float value);
|
||||
|
||||
float getYZ1(BW_SIZE_T channel);
|
||||
float getYZ1(size_t channel);
|
||||
/*! <<<...
|
||||
* }
|
||||
* ```
|
||||
@ -61,26 +61,26 @@ private:
|
||||
bw_env_follow_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline EnvFollow<N_CHANNELS>::EnvFollow() {
|
||||
bw_env_follow_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvFollow<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_env_follow_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvFollow<N_CHANNELS>::reset() {
|
||||
bw_env_follow_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_env_follow_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvFollow<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -88,18 +88,18 @@ inline void EnvFollow<N_CHANNELS>::process(
|
||||
bw_env_follow_process_multi(&coeffs, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvFollow<N_CHANNELS>::setAttackTau(float value) {
|
||||
bw_env_follow_set_attack_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvFollow<N_CHANNELS>::setReleaseTau(float value) {
|
||||
bw_env_follow_set_release_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline float EnvFollow<N_CHANNELS>::getYZ1(BW_SIZE_T channel) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline float EnvFollow<N_CHANNELS>::getYZ1(size_t channel) {
|
||||
return bw_env_follow_get_y_z1(states + channel);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::EnvGen
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class EnvGen {
|
||||
public:
|
||||
EnvGen();
|
||||
@ -46,8 +46,8 @@ public:
|
||||
void setSustain(float value);
|
||||
void setRelease(float value);
|
||||
|
||||
bw_env_gen_phase getPhase(BW_SIZE_T channel);
|
||||
float getYZ1(BW_SIZE_T channel);
|
||||
bw_env_gen_phase getPhase(size_t channel);
|
||||
float getYZ1(size_t channel);
|
||||
/*! <<<...
|
||||
* }
|
||||
* ```
|
||||
@ -64,26 +64,26 @@ private:
|
||||
bw_env_gen_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline EnvGen<N_CHANNELS>::EnvGen() {
|
||||
bw_env_gen_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_env_gen_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::reset() {
|
||||
bw_env_gen_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_env_gen_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::process(
|
||||
std::array<char, N_CHANNELS> gate,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -91,33 +91,33 @@ inline void EnvGen<N_CHANNELS>::process(
|
||||
bw_env_gen_process_multi(&coeffs, statesP, gate.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::setAttack(float value) {
|
||||
bw_env_gen_set_attack(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::setDecay(float value) {
|
||||
bw_env_gen_set_decay(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::setSustain(float value) {
|
||||
bw_env_gen_set_sustain(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void EnvGen<N_CHANNELS>::setRelease(float value) {
|
||||
bw_env_gen_set_release(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline bw_env_gen_phase EnvGen<N_CHANNELS>::getPhase(BW_SIZE_T channel) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline bw_env_gen_phase EnvGen<N_CHANNELS>::getPhase(size_t channel) {
|
||||
return bw_env_gen_get_phase(states + channel);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline float EnvGen<N_CHANNELS>::getYZ1(BW_SIZE_T channel) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline float EnvGen<N_CHANNELS>::getYZ1(size_t channel) {
|
||||
return bw_env_gen_get_y_z1(states + channel);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Fuzz
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Fuzz {
|
||||
public:
|
||||
Fuzz();
|
||||
@ -59,26 +59,26 @@ private:
|
||||
bw_fuzz_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Fuzz<N_CHANNELS>::Fuzz() {
|
||||
bw_fuzz_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Fuzz<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_fuzz_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Fuzz<N_CHANNELS>::reset() {
|
||||
bw_fuzz_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_fuzz_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Fuzz<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -86,12 +86,12 @@ inline void Fuzz<N_CHANNELS>::process(
|
||||
bw_fuzz_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Fuzz<N_CHANNELS>::setFuzz(float value) {
|
||||
bw_fuzz_set_fuzz(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Fuzz<N_CHANNELS>::setVolume(float value) {
|
||||
bw_fuzz_set_volume(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Gain
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Gain {
|
||||
public:
|
||||
Gain();
|
||||
@ -60,22 +60,22 @@ private:
|
||||
bw_gain_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Gain<N_CHANNELS>::Gain() {
|
||||
bw_gain_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Gain<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_gain_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Gain<N_CHANNELS>::reset() {
|
||||
bw_gain_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Gain<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -83,22 +83,22 @@ inline void Gain<N_CHANNELS>::process(
|
||||
bw_gain_process_multi(&coeffs, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Gain<N_CHANNELS>::setGainLin(float value) {
|
||||
bw_gain_set_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Gain<N_CHANNELS>::setGainDB(float value) {
|
||||
bw_gain_set_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Gain<N_CHANNELS>::setSmoothTau(float value) {
|
||||
bw_gain_set_smooth_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline float Gain<N_CHANNELS>::getGain() {
|
||||
return bw_gain_get_gain(&coeffs);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::HP1
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class HP1 {
|
||||
public:
|
||||
HP1();
|
||||
@ -58,26 +58,26 @@ private:
|
||||
bw_hp1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline HP1<N_CHANNELS>::HP1() {
|
||||
bw_hp1_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HP1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_hp1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HP1<N_CHANNELS>::reset(float x0) {
|
||||
bw_hp1_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_hp1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HP1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -85,7 +85,7 @@ inline void HP1<N_CHANNELS>::process(
|
||||
bw_hp1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HP1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_hp1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::HS1
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class HS1 {
|
||||
public:
|
||||
HS1();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_hs1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline HS1<N_CHANNELS>::HS1() {
|
||||
bw_hs1_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_hs1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS1<N_CHANNELS>::reset(float x0) {
|
||||
bw_hs1_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_hs1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void HS1<N_CHANNELS>::process(
|
||||
bw_hs1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_hs1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS1<N_CHANNELS>::setHighGainLin(float value) {
|
||||
bw_hs1_set_high_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS1<N_CHANNELS>::setHighGainDB(float value) {
|
||||
bw_hs1_set_high_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::HS2
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class HS2 {
|
||||
public:
|
||||
HS2();
|
||||
@ -61,26 +61,26 @@ private:
|
||||
bw_hs2_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline HS2<N_CHANNELS>::HS2() {
|
||||
bw_hs2_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_hs2_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::reset(float x0) {
|
||||
bw_hs2_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_hs2_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -88,22 +88,22 @@ inline void HS2<N_CHANNELS>::process(
|
||||
bw_hs2_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_hs2_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::setQ(float value) {
|
||||
bw_hs2_set_Q(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::setHighGainLin(float value) {
|
||||
bw_hs2_set_high_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void HS2<N_CHANNELS>::setHighGainDB(float value) {
|
||||
bw_hs2_set_high_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::LP1
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class LP1 {
|
||||
public:
|
||||
LP1();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_lp1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline LP1<N_CHANNELS>::LP1() {
|
||||
bw_lp1_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LP1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_lp1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LP1<N_CHANNELS>::reset(float x0) {
|
||||
bw_lp1_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_lp1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LP1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void LP1<N_CHANNELS>::process(
|
||||
bw_lp1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LP1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_lp1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LP1<N_CHANNELS>::setPrewarpAtCutoff(bool value) {
|
||||
bw_lp1_set_prewarp_at_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LP1<N_CHANNELS>::setPrewarpFreq(float value) {
|
||||
bw_lp1_set_prewarp_freq(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::LS1
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class LS1 {
|
||||
public:
|
||||
LS1();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_ls1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline LS1<N_CHANNELS>::LS1() {
|
||||
bw_ls1_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ls1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS1<N_CHANNELS>::reset(float x0) {
|
||||
bw_ls1_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_ls1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void LS1<N_CHANNELS>::process(
|
||||
bw_ls1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ls1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS1<N_CHANNELS>::setDcGainLin(float value) {
|
||||
bw_ls1_set_dc_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS1<N_CHANNELS>::setDcGainDB(float value) {
|
||||
bw_ls1_set_dc_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::LS2
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class LS2 {
|
||||
public:
|
||||
LS2();
|
||||
@ -61,26 +61,26 @@ private:
|
||||
bw_ls2_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline LS2<N_CHANNELS>::LS2() {
|
||||
bw_ls2_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ls2_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::reset(float x0) {
|
||||
bw_ls2_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_ls2_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -88,22 +88,22 @@ inline void LS2<N_CHANNELS>::process(
|
||||
bw_ls2_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_ls2_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::setQ(float value) {
|
||||
bw_ls2_set_Q(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::setDcGainLin(float value) {
|
||||
bw_ls2_set_dc_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void LS2<N_CHANNELS>::setDcGainDB(float value) {
|
||||
bw_ls2_set_dc_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::MM1
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class MM1 {
|
||||
public:
|
||||
MM1();
|
||||
@ -62,26 +62,26 @@ private:
|
||||
bw_mm1_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline MM1<N_CHANNELS>::MM1() {
|
||||
bw_mm1_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_mm1_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::reset(float x0) {
|
||||
bw_mm1_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_mm1_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -89,27 +89,27 @@ inline void MM1<N_CHANNELS>::process(
|
||||
bw_mm1_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_mm1_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::setPrewarpAtCutoff(bool value) {
|
||||
bw_mm1_set_prewarp_at_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::setPrewarpFreq(float value) {
|
||||
bw_mm1_set_prewarp_freq(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::setCoeffX(float value) {
|
||||
bw_mm1_set_coeff_x(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM1<N_CHANNELS>::setCoeffLp(float value) {
|
||||
bw_mm1_set_coeff_lp(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::MM2
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class MM2 {
|
||||
public:
|
||||
MM2();
|
||||
@ -65,26 +65,26 @@ private:
|
||||
bw_mm2_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline MM2<N_CHANNELS>::MM2() {
|
||||
bw_mm2_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_mm2_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::reset(float x0) {
|
||||
bw_mm2_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_mm2_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -92,42 +92,42 @@ inline void MM2<N_CHANNELS>::process(
|
||||
bw_mm2_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_mm2_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setQ(float value) {
|
||||
bw_mm2_set_Q(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setPrewarpAtCutoff(bool value) {
|
||||
bw_mm2_set_prewarp_at_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setPrewarpFreq(float value) {
|
||||
bw_mm2_set_prewarp_freq(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setCoeffX(float value) {
|
||||
bw_mm2_set_coeff_x(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setCoeffLp(float value) {
|
||||
bw_mm2_set_coeff_lp(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setCoeffBp(float value) {
|
||||
bw_mm2_set_coeff_bp(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void MM2<N_CHANNELS>::setCoeffHp(float value) {
|
||||
bw_mm2_set_coeff_hp(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::NoiseGate
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class NoiseGate {
|
||||
public:
|
||||
NoiseGate();
|
||||
@ -63,26 +63,26 @@ private:
|
||||
bw_noise_gate_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline NoiseGate<N_CHANNELS>::NoiseGate() {
|
||||
bw_noise_gate_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_noise_gate_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::reset() {
|
||||
bw_noise_gate_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_noise_gate_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<const float *, N_CHANNELS> xSC,
|
||||
@ -91,27 +91,27 @@ inline void NoiseGate<N_CHANNELS>::process(
|
||||
bw_noise_gate_process_multi(&coeffs, statesP, x.data(), xSC.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::setTreshLin(float value) {
|
||||
bw_noise_gate_set_thresh_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::setTreshDBFS(float value) {
|
||||
bw_noise_gate_set_thresh_dBFS(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::setRatio(float value) {
|
||||
bw_noise_gate_set_ratio(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::setAttackTau(float value) {
|
||||
bw_noise_gate_set_attack_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGate<N_CHANNELS>::setReleaseTau(float value) {
|
||||
bw_noise_gate_set_release_tau(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::NoiseGen
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class NoiseGen {
|
||||
public:
|
||||
NoiseGen(uint64_t *BW_RESTRICT state);
|
||||
@ -56,29 +56,29 @@ private:
|
||||
bw_noise_gen_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline NoiseGen<N_CHANNELS>::NoiseGen(uint64_t *BW_RESTRICT state) {
|
||||
bw_noise_gen_init(&coeffs, state);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGen<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_noise_gen_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGen<N_CHANNELS>::process(
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
int nSamples) {
|
||||
bw_noise_gen_process_multi(&coeffs, y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void NoiseGen<N_CHANNELS>::setSampleRateScaling(bool value) {
|
||||
bw_noise_gen_set_sample_rate_scaling(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline float NoiseGen<N_CHANNELS>::getScalingK() {
|
||||
return bw_noise_gen_get_scaling_k(&coeffs);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Notch
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Notch {
|
||||
public:
|
||||
Notch();
|
||||
@ -59,26 +59,26 @@ private:
|
||||
bw_notch_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Notch<N_CHANNELS>::Notch() {
|
||||
bw_notch_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Notch<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_notch_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Notch<N_CHANNELS>::reset(float x0) {
|
||||
bw_notch_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_notch_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Notch<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -86,12 +86,12 @@ inline void Notch<N_CHANNELS>::process(
|
||||
bw_notch_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Notch<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_notch_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Notch<N_CHANNELS>::setQ(float value) {
|
||||
bw_notch_set_Q(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::OnePole
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class OnePole {
|
||||
public:
|
||||
OnePole();
|
||||
@ -50,7 +50,7 @@ public:
|
||||
void setStickyThresh(float value);
|
||||
void setStickyMode(bw_one_pole_sticky_mode value);
|
||||
|
||||
float getYZ1(BW_SIZE_T channel);
|
||||
float getYZ1(size_t channel);
|
||||
/*! <<<...
|
||||
* }
|
||||
* ```
|
||||
@ -67,26 +67,26 @@ private:
|
||||
bw_one_pole_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline OnePole<N_CHANNELS>::OnePole() {
|
||||
bw_one_pole_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_one_pole_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::reset(float y_z1) {
|
||||
bw_one_pole_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_one_pole_reset_state(&coeffs, states + i, y_z1);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -94,48 +94,48 @@ inline void OnePole<N_CHANNELS>::process(
|
||||
bw_one_pole_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_one_pole_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setCutoffUp(float value) {
|
||||
bw_one_pole_set_cutoff_up(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setCutoffDown(float value) {
|
||||
bw_one_pole_set_cutoff_down(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setTau(float value) {
|
||||
bw_one_pole_set_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setTauUp(float value) {
|
||||
bw_one_pole_set_tau_up(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setTauDown(float value) {
|
||||
bw_one_pole_set_tau_down(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setStickyThresh(float value) {
|
||||
bw_one_pole_set_sticky_thresh(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OnePole<N_CHANNELS>::setStickyMode(bw_one_pole_sticky_mode value) {
|
||||
bw_one_pole_set_sticky_mode(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline float OnePole<N_CHANNELS>::getYZ1(BW_SIZE_T channel) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline float OnePole<N_CHANNELS>::getYZ1(size_t channel) {
|
||||
return bw_one_pole_get_y_z1(states + channel);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::OscFilt
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class OscFilt {
|
||||
public:
|
||||
OscFilt();
|
||||
@ -54,19 +54,19 @@ private:
|
||||
bw_osc_filt_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline OscFilt<N_CHANNELS>::OscFilt() {
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscFilt<N_CHANNELS>::reset() {
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_osc_filt_reset_state(states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscFilt<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::OscPulse
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class OscPulse {
|
||||
public:
|
||||
OscPulse();
|
||||
@ -58,22 +58,22 @@ private:
|
||||
bw_osc_pulse_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline OscPulse<N_CHANNELS>::OscPulse() {
|
||||
bw_osc_pulse_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscPulse<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_osc_pulse_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscPulse<N_CHANNELS>::reset() {
|
||||
bw_osc_pulse_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscPulse<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<const float *, N_CHANNELS> x_phase_inc,
|
||||
@ -82,12 +82,12 @@ inline void OscPulse<N_CHANNELS>::process(
|
||||
bw_osc_pulse_process_multi(&coeffs, x.data(), x_phase_inc.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscPulse<N_CHANNELS>::setAntialiasing(bool value) {
|
||||
bw_osc_pulse_set_antialiasing(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscPulse<N_CHANNELS>::setPulseWidth(float value) {
|
||||
bw_osc_pulse_set_pulse_width(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::OscSaw
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class OscSaw {
|
||||
public:
|
||||
OscSaw();
|
||||
@ -55,12 +55,12 @@ private:
|
||||
bw_osc_saw_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline OscSaw<N_CHANNELS>::OscSaw() {
|
||||
bw_osc_saw_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscSaw<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<const float *, N_CHANNELS> x_phase_inc,
|
||||
@ -69,7 +69,7 @@ inline void OscSaw<N_CHANNELS>::process(
|
||||
bw_osc_saw_process_multi(&coeffs, x.data(), x_phase_inc.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscSaw<N_CHANNELS>::setAntialiasing(bool value) {
|
||||
bw_osc_saw_set_antialiasing(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::oscSinProcess
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
void oscSinProcess(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -42,7 +42,7 @@ void oscSinProcess(
|
||||
/* WARNING: This part of the file is not part of the public API. Its content may
|
||||
* change at any time in future versions. Please, do not use it directly. */
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void oscSinProcess(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::OscTri
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class OscTri {
|
||||
public:
|
||||
OscTri();
|
||||
@ -58,22 +58,22 @@ private:
|
||||
bw_osc_tri_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline OscTri<N_CHANNELS>::OscTri() {
|
||||
bw_osc_tri_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscTri<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_osc_tri_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscTri<N_CHANNELS>::reset() {
|
||||
bw_osc_tri_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscTri<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<const float *, N_CHANNELS> x_phase_inc,
|
||||
@ -82,12 +82,12 @@ inline void OscTri<N_CHANNELS>::process(
|
||||
bw_osc_tri_process_multi(&coeffs, x.data(), x_phase_inc.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscTri<N_CHANNELS>::setAntialiasing(bool value) {
|
||||
bw_osc_tri_set_antialiasing(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void OscTri<N_CHANNELS>::setSlope(float value) {
|
||||
bw_osc_tri_set_slope(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Pan
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Pan {
|
||||
public:
|
||||
Pan();
|
||||
@ -57,22 +57,22 @@ private:
|
||||
bw_pan_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Pan<N_CHANNELS>::Pan() {
|
||||
bw_pan_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Pan<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_pan_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Pan<N_CHANNELS>::reset() {
|
||||
bw_pan_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Pan<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y_l,
|
||||
@ -81,7 +81,7 @@ inline void Pan<N_CHANNELS>::process(
|
||||
bw_pan_process_multi(&coeffs, x.data(), y_l.data(), y_r.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Pan<N_CHANNELS>::setPan(float value) {
|
||||
bw_pan_set_pan(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Peak
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Peak {
|
||||
public:
|
||||
Peak();
|
||||
@ -63,26 +63,26 @@ private:
|
||||
bw_peak_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Peak<N_CHANNELS>::Peak() {
|
||||
bw_peak_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_peak_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::reset(float x0) {
|
||||
bw_peak_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_peak_reset_state(&coeffs, states + i, x0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -90,32 +90,32 @@ inline void Peak<N_CHANNELS>::process(
|
||||
bw_peak_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setCutoff(float value) {
|
||||
bw_peak_set_cutoff(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setQ(float value) {
|
||||
bw_peak_set_Q(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setPeakGainLin(float value) {
|
||||
bw_peak_set_peak_gain_lin(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setPeakGainDB(float value) {
|
||||
bw_peak_set_peak_gain_dB(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setBandwidth(float value) {
|
||||
bw_peak_set_bandwidth(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Peak<N_CHANNELS>::setUseBandwidth(bool value) {
|
||||
bw_peak_set_use_bandwidth(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::PhaseGen
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class PhaseGen {
|
||||
public:
|
||||
PhaseGen();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_phase_gen_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline PhaseGen<N_CHANNELS>::PhaseGen() {
|
||||
bw_phase_gen_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PhaseGen<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_phase_gen_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PhaseGen<N_CHANNELS>::reset(float phase_0) {
|
||||
bw_phase_gen_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_phase_gen_reset_state(&coeffs, states + i, phase_0);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PhaseGen<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x_mod,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -88,12 +88,12 @@ inline void PhaseGen<N_CHANNELS>::process(
|
||||
bw_phase_gen_process_multi(&coeffs, statesP, x_mod.data(), y.data(), y_phase_inc.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PhaseGen<N_CHANNELS>::setFrequency(float value) {
|
||||
bw_phase_gen_set_frequency(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PhaseGen<N_CHANNELS>::setPortamentoTau(float value) {
|
||||
bw_phase_gen_set_portamento_tau(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Phaser
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Phaser {
|
||||
public:
|
||||
Phaser();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_phaser_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Phaser<N_CHANNELS>::Phaser() {
|
||||
bw_phaser_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Phaser<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_phaser_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Phaser<N_CHANNELS>::reset() {
|
||||
bw_phaser_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_phaser_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Phaser<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void Phaser<N_CHANNELS>::process(
|
||||
bw_phaser_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Phaser<N_CHANNELS>::setRate(float value) {
|
||||
bw_phaser_set_rate(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Phaser<N_CHANNELS>::setCenter(float value) {
|
||||
bw_phaser_set_center(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Phaser<N_CHANNELS>::setAmount(float value) {
|
||||
bw_phaser_set_amount(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::PinkFilt
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class PinkFilt {
|
||||
public:
|
||||
PinkFilt();
|
||||
@ -60,25 +60,25 @@ private:
|
||||
bw_pink_filt_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline PinkFilt<N_CHANNELS>::PinkFilt() {
|
||||
bw_pink_filt_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PinkFilt<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_pink_filt_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PinkFilt<N_CHANNELS>::reset() {
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_pink_filt_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PinkFilt<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -86,12 +86,12 @@ inline void PinkFilt<N_CHANNELS>::process(
|
||||
bw_pink_filt_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PinkFilt<N_CHANNELS>::setSampleRateScaling(bool value) {
|
||||
bw_pink_filt_set_sample_rate_scaling(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline float PinkFilt<N_CHANNELS>::getScalingK() {
|
||||
return bw_pink_filt_get_scaling_k(&coeffs);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::PPM
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class PPM {
|
||||
public:
|
||||
PPM();
|
||||
@ -43,7 +43,7 @@ public:
|
||||
|
||||
void setIntegrationTau(float value);
|
||||
|
||||
float getYZ1(BW_SIZE_T channel);
|
||||
float getYZ1(size_t channel);
|
||||
/*! <<<...
|
||||
* }
|
||||
* ```
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_ppm_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline PPM<N_CHANNELS>::PPM() {
|
||||
bw_ppm_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PPM<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ppm_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PPM<N_CHANNELS>::reset() {
|
||||
bw_ppm_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_ppm_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PPM<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,13 +87,13 @@ inline void PPM<N_CHANNELS>::process(
|
||||
bw_ppm_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void PPM<N_CHANNELS>::setIntegrationTau(float value) {
|
||||
bw_ppm_set_integration_tau(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline float PPM<N_CHANNELS>::getYZ1(BW_SIZE_T channel) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline float PPM<N_CHANNELS>::getYZ1(size_t channel) {
|
||||
return bw_ppm_get_y_z1(states + channel);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Reverb
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Reverb {
|
||||
public:
|
||||
Reverb();
|
||||
@ -66,40 +66,40 @@ private:
|
||||
void *mem;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Reverb<N_CHANNELS>::Reverb() {
|
||||
bw_reverb_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
mem = nullptr;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Reverb<N_CHANNELS>::~Reverb() {
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_reverb_set_sample_rate(&coeffs, sampleRate);
|
||||
BW_SIZE_T req = bw_reverb_mem_req(&coeffs);
|
||||
size_t req = bw_reverb_mem_req(&coeffs);
|
||||
if (mem != nullptr)
|
||||
operator delete(mem);
|
||||
mem = operator new(req * N_CHANNELS);
|
||||
void *m = mem;
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++, m = static_cast<char *>(m) + req)
|
||||
bw_reverb_mem_set(&coeffs, states + i, m);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::reset() {
|
||||
bw_reverb_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_reverb_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> xl,
|
||||
std::array<const float *, N_CHANNELS> xr,
|
||||
@ -109,27 +109,27 @@ inline void Reverb<N_CHANNELS>::process(
|
||||
bw_reverb_process_multi(&coeffs, statesP, xl.data(), xr.data(), yl.data(), yr.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::setPredelay(float value) {
|
||||
bw_reverb_set_predelay(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::setBandwidth(float value) {
|
||||
bw_reverb_set_bandwidth(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::setDamping(float value) {
|
||||
bw_reverb_set_damping(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::setDecay(float value) {
|
||||
bw_reverb_set_decay(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Reverb<N_CHANNELS>::setWet(float value) {
|
||||
bw_reverb_set_wet(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::RingMod
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class RingMod {
|
||||
public:
|
||||
RingMod();
|
||||
@ -57,22 +57,22 @@ private:
|
||||
bw_ringmod_coeffs coeffs;
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline RingMod<N_CHANNELS>::RingMod() {
|
||||
bw_ringmod_init(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void RingMod<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_ringmod_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void RingMod<N_CHANNELS>::reset() {
|
||||
bw_ringmod_reset_coeffs(&coeffs);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void RingMod<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x_mod,
|
||||
std::array<const float *, N_CHANNELS> x_car,
|
||||
@ -81,7 +81,7 @@ inline void RingMod<N_CHANNELS>::process(
|
||||
bw_ringmod_process_multi(&coeffs, statesP, x_mod.data(), x_car.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void RingMod<N_CHANNELS>::setAmount(float value) {
|
||||
bw_ringmod_set_amount(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::Satur
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class Satur {
|
||||
public:
|
||||
Satur();
|
||||
@ -60,26 +60,26 @@ private:
|
||||
bw_satur_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline Satur<N_CHANNELS>::Satur() {
|
||||
bw_satur_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Satur<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_satur_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Satur<N_CHANNELS>::reset() {
|
||||
bw_satur_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_satur_reset_state(&coeffs, states + i);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Satur<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -87,17 +87,17 @@ inline void Satur<N_CHANNELS>::process(
|
||||
bw_satur_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Satur<N_CHANNELS>::setBias(float value) {
|
||||
bw_satur_set_bias(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Satur<N_CHANNELS>::setGain(float value) {
|
||||
bw_satur_set_gain(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void Satur<N_CHANNELS>::setGainCompensation(bool value) {
|
||||
bw_satur_set_gain_compensation(&coeffs, value);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Brickworks {
|
||||
/*! api {{{
|
||||
* ##### Brickworks::SlewLim
|
||||
* ```>>> */
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
class SlewLim {
|
||||
public:
|
||||
SlewLim();
|
||||
@ -45,7 +45,7 @@ public:
|
||||
void setMaxRateUp(float value);
|
||||
void setMaxRateDown(float value);
|
||||
|
||||
float getYZ1(BW_SIZE_T channel);
|
||||
float getYZ1(size_t channel);
|
||||
/*! <<<...
|
||||
* }
|
||||
* ```
|
||||
@ -62,26 +62,26 @@ private:
|
||||
bw_slew_lim_state *statesP[N_CHANNELS];
|
||||
};
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline SlewLim<N_CHANNELS>::SlewLim() {
|
||||
bw_slew_lim_init(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
statesP[i] = states + i;
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void SlewLim<N_CHANNELS>::setSampleRate(float sampleRate) {
|
||||
bw_slew_lim_set_sample_rate(&coeffs, sampleRate);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void SlewLim<N_CHANNELS>::reset(float y_z1) {
|
||||
bw_slew_lim_reset_coeffs(&coeffs);
|
||||
for (BW_SIZE_T i = 0; i < N_CHANNELS; i++)
|
||||
for (size_t i = 0; i < N_CHANNELS; i++)
|
||||
bw_slew_lim_reset_state(&coeffs, states + i, y_z1);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void SlewLim<N_CHANNELS>::process(
|
||||
std::array<const float *, N_CHANNELS> x,
|
||||
std::array<float *, N_CHANNELS> y,
|
||||
@ -89,23 +89,23 @@ inline void SlewLim<N_CHANNELS>::process(
|
||||
bw_slew_lim_process_multi(&coeffs, statesP, x.data(), y.data(), N_CHANNELS, nSamples);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void SlewLim<N_CHANNELS>::setMaxRate(float value) {
|
||||
bw_slew_lim_set_max_rate(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void SlewLim<N_CHANNELS>::setMaxRateUp(float value) {
|
||||
bw_slew_lim_set_max_rate_up(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
template<size_t N_CHANNELS>
|
||||
inline void SlewLim<N_CHANNELS>::setMaxRateDown(float value) {
|
||||
bw_slew_lim_set_max_rate_down(&coeffs, value);
|
||||
}
|
||||
|
||||
template<BW_SIZE_T N_CHANNELS>
|
||||
inline float SlewLim<N_CHANNELS>::getYZ1(BW_SIZE_T channel) {
|
||||
template<size_t N_CHANNELS>
|
||||
inline float SlewLim<N_CHANNELS>::getYZ1(size_t channel) {
|
||||
return bw_slew_lim_get_y_z1(states + channel);
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user