diff --git a/include/bw_noise_gate.h b/include/bw_noise_gate.h index ea65d61..84c24bd 100644 --- a/include/bw_noise_gate.h +++ b/include/bw_noise_gate.h @@ -29,6 +29,8 @@ *
bw_noise_gate_process()
+ * to bw_noise_gate_process_multi()
.bw_noise_gate_process_multi()
to ensure that
* buffers used for both input and output appear at the same
@@ -616,6 +618,10 @@ static inline void bw_noise_gate_process_multi(
BW_ASSERT_DEEP(coeffs->state >= bw_noise_gate_coeffs_state_reset_coeffs);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(state[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_noise_gate_state_is_valid(coeffs, state[i]));
+ }
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
@@ -623,6 +629,12 @@ static inline void bw_noise_gate_process_multi(
BW_ASSERT(x != BW_NULL);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(x[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
+ BW_ASSERT_DEEP(x_sc != BW_NULL && x_sc[i] != BW_NULL ? bw_has_only_finite(x_sc[i], n_samples) : 1);
+ BW_ASSERT(y[i] != BW_NULL);
+ }
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@@ -651,6 +663,12 @@ static inline void bw_noise_gate_process_multi(
BW_ASSERT_DEEP(bw_noise_gate_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_noise_gate_coeffs_state_reset_coeffs);
+#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT_DEEP(bw_noise_gate_state_is_valid(coeffs, state[i]));
+ BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
+ }
+#endif
}
static inline void bw_noise_gate_set_thresh_lin(
diff --git a/include/bw_notch.h b/include/bw_notch.h
index 35ecafb..e0a4f9f 100644
--- a/include/bw_notch.h
+++ b/include/bw_notch.h
@@ -30,6 +30,8 @@
* bw_notch_process()
to
+ * bw_notch_process_multi()
.bw_notch_process_multi()
* to ensure that buffers used for both input and output appear at
* the same channel indices.bw_one_pole_process()
+ * to bw_one_pole_process_multi()
.bw_one_pole_process_multi()
to ensure that buffers
* used for both input and output appear at the same channel
@@ -903,12 +905,20 @@ static inline void bw_one_pole_process_multi(
BW_ASSERT_DEEP(coeffs->state >= bw_one_pole_coeffs_state_reset_coeffs);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(state[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_one_pole_state_is_valid(coeffs, state[i]));
+ }
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
#endif
BW_ASSERT(x != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(x[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
+ }
if (y != BW_NULL) {
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
@@ -1019,6 +1029,12 @@ static inline void bw_one_pole_process_multi(
BW_ASSERT_DEEP(bw_one_pole_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_one_pole_coeffs_state_reset_coeffs);
+#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT_DEEP(bw_one_pole_state_is_valid(coeffs, state[i]));
+ BW_ASSERT_DEEP(y != BW_NULL && y[i] != BW_NULL ? bw_has_only_finite(y[i], n_samples) : 1);
+ }
+#endif
}
static inline void bw_one_pole_set_cutoff(
diff --git a/include/bw_osc_pulse.h b/include/bw_osc_pulse.h
index 5b06077..ea8d608 100644
--- a/include/bw_osc_pulse.h
+++ b/include/bw_osc_pulse.h
@@ -39,6 +39,8 @@
* bw_osc_pulse_process()
+ * to bw_osc_pulse_process_multi()
.bw_osc_pulse_process_multi()
to ensure that
* x_inc
is not BW_NULL
when antialiasing
@@ -482,6 +484,13 @@ static inline void bw_osc_pulse_process_multi(
BW_ASSERT(coeffs->antialiasing ? x_inc != BW_NULL : 1);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(x[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
+ BW_ASSERT(coeffs->antialiasing ? x_inc[i] != BW_NULL : 1);
+ BW_ASSERT_DEEP(coeffs->antialiasing ? bw_has_only_finite(x_inc[i], n_samples) : 1);
+ BW_ASSERT(y[i] != BW_NULL);
+ }
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@@ -509,6 +518,10 @@ static inline void bw_osc_pulse_process_multi(
BW_ASSERT_DEEP(bw_osc_pulse_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_osc_pulse_coeffs_state_reset_coeffs);
+#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++)
+ BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
+#endif
}
static inline void bw_osc_pulse_set_antialiasing(
diff --git a/include/bw_osc_tri.h b/include/bw_osc_tri.h
index c4e2854..f16aee6 100644
--- a/include/bw_osc_tri.h
+++ b/include/bw_osc_tri.h
@@ -39,6 +39,8 @@
* bw_osc_tri_process()
to
+ * bw_osc_tri_process_multi()
.bw_osc_tri_process_multi()
to ensure that
* x_inc
is not BW_NULL
when antialiasing
@@ -489,6 +491,13 @@ static inline void bw_osc_tri_process_multi(
BW_ASSERT(coeffs->antialiasing ? x_inc != BW_NULL : 1);
BW_ASSERT(y != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(x[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_has_only_finite(x[i], n_samples));
+ BW_ASSERT(coeffs->antialiasing ? x_inc[i] != BW_NULL : 1);
+ BW_ASSERT_DEEP(coeffs->antialiasing ? bw_has_only_finite(x_inc[i], n_samples) : 1);
+ BW_ASSERT(y[i] != BW_NULL);
+ }
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(y[i] != y[j]);
@@ -516,6 +525,10 @@ static inline void bw_osc_tri_process_multi(
BW_ASSERT_DEEP(bw_osc_tri_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_osc_tri_coeffs_state_reset_coeffs);
+#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++)
+ BW_ASSERT_DEEP(bw_has_only_finite(y[i], n_samples));
+#endif
}
static inline void bw_osc_tri_set_antialiasing(
diff --git a/include/bw_pan.h b/include/bw_pan.h
index a6dd3ad..60dc11e 100644
--- a/include/bw_pan.h
+++ b/include/bw_pan.h
@@ -29,6 +29,8 @@
* bw_pan_process()
to
+ * bw_pan_process_multi()
.bw_pan_process_multi()
to
* ensure that buffers used for both input and output appear at the
* same channel indices.bw_peak_process()
to
+ * bw_peak_process_multi()
.bw_peak_process_multi()
* to ensure that buffers used for both input and output appear at
* the same channel indices.bw_phase_gen_process()
+ * to bw_phase_gen_process_multi()
.bw_phase_reset_state()
to
* ensure that phase_0
is in [0.f
,
* 1.f
) and indicated such range in the
@@ -756,9 +758,16 @@ static inline void bw_phase_gen_process_multi(
BW_ASSERT_DEEP(coeffs->phase_inc_min < coeffs->phase_inc_max);
BW_ASSERT(state != BW_NULL);
#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT(state[i] != BW_NULL);
+ BW_ASSERT_DEEP(bw_phase_gen_state_is_valid(coeffs, state[i]));
+ }
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
BW_ASSERT(state[i] != state[j]);
+ if (x_mod != BW_NULL)
+ for (size_t i = 0; i < n_channels; i++)
+ BW_ASSERT_DEEP(x_mod[i] != BW_NULL ? bw_has_only_finite(x_mod[i], n_samples) : 1);
if (y != BW_NULL)
for (size_t i = 0; i < n_channels; i++)
for (size_t j = i + 1; j < n_channels; j++)
@@ -888,6 +897,13 @@ static inline void bw_phase_gen_process_multi(
BW_ASSERT_DEEP(bw_phase_gen_coeffs_is_valid(coeffs));
BW_ASSERT_DEEP(coeffs->state >= bw_phase_gen_coeffs_state_reset_coeffs);
+#ifndef BW_NO_DEBUG
+ for (size_t i = 0; i < n_channels; i++) {
+ BW_ASSERT_DEEP(bw_phase_gen_state_is_valid(coeffs, state[i]));
+ BW_ASSERT_DEEP(y != BW_NULL && y[i] != BW_NULL ? bw_has_only_finite(y[i], n_samples) : 1);
+ BW_ASSERT_DEEP(y_inc != BW_NULL && y_inc[i] != BW_NULL ? bw_has_only_finite(y_inc[i], n_samples) : 1);
+ }
+#endif
}
static inline void bw_phase_gen_set_frequency(