introduce BW_{INCLUDE_WITH_QUOTES,NO_CXX,CXX_NO_EXTERN_C}

This commit is contained in:
Stefano D'Angelo 2024-09-21 12:45:00 +02:00
parent 324aa911fd
commit daf0cb3e1c
56 changed files with 2040 additions and 1202 deletions

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_lp1 bw_math bw_one_pole }}} * requires {{{ bw_common bw_lp1 bw_math bw_one_pole }}}
* description {{{ * description {{{
* First-order allpass filter (90° shift at cutoff, approaching 180° shift * First-order allpass filter (90° shift at cutoff, approaching 180° shift
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_ap1_process()</code> to * <li>Added debugging checks from <code>bw_ap1_process()</code> to
* <code>bw_ap1_process_multi()</code>.</li> * <code>bw_ap1_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_ap1_process_multi()</code> to * <li>Added debugging checks in <code>bw_ap1_process_multi()</code> to
@ -95,9 +98,13 @@
#ifndef BW_AP1_H #ifndef BW_AP1_H
#define BW_AP1_H #define BW_AP1_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -285,7 +292,7 @@ static inline char bw_ap1_state_is_valid(
* than or equal to that of `bw_ap1_state`. * than or equal to that of `bw_ap1_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -294,9 +301,13 @@ static inline char bw_ap1_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_lp1.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_lp1.h"
#else
# include <bw_lp1.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -631,13 +642,16 @@ static inline char bw_ap1_state_is_valid(
return bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state); return bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -657,33 +671,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -735,14 +749,14 @@ inline void AP1<N_CHANNELS>::reset(
bw_ap1_reset_state(&coeffs, states + i, x0); bw_ap1_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP1<N_CHANNELS>::reset( inline void AP1<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP1<N_CHANNELS>::reset( inline void AP1<N_CHANNELS>::reset(
@ -752,14 +766,14 @@ inline void AP1<N_CHANNELS>::reset(
bw_ap1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_ap1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP1<N_CHANNELS>::reset( inline void AP1<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP1<N_CHANNELS>::process( inline void AP1<N_CHANNELS>::process(
@ -769,7 +783,7 @@ inline void AP1<N_CHANNELS>::process(
bw_ap1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_ap1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP1<N_CHANNELS>::process( inline void AP1<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -777,7 +791,7 @@ inline void AP1<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP1<N_CHANNELS>::setCutoff( inline void AP1<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole bw_svf }}} * requires {{{ bw_common bw_math bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Second-order allpass filter (180° shift at cutoff, approaching 360° shift * Second-order allpass filter (180° shift at cutoff, approaching 360° shift
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_ap2_process()</code> to * <li>Added debugging checks from <code>bw_ap2_process()</code> to
* <code>bw_ap2_process_multi()</code>.</li> * <code>bw_ap2_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_ap2_process_multi()</code> to * <li>Added debugging checks in <code>bw_ap2_process_multi()</code> to
@ -94,9 +97,13 @@
#ifndef BW_AP2_H #ifndef BW_AP2_H
#define BW_AP2_H #define BW_AP2_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -294,7 +301,7 @@ static inline char bw_ap2_state_is_valid(
* than or equal to that of `bw_ap2_state`. * than or equal to that of `bw_ap2_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -303,9 +310,13 @@ static inline char bw_ap2_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_svf.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_svf.h"
#else
# include <bw_svf.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -659,13 +670,16 @@ static inline char bw_ap2_state_is_valid(
return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state); return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -685,33 +699,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -766,14 +780,14 @@ inline void AP2<N_CHANNELS>::reset(
bw_ap2_reset_state(&coeffs, states + i, x0); bw_ap2_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP2<N_CHANNELS>::reset( inline void AP2<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP2<N_CHANNELS>::reset( inline void AP2<N_CHANNELS>::reset(
@ -783,14 +797,14 @@ inline void AP2<N_CHANNELS>::reset(
bw_ap2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_ap2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP2<N_CHANNELS>::reset( inline void AP2<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP2<N_CHANNELS>::process( inline void AP2<N_CHANNELS>::process(
@ -800,7 +814,7 @@ inline void AP2<N_CHANNELS>::process(
bw_ap2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_ap2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP2<N_CHANNELS>::process( inline void AP2<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -808,7 +822,7 @@ inline void AP2<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void AP2<N_CHANNELS>::setCutoff( inline void AP2<N_CHANNELS>::setCutoff(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_one_pole }}} * requires {{{ bw_common bw_gain bw_math bw_one_pole }}}
* description {{{ * description {{{
* Stereo balance. * Stereo balance.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_balance_process()</code> to * <li>Added debugging checks from <code>bw_balance_process()</code> to
* <code>bw_balance_process_multi()</code>.</li> * <code>bw_balance_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -84,9 +87,13 @@
#ifndef BW_BALANCE_H #ifndef BW_BALANCE_H
#define BW_BALANCE_H #define BW_BALANCE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -203,7 +210,7 @@ static inline char bw_balance_coeffs_is_valid(
* than or equal to that of `bw_balance_coeffs`. * than or equal to that of `bw_balance_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -212,10 +219,15 @@ static inline char bw_balance_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_gain.h> # include "bw_math.h"
# include "bw_gain.h"
#else
# include <bw_math.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -482,13 +494,16 @@ static inline char bw_balance_coeffs_is_valid(
return bw_gain_coeffs_is_valid(&coeffs->l_coeffs) && bw_gain_coeffs_is_valid(&coeffs->r_coeffs); return bw_gain_coeffs_is_valid(&coeffs->l_coeffs) && bw_gain_coeffs_is_valid(&coeffs->r_coeffs);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -513,14 +528,14 @@ public:
float * const * yR, float * const * yR,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> xL, std::array<const float *, N_CHANNELS> xL,
std::array<const float *, N_CHANNELS> xR, std::array<const float *, N_CHANNELS> xR,
std::array<float *, N_CHANNELS> yL, std::array<float *, N_CHANNELS> yL,
std::array<float *, N_CHANNELS> yR, std::array<float *, N_CHANNELS> yR,
size_t nSamples); size_t nSamples);
#endif # endif
void setBalance( void setBalance(
float value); float value);
@ -564,7 +579,7 @@ inline void Balance<N_CHANNELS>::process(
bw_balance_process_multi(&coeffs, xL, xR, yL, yR, N_CHANNELS, nSamples); bw_balance_process_multi(&coeffs, xL, xR, yL, yR, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Balance<N_CHANNELS>::process( inline void Balance<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> xL, std::array<const float *, N_CHANNELS> xL,
@ -574,7 +589,7 @@ inline void Balance<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(xL.data(), xR.data(), yL.data(), yR.data(), nSamples); process(xL.data(), xR.data(), yL.data(), yR.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Balance<N_CHANNELS>::setBalance( inline void Balance<N_CHANNELS>::setBalance(

View File

@ -34,6 +34,9 @@
* <li>Version <strong>1.2.0</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added gate parameter.</li> * <li>Added gate parameter.</li>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_bd_reduce_process()</code> * <li>Added debugging checks from <code>bw_bd_reduce_process()</code>
* to <code>bw_bd_reduce_process_multi()</code>.</li> * to <code>bw_bd_reduce_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -93,9 +96,13 @@
#ifndef BW_BD_REDUCE_H #ifndef BW_BD_REDUCE_H
#define BW_BD_REDUCE_H #define BW_BD_REDUCE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -236,7 +243,7 @@ static inline char bw_bd_reduce_coeffs_is_valid(
* than or equal to that of `bw_bd_reduce_coeffs`. * than or equal to that of `bw_bd_reduce_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -245,9 +252,13 @@ static inline char bw_bd_reduce_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -527,13 +538,16 @@ static inline char bw_bd_reduce_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -556,12 +570,12 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setBitDepth( void setBitDepth(
char value); char value);
@ -612,7 +626,7 @@ inline void BDReduce<N_CHANNELS>::process(
bw_bd_reduce_process_multi(&coeffs, x, y, N_CHANNELS, nSamples); bw_bd_reduce_process_multi(&coeffs, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void BDReduce<N_CHANNELS>::process( inline void BDReduce<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -620,7 +634,7 @@ inline void BDReduce<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void BDReduce<N_CHANNELS>::setBitDepth( inline void BDReduce<N_CHANNELS>::setBitDepth(

View File

@ -31,6 +31,9 @@
* <ul> * <ul>
* <li>Added <code>bw_buf_copy()</code> and * <li>Added <code>bw_buf_copy()</code> and
* <code>bw_buf_copy_multi()</code>.</li> * <code>bw_buf_copy_multi()</code>.</li>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging check in * <li>Added debugging check in
* <code>bw_buf_{neg,add,scale,mix,mul}_multi()</code> to ensure * <code>bw_buf_{neg,add,scale,mix,mul}_multi()</code> to ensure
* that buffers used for both input and output appear at the same * that buffers used for both input and output appear at the same
@ -90,9 +93,13 @@
#ifndef BW_BUF_H #ifndef BW_BUF_H
#define BW_BUF_H #define BW_BUF_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -258,7 +265,7 @@ static inline void bw_buf_mul_multi(
* `n_channels` buffers `dest`. * `n_channels` buffers `dest`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -267,7 +274,7 @@ static inline void bw_buf_mul_multi(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -527,13 +534,16 @@ static inline void bw_buf_mul_multi(
bw_buf_mul(src1[i], src2[i], dest[i], n_elems); bw_buf_mul(src1[i], src2[i], dest[i], n_elems);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -547,13 +557,13 @@ inline void bufFill(
float * BW_RESTRICT const * BW_RESTRICT dest, float * BW_RESTRICT const * BW_RESTRICT dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufFill( inline void bufFill(
float k, float k,
std::array<float * BW_RESTRICT, N_CHANNELS> dest, std::array<float * BW_RESTRICT, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* *
* ##### Brickworks::bufCopy * ##### Brickworks::bufCopy
@ -564,13 +574,13 @@ inline void bufCopy(
float * const * dest, float * const * dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufCopy( inline void bufCopy(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
const std::array<float *, N_CHANNELS> dest, const std::array<float *, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* *
* ##### Brickworks::bufNeg * ##### Brickworks::bufNeg
@ -581,13 +591,13 @@ inline void bufNeg(
float * const * dest, float * const * dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufNeg( inline void bufNeg(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
const std::array<float *, N_CHANNELS> dest, const std::array<float *, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* *
* ##### Brickworks::bufAdd * ##### Brickworks::bufAdd
@ -599,14 +609,14 @@ inline void bufAdd(
float * const * dest, float * const * dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufAdd( inline void bufAdd(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
float k, float k,
const std::array<float *, N_CHANNELS> dest, const std::array<float *, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* *
* ##### Brickworks::bufScale * ##### Brickworks::bufScale
@ -618,14 +628,14 @@ inline void bufScale(
float * const * dest, float * const * dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufScale( inline void bufScale(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
float k, float k,
const std::array<float *, N_CHANNELS> dest, const std::array<float *, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* *
* ##### Brickworks::bufMix * ##### Brickworks::bufMix
@ -637,14 +647,14 @@ inline void bufMix(
float * const * dest, float * const * dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufMix( inline void bufMix(
const std::array<const float *, N_CHANNELS> src1, const std::array<const float *, N_CHANNELS> src1,
const std::array<const float *, N_CHANNELS> src2, const std::array<const float *, N_CHANNELS> src2,
const std::array<float *, N_CHANNELS> dest, const std::array<float *, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* *
* ##### Brickworks::bufMul * ##### Brickworks::bufMul
@ -656,14 +666,14 @@ inline void bufMul(
float * const * dest, float * const * dest,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufMul( inline void bufMul(
const std::array<const float *, N_CHANNELS> src1, const std::array<const float *, N_CHANNELS> src1,
const std::array<const float *, N_CHANNELS> src2, const std::array<const float *, N_CHANNELS> src2,
const std::array<float *, N_CHANNELS> dest, const std::array<float *, N_CHANNELS> dest,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* }}} */ * }}} */
@ -680,7 +690,7 @@ inline void bufFill(
bw_buf_fill_multi(k, dest, N_CHANNELS, nSamples); bw_buf_fill_multi(k, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufFill( inline void bufFill(
float k, float k,
@ -688,7 +698,7 @@ inline void bufFill(
size_t nSamples) { size_t nSamples) {
bufFill<N_CHANNELS>(k, dest.data(), nSamples); bufFill<N_CHANNELS>(k, dest.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufCopy( inline void bufCopy(
@ -698,7 +708,7 @@ inline void bufCopy(
bw_buf_copy_multi(src, dest, N_CHANNELS, nSamples); bw_buf_copy_multi(src, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufCopy( inline void bufCopy(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
@ -706,7 +716,7 @@ inline void bufCopy(
size_t nSamples) { size_t nSamples) {
bufCopy<N_CHANNELS>(src.data(), dest.data(), nSamples); bufCopy<N_CHANNELS>(src.data(), dest.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufNeg( inline void bufNeg(
@ -716,7 +726,7 @@ inline void bufNeg(
bw_buf_neg_multi(src, dest, N_CHANNELS, nSamples); bw_buf_neg_multi(src, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufNeg( inline void bufNeg(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
@ -724,7 +734,7 @@ inline void bufNeg(
size_t nSamples) { size_t nSamples) {
bufNeg<N_CHANNELS>(src.data(), dest.data(), nSamples); bufNeg<N_CHANNELS>(src.data(), dest.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufAdd( inline void bufAdd(
@ -735,7 +745,7 @@ inline void bufAdd(
bw_buf_add_multi(src, k, dest, N_CHANNELS, nSamples); bw_buf_add_multi(src, k, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufAdd( inline void bufAdd(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
@ -744,7 +754,7 @@ inline void bufAdd(
size_t nSamples) { size_t nSamples) {
bufAdd<N_CHANNELS>(src.data(), k, dest.data(), nSamples); bufAdd<N_CHANNELS>(src.data(), k, dest.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufScale( inline void bufScale(
@ -755,7 +765,7 @@ inline void bufScale(
bw_buf_scale_multi(src, k, dest, N_CHANNELS, nSamples); bw_buf_scale_multi(src, k, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufScale( inline void bufScale(
const std::array<const float *, N_CHANNELS> src, const std::array<const float *, N_CHANNELS> src,
@ -764,7 +774,7 @@ inline void bufScale(
size_t nSamples) { size_t nSamples) {
bufScale<N_CHANNELS>(src.data(), k, dest.data(), nSamples); bufScale<N_CHANNELS>(src.data(), k, dest.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufMix( inline void bufMix(
@ -775,7 +785,7 @@ inline void bufMix(
bw_buf_mix_multi(src1, src2, dest, N_CHANNELS, nSamples); bw_buf_mix_multi(src1, src2, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufMix( inline void bufMix(
const std::array<const float *, N_CHANNELS> src1, const std::array<const float *, N_CHANNELS> src1,
@ -784,7 +794,7 @@ inline void bufMix(
size_t nSamples) { size_t nSamples) {
bufMix<N_CHANNELS>(src1.data(), src2.data(), dest.data(), nSamples); bufMix<N_CHANNELS>(src1.data(), src2.data(), dest.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufMul( inline void bufMul(
@ -795,7 +805,7 @@ inline void bufMul(
bw_buf_mul_multi(src1, src2, dest, N_CHANNELS, nSamples); bw_buf_mul_multi(src1, src2, dest, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void bufMul( inline void bufMul(
const std::array<const float *, N_CHANNELS> src1, const std::array<const float *, N_CHANNELS> src1,
@ -804,7 +814,7 @@ inline void bufMul(
size_t nSamples) { size_t nSamples) {
bufMul<N_CHANNELS>(src1.data(), src2.data(), dest.data(), nSamples); bufMul<N_CHANNELS>(src1.data(), src2.data(), dest.data(), nSamples);
} }
#endif # endif
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.0.1 }}} * version {{{ 1.1.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_one_pole bw_svf }}} * requires {{{ bw_common bw_gain bw_math bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Cab simulator effect. * Cab simulator effect.
@ -30,8 +30,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.0.1</strong>: * <li>Version <strong>1.1.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_cab_process()</code> to * <li>Added debugging checks from <code>bw_cab_process()</code> to
* <code>bw_cab_process_multi()</code>.</li> * <code>bw_cab_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_cab_process_multi()</code> to * <li>Added debugging checks in <code>bw_cab_process_multi()</code> to
@ -51,9 +54,13 @@
#ifndef BW_CAB_H #ifndef BW_CAB_H
#define BW_CAB_H #define BW_CAB_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -238,7 +245,7 @@ static inline char bw_cab_state_is_valid(
* than or equal to that of `bw_cab_state`. * than or equal to that of `bw_cab_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -247,10 +254,15 @@ static inline char bw_cab_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_svf.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_gain.h> # include "bw_svf.h"
# include "bw_gain.h"
#else
# include <bw_svf.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -656,13 +668,16 @@ static inline char bw_cab_state_is_valid(
&& bw_svf_state_is_valid(coeffs ? &coeffs->bph_coeffs : BW_NULL, &state->bph_state); && bw_svf_state_is_valid(coeffs ? &coeffs->bph_coeffs : BW_NULL, &state->bph_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -682,33 +697,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoffLow( void setCutoffLow(
float value); float value);
@ -760,14 +775,14 @@ inline void Cab<N_CHANNELS>::reset(
bw_cab_reset_state(&coeffs, states + i, x0); bw_cab_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Cab<N_CHANNELS>::reset( inline void Cab<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Cab<N_CHANNELS>::reset( inline void Cab<N_CHANNELS>::reset(
@ -777,14 +792,14 @@ inline void Cab<N_CHANNELS>::reset(
bw_cab_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_cab_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Cab<N_CHANNELS>::reset( inline void Cab<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Cab<N_CHANNELS>::process( inline void Cab<N_CHANNELS>::process(
@ -794,7 +809,7 @@ inline void Cab<N_CHANNELS>::process(
bw_cab_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_cab_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Cab<N_CHANNELS>::process( inline void Cab<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -802,7 +817,7 @@ inline void Cab<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Cab<N_CHANNELS>::setCutoffLow( inline void Cab<N_CHANNELS>::setCutoffLow(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_buf bw_comb bw_common bw_delay bw_gain bw_math bw_one_pole bw_osc_sin * bw_buf bw_comb bw_common bw_delay bw_gain bw_math bw_one_pole bw_osc_sin
* bw_phase_gen * bw_phase_gen
@ -36,8 +36,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_chorus_process()</code> to * <li>Added debugging checks from <code>bw_chorus_process()</code> to
* <code>bw_chorus_process_multi()</code>.</li> * <code>bw_chorus_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_chorus_process_multi()</code> * <li>Added debugging checks in <code>bw_chorus_process_multi()</code>
@ -101,9 +104,13 @@
#ifndef BW_CHORUS_H #ifndef BW_CHORUS_H
#define BW_CHORUS_H #define BW_CHORUS_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -357,7 +364,7 @@ static inline char bw_chorus_state_is_valid(
* than or equal to that of `bw_chorus_state`. * than or equal to that of `bw_chorus_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -366,11 +373,17 @@ static inline char bw_chorus_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_phase_gen.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_osc_sin.h> # include "bw_phase_gen.h"
#include <bw_comb.h> # include "bw_osc_sin.h"
# include "bw_comb.h"
#else
# include <bw_phase_gen.h>
# include <bw_osc_sin.h>
# include <bw_comb.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -832,13 +845,16 @@ static inline char bw_chorus_state_is_valid(
return bw_comb_state_is_valid(coeffs ? &coeffs->comb_coeffs : BW_NULL, &state->comb_state); return bw_comb_state_is_valid(coeffs ? &coeffs->comb_coeffs : BW_NULL, &state->comb_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -861,33 +877,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setRate( void setRate(
float value); float value);
@ -964,14 +980,14 @@ inline void Chorus<N_CHANNELS>::reset(
bw_chorus_reset_state(&coeffs, states + i, x0); bw_chorus_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Chorus<N_CHANNELS>::reset( inline void Chorus<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Chorus<N_CHANNELS>::reset( inline void Chorus<N_CHANNELS>::reset(
@ -981,14 +997,14 @@ inline void Chorus<N_CHANNELS>::reset(
bw_chorus_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_chorus_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Chorus<N_CHANNELS>::reset( inline void Chorus<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Chorus<N_CHANNELS>::process( inline void Chorus<N_CHANNELS>::process(
@ -998,7 +1014,7 @@ inline void Chorus<N_CHANNELS>::process(
bw_chorus_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_chorus_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Chorus<N_CHANNELS>::process( inline void Chorus<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1006,7 +1022,7 @@ inline void Chorus<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Chorus<N_CHANNELS>::setRate( inline void Chorus<N_CHANNELS>::setRate(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Antialiased hard clipper with parametric bias and gain * Antialiased hard clipper with parametric bias and gain
@ -45,8 +45,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_clip_process()</code> to * <li>Added debugging checks from <code>bw_clip_process()</code> to
* <code>bw_clip_process_multi()</code>.</li> * <code>bw_clip_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_clip_process_multi()</code> * <li>Added debugging checks in <code>bw_clip_process_multi()</code>
@ -101,9 +104,13 @@
#ifndef BW_CLIP_H #ifndef BW_CLIP_H
#define BW_CLIP_H #define BW_CLIP_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -297,7 +304,7 @@ static inline char bw_clip_state_is_valid(
* than or equal to that of `bw_clip_state`. * than or equal to that of `bw_clip_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -306,10 +313,15 @@ static inline char bw_clip_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -743,13 +755,16 @@ static inline char bw_clip_state_is_valid(
return bw_is_finite(state->x_z1) && bw_is_finite(state->F_z1); return bw_is_finite(state->x_z1) && bw_is_finite(state->F_z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -769,33 +784,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setBias( void setBias(
float value); float value);
@ -847,14 +862,14 @@ inline void Clip<N_CHANNELS>::reset(
bw_clip_reset_state(&coeffs, states + i, x0); bw_clip_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Clip<N_CHANNELS>::reset( inline void Clip<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Clip<N_CHANNELS>::reset( inline void Clip<N_CHANNELS>::reset(
@ -864,14 +879,14 @@ inline void Clip<N_CHANNELS>::reset(
bw_clip_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_clip_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Clip<N_CHANNELS>::reset( inline void Clip<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Clip<N_CHANNELS>::process( inline void Clip<N_CHANNELS>::process(
@ -881,7 +896,7 @@ inline void Clip<N_CHANNELS>::process(
bw_clip_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_clip_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Clip<N_CHANNELS>::process( inline void Clip<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -889,7 +904,7 @@ inline void Clip<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Clip<N_CHANNELS>::setBias( inline void Clip<N_CHANNELS>::setBias(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_buf bw_common bw_delay bw_gain bw_math bw_one_pole * bw_buf bw_common bw_delay bw_gain bw_math bw_one_pole
* }}} * }}}
@ -37,8 +37,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_comb_process()</code> to * <li>Added debugging checks from <code>bw_comb_process()</code> to
* <code>bw_comb_process_multi()</code>.</li> * <code>bw_comb_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_comb_process_multi()</code> * <li>Added debugging checks in <code>bw_comb_process_multi()</code>
@ -102,9 +105,13 @@
#ifndef BW_COMB_H #ifndef BW_COMB_H
#define BW_COMB_H #define BW_COMB_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -344,7 +351,7 @@ static inline char bw_comb_state_is_valid(
* than or equal to that of `bw_comb_state`. * than or equal to that of `bw_comb_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -353,12 +360,19 @@ static inline char bw_comb_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_delay.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_gain.h> # include "bw_delay.h"
#include <bw_one_pole.h> # include "bw_gain.h"
#include <bw_math.h> # include "bw_one_pole.h"
# include "bw_math.h"
#else
# include <bw_delay.h>
# include <bw_gain.h>
# include <bw_one_pole.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -899,13 +913,16 @@ static inline char bw_comb_state_is_valid(
return bw_delay_state_is_valid(coeffs ? &coeffs->delay_coeffs : BW_NULL, &state->delay_state); return bw_delay_state_is_valid(coeffs ? &coeffs->delay_coeffs : BW_NULL, &state->delay_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -928,33 +945,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setDelayFF( void setDelayFF(
float value); float value);
@ -1028,14 +1045,14 @@ inline void Comb<N_CHANNELS>::reset(
bw_comb_reset_state(&coeffs, states + i, x0); bw_comb_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comb<N_CHANNELS>::reset( inline void Comb<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comb<N_CHANNELS>::reset( inline void Comb<N_CHANNELS>::reset(
@ -1045,14 +1062,14 @@ inline void Comb<N_CHANNELS>::reset(
bw_comb_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_comb_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comb<N_CHANNELS>::reset( inline void Comb<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comb<N_CHANNELS>::process( inline void Comb<N_CHANNELS>::process(
@ -1062,7 +1079,7 @@ inline void Comb<N_CHANNELS>::process(
bw_comb_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_comb_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comb<N_CHANNELS>::process( inline void Comb<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1070,7 +1087,7 @@ inline void Comb<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comb<N_CHANNELS>::setDelayFF( inline void Comb<N_CHANNELS>::setDelayFF(

View File

@ -20,15 +20,19 @@
/*! /*!
* module_type {{{ foundation }}} * module_type {{{ foundation }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* description {{{ * description {{{
* A common header to make sure that a bunch of basic definitions are * A common header to make sure that a bunch of basic definitions are
* available and consistent for all Brickworks modules. * available and consistent for all Brickworks modules.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Allowed custom definitions of <code>BW_NULL</code>.</li>
* <li>Accomodate MSVC reporting incorrect C++ standard support.</li> * <li>Accomodate MSVC reporting incorrect C++ standard support.</li>
* </ul> * </ul>
* <li>Version <strong>1.1.0</strong>: * <li>Version <strong>1.1.0</strong>:
@ -98,17 +102,37 @@
/*** Public API ***/ /*** Public API ***/
#ifdef __cplusplus
# if __cplusplus < 201103L
# if _MSC_VER
# pragma message("Detected MSVC compiler reporting not to support C++11. Please use /Zc:__cplusplus if possible, or otherwise ignore this message if everything works for you. See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ for more information.")
# else
# error Detected C++ compiler that does not support C++11
# endif
# endif
#endif
/*! api {{{ /*! api {{{
*
* #### BW_INCLUDE_WITH_QUOTES
*
* Normally Brickworks modules include other such modules using angle
* brackets.
*
* If you would rather prefer that to happen using double quotes, you can
* define `BW_INCLUDE_WITH_QUOTES`.
*
* #### BW_NO_CXX
*
* If `BW_NO_CXX` is defined, the C++ APIs and implementations in Brickworks
* modules are not included.
*
* #### BW_CXX_NO_EXTERN_C
*
* Normally, the C APIs and implementations in Brickworks modules are
* included in <code>extern "C"</code> blocks when using a C++ compiler, even
* if <code>BW_NO_CXX</code> is defined.
*
* If you don't want to have them included in such blocks, you can define
* `BW_CXX_NO_EXTERN_C`.
*
* #### BW_CXX_NO_ARRAY
*
* C++ APIs of Brickworks modules typically include overloaded methods that
* use `std::array` arguments, and thus require the `<array>` header file.
*
* If this is not wanted, defining `BW_CXX_NO_ARRAY` suppresses such methods
* and the inclusion of said header file.
* *
* #### Basic definitions * #### Basic definitions
* *
@ -129,20 +153,32 @@
* * if `BW_NO_STDLIB` or `BW_NO_MATH_H` is defined, then `math.h` is not * * if `BW_NO_STDLIB` or `BW_NO_MATH_H` is defined, then `math.h` is not
* `#include`d. * `#include`d.
* *
* A `BW_NULL` macro is defined whose value is either `NULL` (C) or `nullptr` * If not already defined, a `BW_NULL` macro is defined whose value is either
* (C++). * `NULL` (C or C++ disabled) or `nullptr` (C++).
* >>> */ * >>> */
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# if __cplusplus < 201103L
# if _MSC_VER
# pragma message("Detected MSVC compiler reporting not to support C++11. Please use /Zc:__cplusplus if possible, or otherwise ignore this message if everything works for you. See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ for more information.")
# else
# error Detected C++ compiler that does not support C++11
# endif
# endif
#endif
#if !defined(BW_NO_STDLIB) && !defined(BW_NO_STDDEF_H) #if !defined(BW_NO_STDLIB) && !defined(BW_NO_STDDEF_H)
# include <stddef.h> # include <stddef.h>
#endif #endif
#ifdef __cplusplus #ifndef BW_NULL
# define BW_NULL nullptr # if !defined(BW_NO_CXX) && defined(__cplusplus)
#else # define BW_NULL nullptr
# ifndef NULL # else
# error NULL not defined # ifndef NULL
# error NULL not defined
# endif
# define BW_NULL NULL
# endif # endif
# define BW_NULL NULL
#endif #endif
#if !defined(BW_NO_STDLIB) && !defined(BW_NO_STDINT_H) #if !defined(BW_NO_STDLIB) && !defined(BW_NO_STDINT_H)
@ -166,14 +202,6 @@
# error INFINITY not defined # error INFINITY not defined
#endif #endif
/*! ... /*! ...
*
* #### BW_CXX_NO_ARRAY
*
* C++ APIs of Brickworks modules typically include overloaded methods that
* use `std::array` arguments, and thus require the `<array>` header file.
*
* If this is not wanted, defining `BW_CXX_NO_ARRAY` suppresses such methods
* and the inclusion of said header file.
* *
* #### BW_RESTRICT * #### BW_RESTRICT
* *
@ -238,7 +266,7 @@
# endif # endif
#endif #endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -302,7 +330,7 @@ static inline uint32_t bw_hash_sdbm(
* Returns the sdbm hash of the given `string`. * Returns the sdbm hash of the given `string`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -311,7 +339,7 @@ static inline uint32_t bw_hash_sdbm(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -371,7 +399,7 @@ static inline uint32_t bw_hash_sdbm(
return hash; return hash;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_common bw_env_follow bw_gain bw_math bw_one_pole * bw_common bw_env_follow bw_gain bw_math bw_one_pole
* }}} * }}}
@ -29,8 +29,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_comp_process()</code> to * <li>Added debugging checks from <code>bw_comp_process()</code> to
* <code>bw_comp_process_multi()</code>.</li> * <code>bw_comp_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_comp_process_multi()</code> * <li>Added debugging checks in <code>bw_comp_process_multi()</code>
@ -103,9 +106,13 @@
#ifndef BW_COMP_H #ifndef BW_COMP_H
#define BW_COMP_H #define BW_COMP_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -357,7 +364,7 @@ static inline char bw_comp_state_is_valid(
* than or equal to that of `bw_comp_state`. * than or equal to that of `bw_comp_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -366,12 +373,19 @@ static inline char bw_comp_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_env_follow.h> # include "bw_math.h"
#include <bw_gain.h> # include "bw_env_follow.h"
#include <bw_one_pole.h> # include "bw_gain.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_env_follow.h>
# include <bw_gain.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -867,13 +881,16 @@ static inline char bw_comp_state_is_valid(
return bw_env_follow_state_is_valid(coeffs ? &coeffs->env_follow_coeffs : BW_NULL, &state->env_follow_state); return bw_env_follow_state_is_valid(coeffs ? &coeffs->env_follow_coeffs : BW_NULL, &state->env_follow_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -894,24 +911,24 @@ public:
float xSc0 = 0.f, float xSc0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
float xSc0, float xSc0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
const float * xSc0, const float * xSc0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> xSc0, std::array<float, N_CHANNELS> xSc0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
@ -919,13 +936,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<const float *, N_CHANNELS> xSc, std::array<const float *, N_CHANNELS> xSc,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
// >> the following 2 methods only exist because of a typo, don't use // >> the following 2 methods only exist because of a typo, don't use
void setTreshLin( void setTreshLin(
@ -998,7 +1015,7 @@ inline void Comp<N_CHANNELS>::reset(
bw_comp_reset_state(&coeffs, states + i, x0, xSc0); bw_comp_reset_state(&coeffs, states + i, x0, xSc0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comp<N_CHANNELS>::reset( inline void Comp<N_CHANNELS>::reset(
float x0, float x0,
@ -1006,7 +1023,7 @@ inline void Comp<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, xSc0, y0 != nullptr ? y0->data() : nullptr); reset(x0, xSc0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comp<N_CHANNELS>::reset( inline void Comp<N_CHANNELS>::reset(
@ -1017,7 +1034,7 @@ inline void Comp<N_CHANNELS>::reset(
bw_comp_reset_state_multi(&coeffs, statesP, x0, xSc0, y0, N_CHANNELS); bw_comp_reset_state_multi(&coeffs, statesP, x0, xSc0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comp<N_CHANNELS>::reset( inline void Comp<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
@ -1025,7 +1042,7 @@ inline void Comp<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), xSc0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), xSc0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comp<N_CHANNELS>::process( inline void Comp<N_CHANNELS>::process(
@ -1036,7 +1053,7 @@ inline void Comp<N_CHANNELS>::process(
bw_comp_process_multi(&coeffs, statesP, x, xSc, y, N_CHANNELS, nSamples); bw_comp_process_multi(&coeffs, statesP, x, xSc, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comp<N_CHANNELS>::process( inline void Comp<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1045,7 +1062,7 @@ inline void Comp<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), xSc.data(), y.data(), nSamples); process(x.data(), xSc.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Comp<N_CHANNELS>::setTreshLin( inline void Comp<N_CHANNELS>::setTreshLin(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_buf bw_common bw_math }}} * requires {{{ bw_buf bw_common bw_math }}}
* description {{{ * description {{{
* Interpolated delay line, not smoothed. * Interpolated delay line, not smoothed.
@ -31,8 +31,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_delay_process()</code> to * <li>Added debugging checks from <code>bw_delay_process()</code> to
* <code>bw_delay_process_multi()</code>.</li> * <code>bw_delay_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_delay_process_multi()</code> * <li>Added debugging checks in <code>bw_delay_process_multi()</code>
@ -97,9 +100,13 @@
#ifndef BW_DELAY_H #ifndef BW_DELAY_H
#define BW_DELAY_H #define BW_DELAY_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -314,7 +321,7 @@ static inline char bw_delay_state_is_valid(
* than or equal to that of `bw_delay_state`. * than or equal to that of `bw_delay_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -323,10 +330,15 @@ static inline char bw_delay_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_buf.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_math.h> # include "bw_buf.h"
# include "bw_math.h"
#else
# include <bw_buf.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -798,13 +810,16 @@ static inline char bw_delay_state_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -827,33 +842,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setDelay( void setDelay(
float value); float value);
@ -916,14 +931,14 @@ inline void Delay<N_CHANNELS>::reset(
bw_delay_reset_state(&coeffs, states + i, x0); bw_delay_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Delay<N_CHANNELS>::reset( inline void Delay<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Delay<N_CHANNELS>::reset( inline void Delay<N_CHANNELS>::reset(
@ -933,14 +948,14 @@ inline void Delay<N_CHANNELS>::reset(
bw_delay_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_delay_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Delay<N_CHANNELS>::reset( inline void Delay<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Delay<N_CHANNELS>::process( inline void Delay<N_CHANNELS>::process(
@ -950,7 +965,7 @@ inline void Delay<N_CHANNELS>::process(
bw_delay_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_delay_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Delay<N_CHANNELS>::process( inline void Delay<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -958,7 +973,7 @@ inline void Delay<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Delay<N_CHANNELS>::setDelay( inline void Delay<N_CHANNELS>::setDelay(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_clip bw_common bw_gain bw_hp1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak * bw_clip bw_common bw_gain bw_hp1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak
* bw_satur bw_svf * bw_satur bw_svf
@ -32,8 +32,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_dist_process()</code> to * <li>Added debugging checks from <code>bw_dist_process()</code> to
* <code>bw_dist_process_multi()</code>.</li> * <code>bw_dist_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_dist_process_multi()</code> * <li>Added debugging checks in <code>bw_dist_process_multi()</code>
@ -88,9 +91,13 @@
#ifndef BW_DIST_H #ifndef BW_DIST_H
#define BW_DIST_H #define BW_DIST_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -275,7 +282,7 @@ static inline char bw_dist_state_is_valid(
* than or equal to that of `bw_dist_state`. * than or equal to that of `bw_dist_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -284,14 +291,23 @@ static inline char bw_dist_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_hp1.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_peak.h> # include "bw_hp1.h"
#include <bw_clip.h> # include "bw_peak.h"
#include <bw_satur.h> # include "bw_clip.h"
#include <bw_lp1.h> # include "bw_satur.h"
#include <bw_gain.h> # include "bw_lp1.h"
# include "bw_gain.h"
#else
# include <bw_hp1.h>
# include <bw_peak.h>
# include <bw_clip.h>
# include <bw_satur.h>
# include <bw_lp1.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -682,13 +698,16 @@ static inline char bw_dist_state_is_valid(
&& bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state); && bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -708,33 +727,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setDistortion( void setDistortion(
float value); float value);
@ -786,14 +805,14 @@ inline void Dist<N_CHANNELS>::reset(
bw_dist_reset_state(&coeffs, states + i, x0); bw_dist_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Dist<N_CHANNELS>::reset( inline void Dist<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Dist<N_CHANNELS>::reset( inline void Dist<N_CHANNELS>::reset(
@ -803,14 +822,14 @@ inline void Dist<N_CHANNELS>::reset(
bw_dist_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_dist_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Dist<N_CHANNELS>::reset( inline void Dist<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Dist<N_CHANNELS>::process( inline void Dist<N_CHANNELS>::process(
@ -820,7 +839,7 @@ inline void Dist<N_CHANNELS>::process(
bw_dist_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_dist_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Dist<N_CHANNELS>::process( inline void Dist<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -828,7 +847,7 @@ inline void Dist<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Dist<N_CHANNELS>::setDistortion( inline void Dist<N_CHANNELS>::setDistortion(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_common bw_gain bw_hs1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak * bw_common bw_gain bw_hs1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak
* bw_satur bw_svf * bw_satur bw_svf
@ -32,8 +32,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_drive_process()</code> to * <li>Added debugging checks from <code>bw_drive_process()</code> to
* <code>bw_drive_process_multi()</code>.</li> * <code>bw_drive_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_drive_process_multi()</code> * <li>Added debugging checks in <code>bw_drive_process_multi()</code>
@ -89,9 +92,13 @@
#ifndef BW_DRIVE_H #ifndef BW_DRIVE_H
#define BW_DRIVE_H #define BW_DRIVE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -276,7 +283,7 @@ static inline char bw_drive_state_is_valid(
* than or equal to that of `bw_drive_state`. * than or equal to that of `bw_drive_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -285,14 +292,23 @@ static inline char bw_drive_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_svf.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_hs1.h> # include "bw_svf.h"
#include <bw_peak.h> # include "bw_hs1.h"
#include <bw_satur.h> # include "bw_peak.h"
#include <bw_lp1.h> # include "bw_satur.h"
#include <bw_gain.h> # include "bw_lp1.h"
# include "bw_gain.h"
#else
# include <bw_svf.h>
# include <bw_hs1.h>
# include <bw_peak.h>
# include <bw_satur.h>
# include <bw_lp1.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -685,13 +701,16 @@ static inline char bw_drive_state_is_valid(
&& bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state); && bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -711,33 +730,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setDrive( void setDrive(
float value); float value);
@ -789,14 +808,14 @@ inline void Drive<N_CHANNELS>::reset(
bw_drive_reset_state(&coeffs, states + i, x0); bw_drive_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Drive<N_CHANNELS>::reset( inline void Drive<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Drive<N_CHANNELS>::reset( inline void Drive<N_CHANNELS>::reset(
@ -806,14 +825,14 @@ inline void Drive<N_CHANNELS>::reset(
bw_drive_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_drive_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Drive<N_CHANNELS>::reset( inline void Drive<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Drive<N_CHANNELS>::process( inline void Drive<N_CHANNELS>::process(
@ -823,7 +842,7 @@ inline void Drive<N_CHANNELS>::process(
bw_drive_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_drive_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Drive<N_CHANNELS>::process( inline void Drive<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -831,7 +850,7 @@ inline void Drive<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Drive<N_CHANNELS>::setDrive( inline void Drive<N_CHANNELS>::setDrive(

View File

@ -29,6 +29,9 @@
* <ul> * <ul>
* <li>Version <strong>1.2.0</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_dry_wet_process()</code> to * <li>Added debugging checks from <code>bw_dry_wet_process()</code> to
* <code>bw_dry_wet_process_multi()</code>.</li> * <code>bw_dry_wet_process_multi()</code>.</li>
* <li>Added <code>bw_dry_wet_get_wet()</code> and * <li>Added <code>bw_dry_wet_get_wet()</code> and
@ -79,9 +82,13 @@
#ifndef BW_DRY_WET_H #ifndef BW_DRY_WET_H
#define BW_DRY_WET_H #define BW_DRY_WET_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -219,7 +226,7 @@ static inline char bw_dry_wet_coeffs_is_valid(
* than or equal to that of `bw_dry_wet_coeffs`. * than or equal to that of `bw_dry_wet_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -228,9 +235,13 @@ static inline char bw_dry_wet_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_gain.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_gain.h"
#else
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -475,13 +486,16 @@ static inline char bw_dry_wet_coeffs_is_valid(
return bw_gain_coeffs_is_valid(&coeffs->gain_coeffs); return bw_gain_coeffs_is_valid(&coeffs->gain_coeffs);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -505,13 +519,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> xDry, std::array<const float *, N_CHANNELS> xDry,
std::array<const float *, N_CHANNELS> xWet, std::array<const float *, N_CHANNELS> xWet,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setWet( void setWet(
float value); float value);
@ -561,7 +575,7 @@ inline void DryWet<N_CHANNELS>::process(
bw_dry_wet_process_multi(&coeffs, xDry, xWet, y, N_CHANNELS, nSamples); bw_dry_wet_process_multi(&coeffs, xDry, xWet, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void DryWet<N_CHANNELS>::process( inline void DryWet<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> xDry, std::array<const float *, N_CHANNELS> xDry,
@ -570,7 +584,7 @@ inline void DryWet<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(xDry.data(), xWet.data(), y.data(), nSamples); process(xDry.data(), xWet.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void DryWet<N_CHANNELS>::setWet( inline void DryWet<N_CHANNELS>::setWet(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Envelope follower made of a full-wave rectifier followed by * Envelope follower made of a full-wave rectifier followed by
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_env_follow_process()</code> * <li>Added debugging checks from <code>bw_env_follow_process()</code>
* to <code>bw_env_follow_process_multi()</code>.</li> * to <code>bw_env_follow_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -100,9 +103,13 @@
#ifndef BW_ENV_FOLLOW_H #ifndef BW_ENV_FOLLOW_H
#define BW_ENV_FOLLOW_H #define BW_ENV_FOLLOW_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -287,7 +294,7 @@ static inline char bw_env_follow_state_is_valid(
* than or equal to that of `bw_env_follow_state`. * than or equal to that of `bw_env_follow_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -296,10 +303,15 @@ static inline char bw_env_follow_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -644,13 +656,16 @@ static inline char bw_env_follow_state_is_valid(
return bw_one_pole_state_is_valid(coeffs ? &coeffs->one_pole_coeffs : BW_NULL, &state->one_pole_state); return bw_one_pole_state_is_valid(coeffs ? &coeffs->one_pole_coeffs : BW_NULL, &state->one_pole_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -670,33 +685,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setAttackTau( void setAttackTau(
float value); float value);
@ -748,14 +763,14 @@ inline void EnvFollow<N_CHANNELS>::reset(
bw_env_follow_reset_state(&coeffs, states + i, x0); bw_env_follow_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvFollow<N_CHANNELS>::reset( inline void EnvFollow<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvFollow<N_CHANNELS>::reset( inline void EnvFollow<N_CHANNELS>::reset(
@ -765,14 +780,14 @@ inline void EnvFollow<N_CHANNELS>::reset(
bw_env_follow_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_env_follow_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvFollow<N_CHANNELS>::reset( inline void EnvFollow<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvFollow<N_CHANNELS>::process( inline void EnvFollow<N_CHANNELS>::process(
@ -782,7 +797,7 @@ inline void EnvFollow<N_CHANNELS>::process(
bw_env_follow_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_env_follow_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvFollow<N_CHANNELS>::process( inline void EnvFollow<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -790,7 +805,7 @@ inline void EnvFollow<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvFollow<N_CHANNELS>::setAttackTau( inline void EnvFollow<N_CHANNELS>::setAttackTau(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Linear ADSR envelope generator. * Linear ADSR envelope generator.
@ -40,8 +40,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>More robust implementation.</li> * <li>More robust implementation.</li>
* <li>Fixed <code>bw_env_reset_state()</code> and * <li>Fixed <code>bw_env_reset_state()</code> and
* <code>bw_env_reset_state_multi()</code> to take into account * <code>bw_env_reset_state_multi()</code> to take into account
@ -133,9 +136,13 @@
#ifndef BW_ENV_GEN_H #ifndef BW_ENV_GEN_H
#define BW_ENV_GEN_H #define BW_ENV_GEN_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -396,7 +403,7 @@ static inline char bw_env_gen_state_is_valid(
* than or equal to that of `bw_env_gen_state`. * than or equal to that of `bw_env_gen_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -405,10 +412,15 @@ static inline char bw_env_gen_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -949,13 +961,16 @@ static inline char bw_env_gen_state_is_valid(
#undef BW_ENV_GEN_PARAM_RELEASE #undef BW_ENV_GEN_PARAM_RELEASE
#undef BW_ENV_GEN_V_MAX #undef BW_ENV_GEN_V_MAX
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -975,33 +990,33 @@ public:
char gate0 = 0, char gate0 = 0,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
char gate0, char gate0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const char * BW_RESTRICT gate0, const char * BW_RESTRICT gate0,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<char, N_CHANNELS> gate0, std::array<char, N_CHANNELS> gate0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const char * BW_RESTRICT gate, const char * BW_RESTRICT gate,
float * BW_RESTRICT const * BW_RESTRICT y, float * BW_RESTRICT const * BW_RESTRICT y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<char, N_CHANNELS> gate, std::array<char, N_CHANNELS> gate,
std::array<float * BW_RESTRICT, N_CHANNELS> y, std::array<float * BW_RESTRICT, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setAttack( void setAttack(
float value); float value);
@ -1068,14 +1083,14 @@ inline void EnvGen<N_CHANNELS>::reset(
bw_env_gen_reset_state(&coeffs, states + i, gate0); bw_env_gen_reset_state(&coeffs, states + i, gate0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvGen<N_CHANNELS>::reset( inline void EnvGen<N_CHANNELS>::reset(
char gate0, char gate0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(gate0, y0 != nullptr ? y0->data() : nullptr); reset(gate0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvGen<N_CHANNELS>::reset( inline void EnvGen<N_CHANNELS>::reset(
@ -1085,14 +1100,14 @@ inline void EnvGen<N_CHANNELS>::reset(
bw_env_gen_reset_state_multi(&coeffs, statesP, gate0, y0, N_CHANNELS); bw_env_gen_reset_state_multi(&coeffs, statesP, gate0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvGen<N_CHANNELS>::reset( inline void EnvGen<N_CHANNELS>::reset(
std::array<char, N_CHANNELS> gate0, std::array<char, N_CHANNELS> gate0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(gate0.data(), y0 != nullptr ? y0->data() : nullptr); reset(gate0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvGen<N_CHANNELS>::process( inline void EnvGen<N_CHANNELS>::process(
@ -1102,7 +1117,7 @@ inline void EnvGen<N_CHANNELS>::process(
bw_env_gen_process_multi(&coeffs, statesP, gate, y, N_CHANNELS, nSamples); bw_env_gen_process_multi(&coeffs, statesP, gate, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvGen<N_CHANNELS>::process( inline void EnvGen<N_CHANNELS>::process(
std::array<char, N_CHANNELS> gate, std::array<char, N_CHANNELS> gate,
@ -1110,7 +1125,7 @@ inline void EnvGen<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(gate.data(), y.data(), nSamples); process(gate.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void EnvGen<N_CHANNELS>::setAttack( inline void EnvGen<N_CHANNELS>::setAttack(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_common bw_gain bw_hp1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak * bw_common bw_gain bw_hp1 bw_lp1 bw_math bw_mm2 bw_one_pole bw_peak
* bw_satur bw_svf * bw_satur bw_svf
@ -32,8 +32,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_fuzz_process()</code> to * <li>Added debugging checks from <code>bw_fuzz_process()</code> to
* <code>bw_fuzz_process_multi()</code>.</li> * <code>bw_fuzz_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_fuzz_process_multi()</code> * <li>Added debugging checks in <code>bw_fuzz_process_multi()</code>
@ -89,9 +92,13 @@
#ifndef BW_FUZZ_H #ifndef BW_FUZZ_H
#define BW_FUZZ_H #define BW_FUZZ_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -264,7 +271,7 @@ static inline char bw_fuzz_state_is_valid(
* than or equal to that of `bw_fuzz_state`. * than or equal to that of `bw_fuzz_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -273,14 +280,23 @@ static inline char bw_fuzz_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_hp1.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_svf.h> # include "bw_hp1.h"
#include <bw_peak.h> # include "bw_svf.h"
#include <bw_satur.h> # include "bw_peak.h"
#include <bw_hp1.h> # include "bw_satur.h"
#include <bw_gain.h> # include "bw_hp1.h"
# include "bw_gain.h"
#else
# include <bw_hp1.h>
# include <bw_svf.h>
# include <bw_peak.h>
# include <bw_satur.h>
# include <bw_hp1.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -657,13 +673,16 @@ static inline char bw_fuzz_state_is_valid(
&& bw_hp1_state_is_valid(coeffs ? &coeffs->hp1_out_coeffs : BW_NULL, &state->hp1_out_state); && bw_hp1_state_is_valid(coeffs ? &coeffs->hp1_out_coeffs : BW_NULL, &state->hp1_out_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -683,33 +702,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setFuzz( void setFuzz(
float value); float value);
@ -758,14 +777,14 @@ inline void Fuzz<N_CHANNELS>::reset(
bw_fuzz_reset_state(&coeffs, states + i, x0); bw_fuzz_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Fuzz<N_CHANNELS>::reset( inline void Fuzz<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Fuzz<N_CHANNELS>::reset( inline void Fuzz<N_CHANNELS>::reset(
@ -775,14 +794,14 @@ inline void Fuzz<N_CHANNELS>::reset(
bw_fuzz_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_fuzz_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Fuzz<N_CHANNELS>::reset( inline void Fuzz<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Fuzz<N_CHANNELS>::process( inline void Fuzz<N_CHANNELS>::process(
@ -792,7 +811,7 @@ inline void Fuzz<N_CHANNELS>::process(
bw_fuzz_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_fuzz_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Fuzz<N_CHANNELS>::process( inline void Fuzz<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -800,7 +819,7 @@ inline void Fuzz<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Fuzz<N_CHANNELS>::setFuzz( inline void Fuzz<N_CHANNELS>::setFuzz(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Gain. * Gain.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_ap1_process()</code> to * <li>Added debugging checks from <code>bw_ap1_process()</code> to
* <code>bw_ap1_process_multi()</code>.</li> * <code>bw_ap1_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_gain_process_multi()</code> * <li>Added debugging checks in <code>bw_gain_process_multi()</code>
@ -98,9 +101,13 @@
#ifndef BW_GAIN_H #ifndef BW_GAIN_H
#define BW_GAIN_H #define BW_GAIN_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -246,7 +253,7 @@ static inline char bw_gain_coeffs_is_valid(
* than or equal to that of `bw_gain_coeffs`. * than or equal to that of `bw_gain_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -255,10 +262,15 @@ static inline char bw_gain_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -525,13 +537,16 @@ static inline char bw_gain_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -554,12 +569,12 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setGainLin( void setGainLin(
float value); float value);
@ -611,7 +626,7 @@ inline void Gain<N_CHANNELS>::process(
bw_gain_process_multi(&coeffs, x, y, N_CHANNELS, nSamples); bw_gain_process_multi(&coeffs, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Gain<N_CHANNELS>::process( inline void Gain<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -619,7 +634,7 @@ inline void Gain<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Gain<N_CHANNELS>::setGainLin( inline void Gain<N_CHANNELS>::setGainLin(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_lp1 bw_math bw_one_pole }}} * requires {{{ bw_common bw_lp1 bw_math bw_one_pole }}}
* description {{{ * description {{{
* First-order highpass filter (6 dB/oct) with gain asymptotically * First-order highpass filter (6 dB/oct) with gain asymptotically
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_hp1_process()</code> to * <li>Added debugging checks from <code>bw_hp1_process()</code> to
* <code>bw_hp1_process_multi()</code>.</li> * <code>bw_hp1_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_hp1_process_multi()</code> to * <li>Added debugging checks in <code>bw_hp1_process_multi()</code> to
@ -94,9 +97,13 @@
#ifndef BW_HP1_H #ifndef BW_HP1_H
#define BW_HP1_H #define BW_HP1_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -282,7 +289,7 @@ static inline char bw_hp1_state_is_valid(
* than or equal to that of `bw_hp1_state`. * than or equal to that of `bw_hp1_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -291,9 +298,13 @@ static inline char bw_hp1_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_lp1.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_lp1.h"
#else
# include <bw_lp1.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -627,13 +638,16 @@ static inline char bw_hp1_state_is_valid(
return bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state); return bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -653,33 +667,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -731,14 +745,14 @@ inline void HP1<N_CHANNELS>::reset(
bw_hp1_reset_state(&coeffs, states + i, x0); bw_hp1_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HP1<N_CHANNELS>::reset( inline void HP1<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : y0); reset(x0, y0 != nullptr ? y0->data() : y0);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HP1<N_CHANNELS>::reset( inline void HP1<N_CHANNELS>::reset(
@ -748,14 +762,14 @@ inline void HP1<N_CHANNELS>::reset(
bw_hp1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_hp1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HP1<N_CHANNELS>::reset( inline void HP1<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HP1<N_CHANNELS>::process( inline void HP1<N_CHANNELS>::process(
@ -765,7 +779,7 @@ inline void HP1<N_CHANNELS>::process(
bw_hp1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_hp1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HP1<N_CHANNELS>::process( inline void HP1<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -773,7 +787,7 @@ inline void HP1<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HP1<N_CHANNELS>::setCutoff( inline void HP1<N_CHANNELS>::setCutoff(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole }}} * requires {{{ bw_common bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole }}}
* description {{{ * description {{{
* First-order high shelf filter (6 dB/oct) with unitary DC gain. * First-order high shelf filter (6 dB/oct) with unitary DC gain.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Enforced limits on cutoff and high_gain also in * <li>Enforced limits on cutoff and high_gain also in
* <code>bw_hs1_reset_state*()</code> and clarified * <code>bw_hs1_reset_state*()</code> and clarified
* documentation.</li> * documentation.</li>
@ -98,9 +101,13 @@
#ifndef BW_HS1_H #ifndef BW_HS1_H
#define BW_HS1_H #define BW_HS1_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -324,7 +331,7 @@ static inline char bw_hs1_state_is_valid(
* than or equal to that of `bw_hs1_state`. * than or equal to that of `bw_hs1_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -333,10 +340,15 @@ static inline char bw_hs1_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_mm1.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_math.h> # include "bw_mm1.h"
# include "bw_math.h"
#else
# include <bw_mm1.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -750,13 +762,16 @@ static inline char bw_hs1_state_is_valid(
return bw_mm1_state_is_valid(coeffs ? &coeffs->mm1_coeffs : BW_NULL, &state->mm1_state); return bw_mm1_state_is_valid(coeffs ? &coeffs->mm1_coeffs : BW_NULL, &state->mm1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -776,33 +791,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -860,14 +875,14 @@ inline void HS1<N_CHANNELS>::reset(
bw_hs1_reset_state(&coeffs, states + i, x0); bw_hs1_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS1<N_CHANNELS>::reset( inline void HS1<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : y0); reset(x0, y0 != nullptr ? y0->data() : y0);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS1<N_CHANNELS>::reset( inline void HS1<N_CHANNELS>::reset(
@ -877,14 +892,14 @@ inline void HS1<N_CHANNELS>::reset(
bw_hs1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_hs1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS1<N_CHANNELS>::reset( inline void HS1<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS1<N_CHANNELS>::process( inline void HS1<N_CHANNELS>::process(
@ -894,7 +909,7 @@ inline void HS1<N_CHANNELS>::process(
bw_hs1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_hs1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS1<N_CHANNELS>::process( inline void HS1<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -902,7 +917,7 @@ inline void HS1<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS1<N_CHANNELS>::setCutoff( inline void HS1<N_CHANNELS>::setCutoff(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}} * requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Second-order high shelf filter (12 dB/oct) with unitary DC gain. * Second-order high shelf filter (12 dB/oct) with unitary DC gain.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Enforced limits on cutoff and high_gain also in * <li>Enforced limits on cutoff and high_gain also in
* <code>bw_hs2_reset_state*()</code> and clarified * <code>bw_hs2_reset_state*()</code> and clarified
* documentation.</li> * documentation.</li>
@ -102,9 +105,13 @@
#ifndef BW_HS2_H #ifndef BW_HS2_H
#define BW_HS2_H #define BW_HS2_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -340,7 +347,7 @@ static inline char bw_hs2_state_is_valid(
* than or equal to that of `bw_hs2_state`. * than or equal to that of `bw_hs2_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -349,10 +356,15 @@ static inline char bw_hs2_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_mm2.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_math.h> # include "bw_mm2.h"
# include "bw_math.h"
#else
# include <bw_mm2.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -805,13 +817,16 @@ static inline char bw_hs2_state_is_valid(
#undef BW_HS2_PARAM_CUTOFF #undef BW_HS2_PARAM_CUTOFF
#undef BW_HS2_PARAM_HIGH_GAIN #undef BW_HS2_PARAM_HIGH_GAIN
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -831,33 +846,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -918,14 +933,14 @@ inline void HS2<N_CHANNELS>::reset(
bw_hs2_reset_state(&coeffs, states + i, x0); bw_hs2_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS2<N_CHANNELS>::reset( inline void HS2<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : y0); reset(x0, y0 != nullptr ? y0->data() : y0);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS2<N_CHANNELS>::reset( inline void HS2<N_CHANNELS>::reset(
@ -935,14 +950,14 @@ inline void HS2<N_CHANNELS>::reset(
bw_hs2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_hs2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS2<N_CHANNELS>::reset( inline void HS2<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS2<N_CHANNELS>::process( inline void HS2<N_CHANNELS>::process(
@ -952,7 +967,7 @@ inline void HS2<N_CHANNELS>::process(
bw_hs2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_hs2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS2<N_CHANNELS>::process( inline void HS2<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -960,7 +975,7 @@ inline void HS2<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void HS2<N_CHANNELS>::setCutoff( inline void HS2<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* First-order lowpass filter (6 dB/oct) with unitary DC gain. * First-order lowpass filter (6 dB/oct) with unitary DC gain.
@ -30,8 +30,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_lp1_process()</code> to * <li>Added debugging checks from <code>bw_lp1_process()</code> to
* <code>bw_lp1_process_multi()</code>.</li> * <code>bw_lp1_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_lp1_process_multi()</code> to * <li>Added debugging checks in <code>bw_lp1_process_multi()</code> to
@ -95,9 +98,13 @@
#ifndef BW_LP1_H #ifndef BW_LP1_H
#define BW_LP1_H #define BW_LP1_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -283,7 +290,7 @@ static inline char bw_lp1_state_is_valid(
* than or equal to that of `bw_lp1_state`. * than or equal to that of `bw_lp1_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -292,10 +299,15 @@ static inline char bw_lp1_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -712,13 +724,16 @@ static inline char bw_lp1_state_is_valid(
return bw_is_finite(state->y_z1) && bw_is_finite(state->X_z1); return bw_is_finite(state->y_z1) && bw_is_finite(state->X_z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -738,33 +753,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -816,14 +831,14 @@ inline void LP1<N_CHANNELS>::reset(
bw_lp1_reset_state(&coeffs, states + i, x0); bw_lp1_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LP1<N_CHANNELS>::reset( inline void LP1<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LP1<N_CHANNELS>::reset( inline void LP1<N_CHANNELS>::reset(
@ -833,14 +848,14 @@ inline void LP1<N_CHANNELS>::reset(
bw_lp1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_lp1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LP1<N_CHANNELS>::reset( inline void LP1<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LP1<N_CHANNELS>::process( inline void LP1<N_CHANNELS>::process(
@ -850,7 +865,7 @@ inline void LP1<N_CHANNELS>::process(
bw_lp1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_lp1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LP1<N_CHANNELS>::process( inline void LP1<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -858,7 +873,7 @@ inline void LP1<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LP1<N_CHANNELS>::setCutoff( inline void LP1<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole }}} * requires {{{ bw_common bw_gain bw_lp1 bw_math bw_mm1 bw_one_pole }}}
* description {{{ * description {{{
* First-order low shelf filter (6 dB/oct) with gain asymptotically * First-order low shelf filter (6 dB/oct) with gain asymptotically
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Enforced limits on cutoff and dc_gain also in * <li>Enforced limits on cutoff and dc_gain also in
* <code>bw_ls1_reset_state*()</code> and clarified * <code>bw_ls1_reset_state*()</code> and clarified
* documentation.</li> * documentation.</li>
@ -99,9 +102,13 @@
#ifndef BW_LS1_H #ifndef BW_LS1_H
#define BW_LS1_H #define BW_LS1_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -323,7 +330,7 @@ static inline char bw_ls1_state_is_valid(
* than or equal to that of `bw_ls1_state`. * than or equal to that of `bw_ls1_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -332,10 +339,15 @@ static inline char bw_ls1_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_mm1.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_math.h> # include "bw_mm1.h"
# include "bw_math.h"
#else
# include <bw_mm1.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -748,13 +760,16 @@ static inline char bw_ls1_state_is_valid(
return bw_mm1_state_is_valid(coeffs ? &coeffs->mm1_coeffs : BW_NULL, &state->mm1_state); return bw_mm1_state_is_valid(coeffs ? &coeffs->mm1_coeffs : BW_NULL, &state->mm1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -774,33 +789,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -858,14 +873,14 @@ inline void LS1<N_CHANNELS>::reset(
bw_ls1_reset_state(&coeffs, states + i, x0); bw_ls1_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS1<N_CHANNELS>::reset( inline void LS1<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS1<N_CHANNELS>::reset( inline void LS1<N_CHANNELS>::reset(
@ -875,14 +890,14 @@ inline void LS1<N_CHANNELS>::reset(
bw_ls1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_ls1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS1<N_CHANNELS>::reset( inline void LS1<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS1<N_CHANNELS>::process( inline void LS1<N_CHANNELS>::process(
@ -892,7 +907,7 @@ inline void LS1<N_CHANNELS>::process(
bw_ls1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_ls1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS1<N_CHANNELS>::process( inline void LS1<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -900,7 +915,7 @@ inline void LS1<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS1<N_CHANNELS>::setCutoff( inline void LS1<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}} * requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Second-order low shelf filter (12 dB/oct) with gain asymptotically * Second-order low shelf filter (12 dB/oct) with gain asymptotically
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Enforced limits on cutoff and dc_gain also in * <li>Enforced limits on cutoff and dc_gain also in
* <code>bw_ls2_reset_state*()</code> and clarified * <code>bw_ls2_reset_state*()</code> and clarified
* documentation.</li> * documentation.</li>
@ -107,9 +110,13 @@
#ifndef BW_LS2_H #ifndef BW_LS2_H
#define BW_LS2_H #define BW_LS2_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -346,7 +353,7 @@ static inline char bw_ls2_state_is_valid(
* than or equal to that of `bw_ls2_state`. * than or equal to that of `bw_ls2_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -355,10 +362,15 @@ static inline char bw_ls2_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_mm2.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_math.h> # include "bw_mm2.h"
# include "bw_math.h"
#else
# include <bw_mm2.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -811,13 +823,16 @@ static inline char bw_ls2_state_is_valid(
#undef BW_LS2_PARAM_CUTOFF #undef BW_LS2_PARAM_CUTOFF
#undef BW_LS2_PARAM_DC_GAIN #undef BW_LS2_PARAM_DC_GAIN
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -837,33 +852,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -924,14 +939,14 @@ inline void LS2<N_CHANNELS>::reset(
bw_ls2_reset_state(&coeffs, states + i, x0); bw_ls2_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS2<N_CHANNELS>::reset( inline void LS2<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : y0); reset(x0, y0 != nullptr ? y0->data() : y0);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS2<N_CHANNELS>::reset( inline void LS2<N_CHANNELS>::reset(
@ -941,14 +956,14 @@ inline void LS2<N_CHANNELS>::reset(
bw_ls2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_ls2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS2<N_CHANNELS>::reset( inline void LS2<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS2<N_CHANNELS>::process( inline void LS2<N_CHANNELS>::process(
@ -958,7 +973,7 @@ inline void LS2<N_CHANNELS>::process(
bw_ls2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_ls2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS2<N_CHANNELS>::process( inline void LS2<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -966,7 +981,7 @@ inline void LS2<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void LS2<N_CHANNELS>::setCutoff( inline void LS2<N_CHANNELS>::setCutoff(

View File

@ -50,6 +50,8 @@
* <code>bw_maxi64</code>, <code>bw_clipi64</code>, * <code>bw_maxi64</code>, <code>bw_clipi64</code>,
* <code>bw_minu64</code>, <code>bw_maxu64</code>, and * <code>bw_minu64</code>, <code>bw_maxu64</code>, and
* <code>bw_clipu64</code>.</li> * <code>bw_clipu64</code>.</li>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code> and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul> * </ul>
* </li> * </li>
* <li>Version <strong>1.0.1</strong>: * <li>Version <strong>1.0.1</strong>:
@ -129,9 +131,13 @@
#ifndef BW_MATH_H #ifndef BW_MATH_H
#define BW_MATH_H #define BW_MATH_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -618,7 +624,7 @@ static inline float bw_acoshf(
* Absolute error < 0.004 or relative error < 0.8%, whatever is worse. * Absolute error < 0.004 or relative error < 0.8%, whatever is worse.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -627,7 +633,7 @@ static inline float bw_acoshf(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -1102,7 +1108,7 @@ static inline float bw_acoshf(
return y; return y;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_lp1 bw_math bw_one_pole }}} * requires {{{ bw_common bw_gain bw_lp1 bw_math bw_one_pole }}}
* description {{{ * description {{{
* First-order multimode filter. * First-order multimode filter.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_mm1_process()</code> to * <li>Added debugging checks from <code>bw_mm1_process()</code> to
* <code>bw_mm1_process_multi()</code>.</li> * <code>bw_mm1_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_mm1_process_multi()</code> to * <li>Added debugging checks in <code>bw_mm1_process_multi()</code> to
@ -94,9 +97,13 @@
#ifndef BW_MM1_H #ifndef BW_MM1_H
#define BW_MM1_H #define BW_MM1_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -305,7 +312,7 @@ static inline char bw_mm1_state_is_valid(
* than or equal to that of `bw_mm1_state`. * than or equal to that of `bw_mm1_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -314,10 +321,15 @@ static inline char bw_mm1_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_lp1.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_gain.h> # include "bw_lp1.h"
# include "bw_gain.h"
#else
# include <bw_lp1.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -698,13 +710,16 @@ static inline char bw_mm1_state_is_valid(
return bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state); return bw_lp1_state_is_valid(coeffs ? &coeffs->lp1_coeffs : BW_NULL, &state->lp1_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -724,33 +739,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -808,14 +823,14 @@ inline void MM1<N_CHANNELS>::reset(
bw_mm1_reset_state(&coeffs, states + i, x0); bw_mm1_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM1<N_CHANNELS>::reset( inline void MM1<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM1<N_CHANNELS>::reset( inline void MM1<N_CHANNELS>::reset(
@ -825,14 +840,14 @@ inline void MM1<N_CHANNELS>::reset(
bw_mm1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_mm1_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM1<N_CHANNELS>::reset( inline void MM1<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM1<N_CHANNELS>::process( inline void MM1<N_CHANNELS>::process(
@ -842,7 +857,7 @@ inline void MM1<N_CHANNELS>::process(
bw_mm1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_mm1_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM1<N_CHANNELS>::process( inline void MM1<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -850,7 +865,7 @@ inline void MM1<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM1<N_CHANNELS>::setCutoff( inline void MM1<N_CHANNELS>::setCutoff(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_one_pole bw_svf }}} * requires {{{ bw_common bw_gain bw_math bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Second-order multimode filter. * Second-order multimode filter.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_mm2_process()</code> to * <li>Added debugging checks from <code>bw_mm2_process()</code> to
* <code>bw_mm2_process_multi()</code>.</li> * <code>bw_mm2_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_mm2_process_multi()</code> to * <li>Added debugging checks in <code>bw_mm2_process_multi()</code> to
@ -94,9 +97,13 @@
#ifndef BW_MM2_H #ifndef BW_MM2_H
#define BW_MM2_H #define BW_MM2_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -342,7 +349,7 @@ static inline char bw_mm2_state_is_valid(
* than or equal to that of `bw_mm2_state`. * than or equal to that of `bw_mm2_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -351,10 +358,15 @@ static inline char bw_mm2_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_svf.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_gain.h> # include "bw_svf.h"
# include "bw_gain.h"
#else
# include <bw_svf.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -806,13 +818,16 @@ static inline char bw_mm2_state_is_valid(
return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state); return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -832,33 +847,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -925,14 +940,14 @@ inline void MM2<N_CHANNELS>::reset(
bw_mm2_reset_state(&coeffs, states + i, x0); bw_mm2_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM2<N_CHANNELS>::reset( inline void MM2<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM2<N_CHANNELS>::reset( inline void MM2<N_CHANNELS>::reset(
@ -942,14 +957,14 @@ inline void MM2<N_CHANNELS>::reset(
bw_mm2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_mm2_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM2<N_CHANNELS>::reset( inline void MM2<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM2<N_CHANNELS>::process( inline void MM2<N_CHANNELS>::process(
@ -959,7 +974,7 @@ inline void MM2<N_CHANNELS>::process(
bw_mm2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_mm2_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM2<N_CHANNELS>::process( inline void MM2<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -967,7 +982,7 @@ inline void MM2<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void MM2<N_CHANNELS>::setCutoff( inline void MM2<N_CHANNELS>::setCutoff(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_env_follow bw_math bw_one_pole }}} * requires {{{ bw_common bw_env_follow bw_math bw_one_pole }}}
* description {{{ * description {{{
* Noise gate with independent sidechain input. * Noise gate with independent sidechain input.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_noise_gate_process()</code> * <li>Added debugging checks from <code>bw_noise_gate_process()</code>
* to <code>bw_noise_gate_process_multi()</code>.</li> * to <code>bw_noise_gate_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -100,9 +103,13 @@
#ifndef BW_NOISE_GATE_H #ifndef BW_NOISE_GATE_H
#define BW_NOISE_GATE_H #define BW_NOISE_GATE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -330,7 +337,7 @@ static inline char bw_noise_gate_state_is_valid(
* than or equal to that of `bw_noise_gate_state`. * than or equal to that of `bw_noise_gate_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -339,11 +346,17 @@ static inline char bw_noise_gate_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_env_follow.h> # include "bw_math.h"
#include <bw_one_pole.h> # include "bw_env_follow.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_env_follow.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -798,13 +811,16 @@ static inline char bw_noise_gate_state_is_valid(
return bw_env_follow_state_is_valid(coeffs ? &coeffs->env_follow_coeffs : BW_NULL, &state->env_follow_state); return bw_env_follow_state_is_valid(coeffs ? &coeffs->env_follow_coeffs : BW_NULL, &state->env_follow_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -825,24 +841,24 @@ public:
float xSc0 = 0.f, float xSc0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
float xSc0, float xSc0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
const float * xSc0, const float * xSc0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> xSc0, std::array<float, N_CHANNELS> xSc0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
@ -850,13 +866,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<const float *, N_CHANNELS> xSc, std::array<const float *, N_CHANNELS> xSc,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
// >> the following 2 methods only exist because of a typo, don't use // >> the following 2 methods only exist because of a typo, don't use
void setTreshLin( void setTreshLin(
@ -923,7 +939,7 @@ inline void NoiseGate<N_CHANNELS>::reset(
bw_noise_gate_reset_state(&coeffs, states + i, x0, xSc0); bw_noise_gate_reset_state(&coeffs, states + i, x0, xSc0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGate<N_CHANNELS>::reset( inline void NoiseGate<N_CHANNELS>::reset(
float x0, float x0,
@ -931,7 +947,7 @@ inline void NoiseGate<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, xSc0, y0 != nullptr ? y0->data() : nullptr); reset(x0, xSc0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGate<N_CHANNELS>::reset( inline void NoiseGate<N_CHANNELS>::reset(
@ -942,7 +958,7 @@ inline void NoiseGate<N_CHANNELS>::reset(
bw_noise_gate_reset_state_multi(&coeffs, statesP, x0, xSc0, y0, N_CHANNELS); bw_noise_gate_reset_state_multi(&coeffs, statesP, x0, xSc0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGate<N_CHANNELS>::reset( inline void NoiseGate<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
@ -950,7 +966,7 @@ inline void NoiseGate<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), xSc0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), xSc0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGate<N_CHANNELS>::process( inline void NoiseGate<N_CHANNELS>::process(
@ -961,7 +977,7 @@ inline void NoiseGate<N_CHANNELS>::process(
bw_noise_gate_process_multi(&coeffs, statesP, x, xSc, y, N_CHANNELS, nSamples); bw_noise_gate_process_multi(&coeffs, statesP, x, xSc, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGate<N_CHANNELS>::process( inline void NoiseGate<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -970,7 +986,7 @@ inline void NoiseGate<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), xSc.data(), y.data(), nSamples); process(x.data(), xSc.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGate<N_CHANNELS>::setTreshLin( inline void NoiseGate<N_CHANNELS>::setTreshLin(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.0 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_rand }}} * requires {{{ bw_common bw_math bw_rand }}}
* description {{{ * description {{{
* Generator of white noise with uniform distribution. * Generator of white noise with uniform distribution.
@ -30,7 +30,13 @@
* [bw\_rand](bw_rand)). * [bw\_rand](bw_rand)).
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <li>Version <strong>1.2.0</strong>:
* <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul>
* </li>
* <li>Version <strong>1.1.0</strong>: * <li>Version <strong>1.1.0</strong>:
* <ul> * <ul>
* <li>Now using <code>BW_NULL</code> and * <li>Now using <code>BW_NULL</code> and
@ -82,9 +88,13 @@
#ifndef BW_NOISE_GEN_H #ifndef BW_NOISE_GEN_H
#define BW_NOISE_GEN_H #define BW_NOISE_GEN_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -209,7 +219,7 @@ static inline char bw_noise_gen_coeffs_is_valid(
* than or equal to that of `bw_noise_gen_coeffs`. * than or equal to that of `bw_noise_gen_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -218,10 +228,15 @@ static inline char bw_noise_gen_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_rand.h> # include "bw_math.h"
# include "bw_rand.h"
#else
# include <bw_math.h>
# include <bw_rand.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -432,13 +447,16 @@ static inline char bw_noise_gen_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -461,11 +479,11 @@ public:
float * BW_RESTRICT const * BW_RESTRICT y, float * BW_RESTRICT const * BW_RESTRICT y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<float * BW_RESTRICT, N_CHANNELS> y, std::array<float * BW_RESTRICT, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setSampleRateScaling( void setSampleRateScaling(
bool value); bool value);
@ -509,14 +527,14 @@ inline void NoiseGen<N_CHANNELS>::process(
bw_noise_gen_process_multi(&coeffs, y, N_CHANNELS, nSamples); bw_noise_gen_process_multi(&coeffs, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGen<N_CHANNELS>::process( inline void NoiseGen<N_CHANNELS>::process(
std::array<float * BW_RESTRICT, N_CHANNELS> y, std::array<float * BW_RESTRICT, N_CHANNELS> y,
size_t nSamples) { size_t nSamples) {
process(y.data(), nSamples); process(y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void NoiseGen<N_CHANNELS>::setSampleRateScaling( inline void NoiseGen<N_CHANNELS>::setSampleRateScaling(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole bw_svf }}} * requires {{{ bw_common bw_math bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Second-order notch filter with unitary gain at DC and asymptotically as * Second-order notch filter with unitary gain at DC and asymptotically as
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_notch_process()</code> to * <li>Added debugging checks from <code>bw_notch_process()</code> to
* <code>bw_notch_process_multi()</code>.</li> * <code>bw_notch_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_notch_process_multi()</code> * <li>Added debugging checks in <code>bw_notch_process_multi()</code>
@ -94,9 +97,13 @@
#ifndef BW_NOTCH_H #ifndef BW_NOTCH_H
#define BW_NOTCH_H #define BW_NOTCH_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -294,7 +301,7 @@ static inline char bw_notch_state_is_valid(
* than or equal to that of `bw_notch_state`. * than or equal to that of `bw_notch_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -303,9 +310,13 @@ static inline char bw_notch_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_svf.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_svf.h"
#else
# include <bw_svf.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -657,13 +668,16 @@ static inline char bw_notch_state_is_valid(
return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state); return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -683,33 +697,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -764,14 +778,14 @@ inline void Notch<N_CHANNELS>::reset(
bw_notch_reset_state(&coeffs, states + i, x0); bw_notch_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Notch<N_CHANNELS>::reset( inline void Notch<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Notch<N_CHANNELS>::reset( inline void Notch<N_CHANNELS>::reset(
@ -781,14 +795,14 @@ inline void Notch<N_CHANNELS>::reset(
bw_notch_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_notch_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Notch<N_CHANNELS>::reset( inline void Notch<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Notch<N_CHANNELS>::process( inline void Notch<N_CHANNELS>::process(
@ -798,7 +812,7 @@ inline void Notch<N_CHANNELS>::process(
bw_notch_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_notch_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Notch<N_CHANNELS>::process( inline void Notch<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -806,7 +820,7 @@ inline void Notch<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Notch<N_CHANNELS>::setCutoff( inline void Notch<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ utility }}} * module_type {{{ utility }}}
* version {{{ 1.0.1 }}} * version {{{ 1.1.0 }}}
* requires {{{ bw_common }}} * requires {{{ bw_common }}}
* description {{{ * description {{{
* Simple data structure that helps keeping track of note on/off events and * Simple data structure that helps keeping track of note on/off events and
@ -30,6 +30,13 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.0</strong>:
* <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul>
* </li>
* <li>Version <strong>1.0.1</strong>: * <li>Version <strong>1.0.1</strong>:
* <ul> * <ul>
* <li>Now using <code>BW_NULL</code>.</li> * <li>Now using <code>BW_NULL</code>.</li>
@ -66,9 +73,13 @@
#ifndef BW_NOTE_QUEUE_H #ifndef BW_NOTE_QUEUE_H
#define BW_NOTE_QUEUE_H #define BW_NOTE_QUEUE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -162,7 +173,7 @@ static inline char bw_note_queue_is_valid(
* than or equal to that of `bw_note_queue`. * than or equal to that of `bw_note_queue`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -171,7 +182,7 @@ static inline char bw_note_queue_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -260,8 +271,11 @@ static inline char bw_note_queue_is_valid(
return cnt == queue->n_pressed; return cnt == queue->n_pressed;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
/*** Public C++ API ***/ /*** Public C++ API ***/

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* One-pole (6 dB/oct) lowpass filter with unitary DC gain, separate attack * One-pole (6 dB/oct) lowpass filter with unitary DC gain, separate attack
@ -30,8 +30,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_one_pole_process()</code> * <li>Added debugging checks from <code>bw_one_pole_process()</code>
* to <code>bw_one_pole_process_multi()</code>.</li> * to <code>bw_one_pole_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -111,9 +114,13 @@
#ifndef BW_ONE_POLE_H #ifndef BW_ONE_POLE_H
#define BW_ONE_POLE_H #define BW_ONE_POLE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -463,7 +470,7 @@ static inline char bw_one_pole_state_is_valid(
* than or equal to that of `bw_one_pole_state`. * than or equal to that of `bw_one_pole_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -472,9 +479,13 @@ static inline char bw_one_pole_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -1238,13 +1249,16 @@ static inline char bw_one_pole_state_is_valid(
#undef BW_ONE_POLE_PARAM_CUTOFF_DOWN #undef BW_ONE_POLE_PARAM_CUTOFF_DOWN
#undef BW_ONE_POLE_PARAM_STICKY_THRESH #undef BW_ONE_POLE_PARAM_STICKY_THRESH
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -1264,33 +1278,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -1360,14 +1374,14 @@ inline void OnePole<N_CHANNELS>::reset(
bw_one_pole_reset_state(&coeffs, states + i, x0); bw_one_pole_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OnePole<N_CHANNELS>::reset( inline void OnePole<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OnePole<N_CHANNELS>::reset( inline void OnePole<N_CHANNELS>::reset(
@ -1377,14 +1391,14 @@ inline void OnePole<N_CHANNELS>::reset(
bw_one_pole_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_one_pole_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OnePole<N_CHANNELS>::reset( inline void OnePole<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OnePole<N_CHANNELS>::process( inline void OnePole<N_CHANNELS>::process(
@ -1394,7 +1408,7 @@ inline void OnePole<N_CHANNELS>::process(
bw_one_pole_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_one_pole_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OnePole<N_CHANNELS>::process( inline void OnePole<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1402,7 +1416,7 @@ inline void OnePole<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OnePole<N_CHANNELS>::setCutoff( inline void OnePole<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common }}} * requires {{{ bw_common }}}
* description {{{ * description {{{
* Post-filter to decolorate oscillator waveshapers when antialiasing is on. * Post-filter to decolorate oscillator waveshapers when antialiasing is on.
@ -33,8 +33,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
* <code>bw_osc_filt_process_multi()</code> to ensure that buffers * <code>bw_osc_filt_process_multi()</code> to ensure that buffers
* used for both input and output appear at the same channel * used for both input and output appear at the same channel
@ -98,9 +101,13 @@
#ifndef BW_OSC_FILT_H #ifndef BW_OSC_FILT_H
#define BW_OSC_FILT_H #define BW_OSC_FILT_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -183,7 +190,7 @@ static inline char bw_osc_filt_state_is_valid(
* than or equal to that of `bw_osc_filt_state`. * than or equal to that of `bw_osc_filt_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -192,7 +199,7 @@ static inline char bw_osc_filt_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -319,13 +326,16 @@ static inline char bw_osc_filt_state_is_valid(
return bw_is_finite(state->z1); return bw_is_finite(state->z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -342,33 +352,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<... /*! <<<...
* } * }
* ``` * ```
@ -402,14 +412,14 @@ inline void OscFilt<N_CHANNELS>::reset(
bw_osc_filt_reset_state(states + i, x0); bw_osc_filt_reset_state(states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscFilt<N_CHANNELS>::reset( inline void OscFilt<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscFilt<N_CHANNELS>::reset( inline void OscFilt<N_CHANNELS>::reset(
@ -418,14 +428,14 @@ inline void OscFilt<N_CHANNELS>::reset(
bw_osc_filt_reset_state_multi(statesP, x0, y0, N_CHANNELS); bw_osc_filt_reset_state_multi(statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscFilt<N_CHANNELS>::reset( inline void OscFilt<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscFilt<N_CHANNELS>::process( inline void OscFilt<N_CHANNELS>::process(
@ -435,7 +445,7 @@ inline void OscFilt<N_CHANNELS>::process(
bw_osc_filt_process_multi(statesP, x, y, N_CHANNELS, nSamples); bw_osc_filt_process_multi(statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscFilt<N_CHANNELS>::process( inline void OscFilt<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -443,7 +453,7 @@ inline void OscFilt<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Pulse oscillator waveshaper with variable pulse width (actually, duty * Pulse oscillator waveshaper with variable pulse width (actually, duty
@ -37,8 +37,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_osc_pulse_process()</code> * <li>Added debugging checks from <code>bw_osc_pulse_process()</code>
* to <code>bw_osc_pulse_process_multi()</code>.</li> * to <code>bw_osc_pulse_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -107,9 +110,13 @@
#ifndef BW_OSC_PULSE_H #ifndef BW_OSC_PULSE_H
#define BW_OSC_PULSE_H #define BW_OSC_PULSE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -262,7 +269,7 @@ static inline char bw_osc_pulse_coeffs_is_valid(
* than or equal to that of `bw_osc_pulse_coeffs`. * than or equal to that of `bw_osc_pulse_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -271,10 +278,15 @@ static inline char bw_osc_pulse_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -574,13 +586,16 @@ static inline char bw_osc_pulse_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -604,13 +619,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<const float *, N_CHANNELS> xInc, std::array<const float *, N_CHANNELS> xInc,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setAntialiasing( void setAntialiasing(
bool value); bool value);
@ -656,7 +671,7 @@ inline void OscPulse<N_CHANNELS>::process(
bw_osc_pulse_process_multi(&coeffs, x, xInc, y, N_CHANNELS, nSamples); bw_osc_pulse_process_multi(&coeffs, x, xInc, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscPulse<N_CHANNELS>::process( inline void OscPulse<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -665,7 +680,7 @@ inline void OscPulse<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), xInc.data(), y.data(), nSamples); process(x.data(), xInc.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscPulse<N_CHANNELS>::setAntialiasing( inline void OscPulse<N_CHANNELS>::setAntialiasing(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* Sawtooth oscillator waveshaper with PolyBLEP antialiasing. * Sawtooth oscillator waveshaper with PolyBLEP antialiasing.
@ -36,8 +36,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
* <code>bw_osc_saw_process_multi()</code> to ensure that * <code>bw_osc_saw_process_multi()</code> to ensure that
* <code>x_inc</code> is not <code>BW_NULL</code> when antialiasing * <code>x_inc</code> is not <code>BW_NULL</code> when antialiasing
@ -106,9 +109,13 @@
#ifndef BW_OSC_SAW_H #ifndef BW_OSC_SAW_H
#define BW_OSC_SAW_H #define BW_OSC_SAW_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -248,7 +255,7 @@ static inline char bw_osc_saw_coeffs_is_valid(
* than or equal to that of `bw_osc_saw_coeffs`. * than or equal to that of `bw_osc_saw_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -257,9 +264,13 @@ static inline char bw_osc_saw_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -499,13 +510,16 @@ static inline char bw_osc_saw_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -529,13 +543,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<const float *, N_CHANNELS> xInc, std::array<const float *, N_CHANNELS> xInc,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setAntialiasing( void setAntialiasing(
bool value); bool value);
@ -578,7 +592,7 @@ inline void OscSaw<N_CHANNELS>::process(
bw_osc_saw_process_multi(&coeffs, x, xInc, y, N_CHANNELS, nSamples); bw_osc_saw_process_multi(&coeffs, x, xInc, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscSaw<N_CHANNELS>::process( inline void OscSaw<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -587,7 +601,7 @@ inline void OscSaw<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), xInc.data(), y.data(), nSamples); process(x.data(), xInc.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscSaw<N_CHANNELS>::setAntialiasing( inline void OscSaw<N_CHANNELS>::setAntialiasing(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* Sinusoidal oscillator waveshaper. * Sinusoidal oscillator waveshaper.
@ -30,8 +30,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
* <code>bw_osc_sin_process_multi()</code> to ensure that buffers * <code>bw_osc_sin_process_multi()</code> to ensure that buffers
* used for both input and output appear at the same channel * used for both input and output appear at the same channel
@ -87,9 +90,13 @@
#ifndef BW_OSC_SIN_H #ifndef BW_OSC_SIN_H
#define BW_OSC_SIN_H #define BW_OSC_SIN_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -132,7 +139,7 @@ static inline void bw_osc_sin_process_multi(
* All samples in `x` must be in [`0.f`, `1.f`). * All samples in `x` must be in [`0.f`, `1.f`).
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -141,9 +148,13 @@ static inline void bw_osc_sin_process_multi(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -193,13 +204,16 @@ static inline void bw_osc_sin_process_multi(
bw_osc_sin_process(x[i], y[i], n_samples); bw_osc_sin_process(x[i], y[i], n_samples);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -213,13 +227,13 @@ void oscSinProcess(
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
void oscSinProcess( void oscSinProcess(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
/*! <<<``` /*! <<<```
* }}} */ * }}} */
@ -236,7 +250,7 @@ inline void oscSinProcess(
bw_osc_sin_process_multi(x, y, N_CHANNELS, nSamples); bw_osc_sin_process_multi(x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void oscSinProcess( inline void oscSinProcess(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -244,7 +258,7 @@ inline void oscSinProcess(
size_t nSamples) { size_t nSamples) {
oscSinProcess<N_CHANNELS>(x.data(), y.data(), nSamples); oscSinProcess<N_CHANNELS>(x.data(), y.data(), nSamples);
} }
#endif # endif
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Triangle oscillator waveshaper with variable slope (increasing time over * Triangle oscillator waveshaper with variable slope (increasing time over
@ -37,8 +37,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_osc_tri_process()</code> to * <li>Added debugging checks from <code>bw_osc_tri_process()</code> to
* <code>bw_osc_tri_process_multi()</code>.</li> * <code>bw_osc_tri_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -109,9 +112,13 @@
#ifndef BW_OSC_TRI_H #ifndef BW_OSC_TRI_H
#define BW_OSC_TRI_H #define BW_OSC_TRI_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -263,7 +270,7 @@ static inline char bw_osc_tri_coeffs_is_valid(
* than or equal to that of `bw_osc_tri_coeffs`. * than or equal to that of `bw_osc_tri_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -272,10 +279,15 @@ static inline char bw_osc_tri_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -581,13 +593,16 @@ static inline char bw_osc_tri_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -611,13 +626,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<const float *, N_CHANNELS> xInc, std::array<const float *, N_CHANNELS> xInc,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setAntialiasing( void setAntialiasing(
bool value); bool value);
@ -663,7 +678,7 @@ inline void OscTri<N_CHANNELS>::process(
bw_osc_tri_process_multi(&coeffs, x, xInc, y, N_CHANNELS, nSamples); bw_osc_tri_process_multi(&coeffs, x, xInc, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscTri<N_CHANNELS>::process( inline void OscTri<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -672,7 +687,7 @@ inline void OscTri<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), xInc.data(), y.data(), nSamples); process(x.data(), xInc.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void OscTri<N_CHANNELS>::setAntialiasing( inline void OscTri<N_CHANNELS>::setAntialiasing(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_one_pole }}} * requires {{{ bw_common bw_gain bw_math bw_one_pole }}}
* description {{{ * description {{{
* Stereo panner with -3 dB center pan law. * Stereo panner with -3 dB center pan law.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_pan_process()</code> to * <li>Added debugging checks from <code>bw_pan_process()</code> to
* <code>bw_pan_process_multi()</code>.</li> * <code>bw_pan_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_pan_process_multi()</code> to * <li>Added debugging checks in <code>bw_pan_process_multi()</code> to
@ -83,9 +86,13 @@
#ifndef BW_PAN_H #ifndef BW_PAN_H
#define BW_PAN_H #define BW_PAN_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -198,7 +205,7 @@ static inline char bw_pan_coeffs_is_valid(
* than or equal to that of `bw_pan_coeffs`. * than or equal to that of `bw_pan_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -207,10 +214,15 @@ static inline char bw_pan_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_gain.h> # include "bw_math.h"
# include "bw_gain.h"
#else
# include <bw_math.h>
# include <bw_gain.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -469,13 +481,16 @@ static inline char bw_pan_coeffs_is_valid(
return bw_gain_coeffs_is_valid(&coeffs->l_coeffs) && bw_gain_coeffs_is_valid(&coeffs->r_coeffs); return bw_gain_coeffs_is_valid(&coeffs->l_coeffs) && bw_gain_coeffs_is_valid(&coeffs->r_coeffs);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -499,13 +514,13 @@ public:
float * const * yR, float * const * yR,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> yL, std::array<float *, N_CHANNELS> yL,
std::array<float *, N_CHANNELS> yR, std::array<float *, N_CHANNELS> yR,
size_t nSamples); size_t nSamples);
#endif # endif
void setPan( void setPan(
float value); float value);
@ -548,7 +563,7 @@ inline void Pan<N_CHANNELS>::process(
bw_pan_process_multi(&coeffs, x, yL, yR, N_CHANNELS, nSamples); bw_pan_process_multi(&coeffs, x, yL, yR, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Pan<N_CHANNELS>::process( inline void Pan<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -557,7 +572,7 @@ inline void Pan<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), yL.data(), yR.data(), nSamples); process(x.data(), yL.data(), yR.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Pan<N_CHANNELS>::setPan( inline void Pan<N_CHANNELS>::setPan(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}} * requires {{{ bw_common bw_gain bw_math bw_mm2 bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Second-order peak filter with unitary gain at DC and asymptotically * Second-order peak filter with unitary gain at DC and asymptotically
@ -35,8 +35,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Enforced limits on bandwidth and peak_gain also in * <li>Enforced limits on bandwidth and peak_gain also in
* <code>bw_peak_reset_state*()</code> and clarified * <code>bw_peak_reset_state*()</code> and clarified
* documentation.</li> * documentation.</li>
@ -110,9 +113,13 @@
#ifndef BW_PEAK_H #ifndef BW_PEAK_H
#define BW_PEAK_H #define BW_PEAK_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -376,7 +383,7 @@ static inline char bw_peak_state_is_valid(
* than or equal to that of `bw_peak_state`. * than or equal to that of `bw_peak_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -385,10 +392,15 @@ static inline char bw_peak_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_mm2.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_math.h> # include "bw_mm2.h"
# include "bw_math.h"
#else
# include <bw_mm2.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -902,13 +914,16 @@ static inline char bw_peak_state_is_valid(
#undef BW_PEAK_PARAM_PEAK_GAIN #undef BW_PEAK_PARAM_PEAK_GAIN
#undef BW_PEAK_PARAM_BANDWIDTH #undef BW_PEAK_PARAM_BANDWIDTH
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -928,33 +943,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -1021,14 +1036,14 @@ inline void Peak<N_CHANNELS>::reset(
bw_peak_reset_state(&coeffs, states + i, x0); bw_peak_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Peak<N_CHANNELS>::reset( inline void Peak<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : y0); reset(x0, y0 != nullptr ? y0->data() : y0);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Peak<N_CHANNELS>::reset( inline void Peak<N_CHANNELS>::reset(
@ -1038,14 +1053,14 @@ inline void Peak<N_CHANNELS>::reset(
bw_peak_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_peak_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Peak<N_CHANNELS>::reset( inline void Peak<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Peak<N_CHANNELS>::process( inline void Peak<N_CHANNELS>::process(
@ -1055,7 +1070,7 @@ inline void Peak<N_CHANNELS>::process(
bw_peak_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_peak_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Peak<N_CHANNELS>::process( inline void Peak<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1063,7 +1078,7 @@ inline void Peak<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Peak<N_CHANNELS>::setCutoff( inline void Peak<N_CHANNELS>::setCutoff(

View File

@ -32,6 +32,9 @@
* <li>Version <strong>1.2.0</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added phase_inc_min and phase_inc_max parameters.</li> * <li>Added phase_inc_min and phase_inc_max parameters.</li>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Fixed rounding bug when frequency is tiny (again).</li> * <li>Fixed rounding bug when frequency is tiny (again).</li>
* <li>Added debugging checks from <code>bw_phase_gen_process()</code> * <li>Added debugging checks from <code>bw_phase_gen_process()</code>
* to <code>bw_phase_gen_process_multi()</code>.</li> * to <code>bw_phase_gen_process_multi()</code>.</li>
@ -121,9 +124,13 @@
#ifndef BW_PHASE_GEN_H #ifndef BW_PHASE_GEN_H
#define BW_PHASE_GEN_H #define BW_PHASE_GEN_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -371,7 +378,7 @@ static inline char bw_phase_gen_state_is_valid(
* than or equal to that of `bw_phase_gen_state`. * than or equal to that of `bw_phase_gen_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -380,10 +387,15 @@ static inline char bw_phase_gen_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -1028,13 +1040,16 @@ static inline char bw_phase_gen_state_is_valid(
return bw_is_finite(state->phase) && state->phase >= 0.f && state->phase < 1.f; return bw_is_finite(state->phase) && state->phase >= 0.f && state->phase < 1.f;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -1055,24 +1070,24 @@ public:
float * BW_RESTRICT y0 = nullptr, float * BW_RESTRICT y0 = nullptr,
float * BW_RESTRICT yInc0 = nullptr); float * BW_RESTRICT yInc0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float phase0, float phase0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0, std::array<float, N_CHANNELS> * BW_RESTRICT y0,
std::array<float, N_CHANNELS> * BW_RESTRICT yInc0); std::array<float, N_CHANNELS> * BW_RESTRICT yInc0);
#endif # endif
void reset( void reset(
const float * phase0, const float * phase0,
float * y0 = nullptr, float * y0 = nullptr,
float * yInc0 = nullptr); float * yInc0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> phase0, std::array<float, N_CHANNELS> phase0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr, std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr,
std::array<float, N_CHANNELS> * BW_RESTRICT yInc0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT yInc0 = nullptr);
#endif # endif
void process( void process(
const float * const * xMod, const float * const * xMod,
@ -1080,13 +1095,13 @@ public:
float * const * yInc, float * const * yInc,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> xMod, std::array<const float *, N_CHANNELS> xMod,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
std::array<float *, N_CHANNELS> yInc, std::array<float *, N_CHANNELS> yInc,
size_t nSamples); size_t nSamples);
#endif # endif
void setFrequency( void setFrequency(
float value); float value);
@ -1159,7 +1174,7 @@ inline void PhaseGen<N_CHANNELS>::reset(
} }
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PhaseGen<N_CHANNELS>::reset( inline void PhaseGen<N_CHANNELS>::reset(
float phase0, float phase0,
@ -1167,7 +1182,7 @@ inline void PhaseGen<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT yInc0) { std::array<float, N_CHANNELS> * BW_RESTRICT yInc0) {
reset(phase0, y0 != nullptr ? y0->data() : nullptr, yInc0 != nullptr ? yInc0->data() : nullptr); reset(phase0, y0 != nullptr ? y0->data() : nullptr, yInc0 != nullptr ? yInc0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PhaseGen<N_CHANNELS>::reset( inline void PhaseGen<N_CHANNELS>::reset(
@ -1178,7 +1193,7 @@ inline void PhaseGen<N_CHANNELS>::reset(
bw_phase_gen_reset_state_multi(&coeffs, statesP, phase0, y0, yInc0, N_CHANNELS); bw_phase_gen_reset_state_multi(&coeffs, statesP, phase0, y0, yInc0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PhaseGen<N_CHANNELS>::reset( inline void PhaseGen<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> phase0, std::array<float, N_CHANNELS> phase0,
@ -1186,7 +1201,7 @@ inline void PhaseGen<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT yInc0) { std::array<float, N_CHANNELS> * BW_RESTRICT yInc0) {
reset(phase0.data(), y0 != nullptr ? y0->data() : nullptr, yInc0 != nullptr ? yInc0->data() : nullptr); reset(phase0.data(), y0 != nullptr ? y0->data() : nullptr, yInc0 != nullptr ? yInc0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PhaseGen<N_CHANNELS>::process( inline void PhaseGen<N_CHANNELS>::process(
@ -1197,7 +1212,7 @@ inline void PhaseGen<N_CHANNELS>::process(
bw_phase_gen_process_multi(&coeffs, statesP, xMod, y, yInc, N_CHANNELS, nSamples); bw_phase_gen_process_multi(&coeffs, statesP, xMod, y, yInc, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PhaseGen<N_CHANNELS>::process( inline void PhaseGen<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> xMod, std::array<const float *, N_CHANNELS> xMod,
@ -1206,7 +1221,7 @@ inline void PhaseGen<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(xMod.data(), y.data(), yInc.data(), nSamples); process(xMod.data(), y.data(), yInc.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PhaseGen<N_CHANNELS>::setFrequency( inline void PhaseGen<N_CHANNELS>::setFrequency(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_ap1 bw_common bw_lp1 bw_math bw_one_pole bw_osc_sin bw_phase_gen * bw_ap1 bw_common bw_lp1 bw_math bw_one_pole bw_osc_sin bw_phase_gen
* }}} * }}}
@ -30,8 +30,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Enforced limits on center and amount also in * <li>Enforced limits on center and amount also in
* <code>bw_phaser_reset_state*()</code> and clarified * <code>bw_phaser_reset_state*()</code> and clarified
* documentation.</li> * documentation.</li>
@ -96,9 +99,13 @@
#ifndef BW_PHASER_H #ifndef BW_PHASER_H
#define BW_PHASER_H #define BW_PHASER_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -290,7 +297,7 @@ static inline char bw_phaser_state_is_valid(
* than or equal to that of `bw_phaser_state`. * than or equal to that of `bw_phaser_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -299,12 +306,19 @@ static inline char bw_phaser_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_phase_gen.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_osc_sin.h> # include "bw_phase_gen.h"
#include <bw_ap1.h> # include "bw_osc_sin.h"
#include <bw_math.h> # include "bw_ap1.h"
# include "bw_math.h"
#else
# include <bw_phase_gen.h>
# include <bw_osc_sin.h>
# include <bw_ap1.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -688,13 +702,16 @@ static inline char bw_phaser_state_is_valid(
&& bw_ap1_state_is_valid(coeffs ? &coeffs->ap1_coeffs : BW_NULL, &state->ap1_state[3]); && bw_ap1_state_is_valid(coeffs ? &coeffs->ap1_coeffs : BW_NULL, &state->ap1_state[3]);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -714,33 +731,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setRate( void setRate(
float value); float value);
@ -792,14 +809,14 @@ inline void Phaser<N_CHANNELS>::reset(
bw_phaser_reset_state(&coeffs, states + i, x0); bw_phaser_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Phaser<N_CHANNELS>::reset( inline void Phaser<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Phaser<N_CHANNELS>::reset( inline void Phaser<N_CHANNELS>::reset(
@ -809,14 +826,14 @@ inline void Phaser<N_CHANNELS>::reset(
bw_phaser_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_phaser_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Phaser<N_CHANNELS>::reset( inline void Phaser<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Phaser<N_CHANNELS>::process( inline void Phaser<N_CHANNELS>::process(
@ -826,7 +843,7 @@ inline void Phaser<N_CHANNELS>::process(
bw_phaser_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_phaser_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Phaser<N_CHANNELS>::process( inline void Phaser<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -834,7 +851,7 @@ inline void Phaser<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Phaser<N_CHANNELS>::setRate( inline void Phaser<N_CHANNELS>::setRate(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common }}} * requires {{{ bw_common }}}
* description {{{ * description {{{
* Pinking filter. * Pinking filter.
@ -40,8 +40,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
* <code>bw_pink_filt_process_multi()</code> to ensure that buffers * <code>bw_pink_filt_process_multi()</code> to ensure that buffers
* used for both input and output appear at the same channel * used for both input and output appear at the same channel
@ -122,9 +125,13 @@
#ifndef BW_PINK_FILT_H #ifndef BW_PINK_FILT_H
#define BW_PINK_FILT_H #define BW_PINK_FILT_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -311,7 +318,7 @@ static inline char bw_pink_filt_state_is_valid(
* than or equal to that of `bw_pink_filt_state`. * than or equal to that of `bw_pink_filt_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -320,7 +327,7 @@ static inline char bw_pink_filt_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -655,13 +662,16 @@ static inline char bw_pink_filt_state_is_valid(
return bw_is_finite(state->s1_z1) && bw_is_finite(state->s2_z1) && bw_is_finite(state->s3_z1) && bw_is_finite(state->s4_z1); return bw_is_finite(state->s1_z1) && bw_is_finite(state->s2_z1) && bw_is_finite(state->s3_z1) && bw_is_finite(state->s4_z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -681,33 +691,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setSampleRateScaling( void setSampleRateScaling(
bool value); bool value);
@ -755,14 +765,14 @@ inline void PinkFilt<N_CHANNELS>::reset(
bw_pink_filt_reset_state(&coeffs, states + i, x0); bw_pink_filt_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PinkFilt<N_CHANNELS>::reset( inline void PinkFilt<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PinkFilt<N_CHANNELS>::reset( inline void PinkFilt<N_CHANNELS>::reset(
@ -772,14 +782,14 @@ inline void PinkFilt<N_CHANNELS>::reset(
bw_pink_filt_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_pink_filt_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PinkFilt<N_CHANNELS>::reset( inline void PinkFilt<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PinkFilt<N_CHANNELS>::process( inline void PinkFilt<N_CHANNELS>::process(
@ -789,7 +799,7 @@ inline void PinkFilt<N_CHANNELS>::process(
bw_pink_filt_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_pink_filt_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PinkFilt<N_CHANNELS>::process( inline void PinkFilt<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -797,7 +807,7 @@ inline void PinkFilt<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PinkFilt<N_CHANNELS>::setSampleRateScaling( inline void PinkFilt<N_CHANNELS>::setSampleRateScaling(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_env_follow bw_math bw_one_pole }}} * requires {{{ bw_common bw_env_follow bw_math bw_one_pole }}}
* description {{{ * description {{{
* Digital peak programme meter with adjustable integration time constant. * Digital peak programme meter with adjustable integration time constant.
@ -30,8 +30,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_ppm_process()</code> to * <li>Added debugging checks from <code>bw_ppm_process()</code> to
* <code>bw_ppm_process_multi()</code>.</li> * <code>bw_ppm_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_ppm_process_multi()</code> to * <li>Added debugging checks in <code>bw_ppm_process_multi()</code> to
@ -92,9 +95,13 @@
#ifndef BW_PPM_H #ifndef BW_PPM_H
#define BW_PPM_H #define BW_PPM_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -270,7 +277,7 @@ static inline char bw_ppm_state_is_valid(
* than or equal to that of `bw_ppm_state`. * than or equal to that of `bw_ppm_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -279,9 +286,13 @@ static inline char bw_ppm_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_env_follow.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_env_follow.h"
#else
# include <bw_env_follow.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -618,13 +629,16 @@ static inline char bw_ppm_state_is_valid(
return bw_env_follow_state_is_valid(coeffs ? &coeffs->env_follow_coeffs : BW_NULL, &state->env_follow_state); return bw_env_follow_state_is_valid(coeffs ? &coeffs->env_follow_coeffs : BW_NULL, &state->env_follow_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -644,33 +658,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setIntegrationTau( void setIntegrationTau(
float value); float value);
@ -719,14 +733,14 @@ inline void PPM<N_CHANNELS>::reset(
bw_ppm_reset_state(&coeffs, states + i, x0); bw_ppm_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PPM<N_CHANNELS>::reset( inline void PPM<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PPM<N_CHANNELS>::reset( inline void PPM<N_CHANNELS>::reset(
@ -736,14 +750,14 @@ inline void PPM<N_CHANNELS>::reset(
bw_ppm_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_ppm_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PPM<N_CHANNELS>::reset( inline void PPM<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PPM<N_CHANNELS>::process( inline void PPM<N_CHANNELS>::process(
@ -753,7 +767,7 @@ inline void PPM<N_CHANNELS>::process(
bw_ppm_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_ppm_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PPM<N_CHANNELS>::process( inline void PPM<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -761,7 +775,7 @@ inline void PPM<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void PPM<N_CHANNELS>::setIntegrationTau( inline void PPM<N_CHANNELS>::setIntegrationTau(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ utility }}} * module_type {{{ utility }}}
* version {{{ 1.0.1 }}} * version {{{ 1.1.0 }}}
* requires {{{ bw_common }}} * requires {{{ bw_common }}}
* description {{{ * description {{{
* Pseudo-random number generators. * Pseudo-random number generators.
@ -42,6 +42,12 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.0</strong>:
* <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code> and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul>
* </li>
* <li>Version <strong>1.0.1</strong>: * <li>Version <strong>1.0.1</strong>:
* <ul> * <ul>
* <li>Now using <code>BW_NULL</code>.</li> * <li>Now using <code>BW_NULL</code>.</li>
@ -77,9 +83,13 @@
#ifndef BW_RAND_H #ifndef BW_RAND_H
#define BW_RAND_H #define BW_RAND_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -109,13 +119,13 @@ static inline float bw_randf(
* between calls and which gets updated by this function. * between calls and which gets updated by this function.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
/*** Implementation ***/ /*** Implementation ***/
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -139,7 +149,7 @@ static inline float bw_randf(
return y; return y;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_buf bw_common bw_delay bw_dry_wet bw_gain bw_lp1 bw_math bw_one_pole * bw_buf bw_common bw_delay bw_dry_wet bw_gain bw_lp1 bw_math bw_one_pole
* bw_osc_sin bw_phase_gen * bw_osc_sin bw_phase_gen
@ -35,8 +35,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_reverb_process()</code> to * <li>Added debugging checks from <code>bw_reverb_process()</code> to
* <code>bw_reverb_process_multi()</code>.</li> * <code>bw_reverb_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_reverb_process_multi()</code> * <li>Added debugging checks in <code>bw_reverb_process_multi()</code>
@ -94,9 +97,13 @@
#ifndef BW_REVERB_H #ifndef BW_REVERB_H
#define BW_REVERB_H #define BW_REVERB_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -340,7 +347,7 @@ static inline char bw_reverb_state_is_valid(
* than or equal to that of `bw_reverb_state`. * than or equal to that of `bw_reverb_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -349,16 +356,27 @@ static inline char bw_reverb_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_delay.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_lp1.h> # include "bw_delay.h"
#include <bw_phase_gen.h> # include "bw_lp1.h"
#include <bw_osc_sin.h> # include "bw_phase_gen.h"
#include <bw_gain.h> # include "bw_osc_sin.h"
#include <bw_dry_wet.h> # include "bw_gain.h"
#include <bw_one_pole.h> # include "bw_dry_wet.h"
#include <bw_math.h> # include "bw_one_pole.h"
# include "bw_math.h"
#else
# include <bw_delay.h>
# include <bw_lp1.h>
# include <bw_phase_gen.h>
# include <bw_osc_sin.h>
# include <bw_gain.h>
# include <bw_dry_wet.h>
# include <bw_one_pole.h>
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -1224,8 +1242,11 @@ static inline char bw_reverb_state_is_valid(
&& bw_delay_state_is_valid(coeffs ? &coeffs->delay_d4_coeffs : BW_NULL, &state->delay_d4_state); && bw_delay_state_is_valid(coeffs ? &coeffs->delay_d4_coeffs : BW_NULL, &state->delay_d4_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
#ifndef BW_CXX_NO_ARRAY #ifndef BW_CXX_NO_ARRAY
# include <array> # include <array>
@ -1254,13 +1275,13 @@ public:
float * BW_RESTRICT yL0 = nullptr, float * BW_RESTRICT yL0 = nullptr,
float * BW_RESTRICT yR0 = nullptr); float * BW_RESTRICT yR0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float xL0, float xL0,
float xR0, float xR0,
std::array<float, N_CHANNELS> * BW_RESTRICT yL0, std::array<float, N_CHANNELS> * BW_RESTRICT yL0,
std::array<float, N_CHANNELS> * BW_RESTRICT yR0); std::array<float, N_CHANNELS> * BW_RESTRICT yR0);
#endif # endif
void reset( void reset(
const float * xL0, const float * xL0,
@ -1268,13 +1289,13 @@ public:
float * yL0 = nullptr, float * yL0 = nullptr,
float * yR0 = nullptr); float * yR0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> xL0, std::array<float, N_CHANNELS> xL0,
std::array<float, N_CHANNELS> xR0, std::array<float, N_CHANNELS> xR0,
std::array<float, N_CHANNELS> * BW_RESTRICT yL0 = nullptr, std::array<float, N_CHANNELS> * BW_RESTRICT yL0 = nullptr,
std::array<float, N_CHANNELS> * BW_RESTRICT yR0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT yR0 = nullptr);
#endif # endif
void process( void process(
const float * const * xL, const float * const * xL,
@ -1283,14 +1304,14 @@ public:
float * const * yR, float * const * yR,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> xL, std::array<const float *, N_CHANNELS> xL,
std::array<const float *, N_CHANNELS> xR, std::array<const float *, N_CHANNELS> xR,
std::array<float *, N_CHANNELS> yL, std::array<float *, N_CHANNELS> yL,
std::array<float *, N_CHANNELS> yR, std::array<float *, N_CHANNELS> yR,
size_t nSamples); size_t nSamples);
#endif # endif
void setPredelay( void setPredelay(
float value); float value);
@ -1379,7 +1400,7 @@ inline void Reverb<N_CHANNELS>::reset(
} }
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Reverb<N_CHANNELS>::reset( inline void Reverb<N_CHANNELS>::reset(
float xL0, float xL0,
@ -1388,7 +1409,7 @@ inline void Reverb<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT yR0) { std::array<float, N_CHANNELS> * BW_RESTRICT yR0) {
reset(xL0, xR0, yL0 != nullptr ? yL0->data() : nullptr, yR0 != nullptr ? yR0->data() : nullptr); reset(xL0, xR0, yL0 != nullptr ? yL0->data() : nullptr, yR0 != nullptr ? yR0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Reverb<N_CHANNELS>::reset( inline void Reverb<N_CHANNELS>::reset(
@ -1400,7 +1421,7 @@ inline void Reverb<N_CHANNELS>::reset(
bw_reverb_reset_state_multi(&coeffs, statesP, xL0, xR0, yL0, yR0, N_CHANNELS); bw_reverb_reset_state_multi(&coeffs, statesP, xL0, xR0, yL0, yR0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Reverb<N_CHANNELS>::reset( inline void Reverb<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> xL0, std::array<float, N_CHANNELS> xL0,
@ -1409,7 +1430,7 @@ inline void Reverb<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT yR0) { std::array<float, N_CHANNELS> * BW_RESTRICT yR0) {
reset(xL0.data(), xR0.data(), yL0 != nullptr ? yL0->data() : nullptr, yR0 != nullptr ? yR0->data() : nullptr); reset(xL0.data(), xR0.data(), yL0 != nullptr ? yL0->data() : nullptr, yR0 != nullptr ? yR0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Reverb<N_CHANNELS>::process( inline void Reverb<N_CHANNELS>::process(
@ -1421,7 +1442,7 @@ inline void Reverb<N_CHANNELS>::process(
bw_reverb_process_multi(&coeffs, statesP, xL, xR, yL, yR, N_CHANNELS, nSamples); bw_reverb_process_multi(&coeffs, statesP, xL, xR, yL, yR, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Reverb<N_CHANNELS>::process( inline void Reverb<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> xL, std::array<const float *, N_CHANNELS> xL,
@ -1431,7 +1452,7 @@ inline void Reverb<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(xL.data(), xR.data(), yL.data(), yR.data(), nSamples); process(xL.data(), xR.data(), yL.data(), yR.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Reverb<N_CHANNELS>::setPredelay( inline void Reverb<N_CHANNELS>::setPredelay(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Ring modulator with variable modulation amount. * Ring modulator with variable modulation amount.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_ring_mod_process()</code> * <li>Added debugging checks from <code>bw_ring_mod_process()</code>
* to <code>bw_ring_mod_process_multi()</code>.</li> * to <code>bw_ring_mod_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -85,9 +88,13 @@
#ifndef BW_RINGMOD_H #ifndef BW_RINGMOD_H
#define BW_RINGMOD_H #define BW_RINGMOD_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -201,7 +208,7 @@ static inline char bw_ring_mod_coeffs_is_valid(
* than or equal to that of `bw_ring_mod_coeffs`. * than or equal to that of `bw_ring_mod_coeffs`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -210,10 +217,15 @@ static inline char bw_ring_mod_coeffs_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -440,13 +452,16 @@ static inline char bw_ring_mod_coeffs_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -470,13 +485,13 @@ public:
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> xMod, std::array<const float *, N_CHANNELS> xMod,
std::array<const float *, N_CHANNELS> xCar, std::array<const float *, N_CHANNELS> xCar,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setAmount(float value); void setAmount(float value);
/*! <<<... /*! <<<...
@ -518,7 +533,7 @@ inline void RingMod<N_CHANNELS>::process(
bw_ring_mod_process_multi(&coeffs, xMod, xCar, y, N_CHANNELS, nSamples); bw_ring_mod_process_multi(&coeffs, xMod, xCar, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void RingMod<N_CHANNELS>::process( inline void RingMod<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> xMod, std::array<const float *, N_CHANNELS> xMod,
@ -527,7 +542,7 @@ inline void RingMod<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(xMod.data(), xCar.data(), y.data(), nSamples); process(xMod.data(), xCar.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void RingMod<N_CHANNELS>::setAmount( inline void RingMod<N_CHANNELS>::setAmount(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* Antialiased tanh-based saturation with parametric bias and gain * Antialiased tanh-based saturation with parametric bias and gain
@ -45,8 +45,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_satur_process()</code> to * <li>Added debugging checks from <code>bw_satur_process()</code> to
* <code>bw_satur_process_multi()</code>.</li> * <code>bw_satur_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_satur_process_multi()</code> * <li>Added debugging checks in <code>bw_satur_process_multi()</code>
@ -115,9 +118,13 @@
#ifndef BW_SATUR_H #ifndef BW_SATUR_H
#define BW_SATUR_H #define BW_SATUR_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -311,7 +318,7 @@ static inline char bw_satur_state_is_valid(
* than or equal to that of `bw_satur_state`. * than or equal to that of `bw_satur_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -320,10 +327,15 @@ static inline char bw_satur_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -765,13 +777,16 @@ static inline char bw_satur_state_is_valid(
return bw_is_finite(state->x_z1) && bw_is_finite(state->F_z1); return bw_is_finite(state->x_z1) && bw_is_finite(state->F_z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -791,33 +806,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setBias( void setBias(
float value); float value);
@ -869,14 +884,14 @@ inline void Satur<N_CHANNELS>::reset(
bw_satur_reset_state(&coeffs, states + i, x0); bw_satur_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Satur<N_CHANNELS>::reset( inline void Satur<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Satur<N_CHANNELS>::reset( inline void Satur<N_CHANNELS>::reset(
@ -886,14 +901,14 @@ inline void Satur<N_CHANNELS>::reset(
bw_satur_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_satur_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Satur<N_CHANNELS>::reset( inline void Satur<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Satur<N_CHANNELS>::process( inline void Satur<N_CHANNELS>::process(
@ -903,7 +918,7 @@ inline void Satur<N_CHANNELS>::process(
bw_satur_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_satur_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Satur<N_CHANNELS>::process( inline void Satur<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -911,7 +926,7 @@ inline void Satur<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Satur<N_CHANNELS>::setBias( inline void Satur<N_CHANNELS>::setBias(

View File

@ -20,15 +20,18 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* Slew-rate limiter with separate maximum increasing and decreasing rates. * Slew-rate limiter with separate maximum increasing and decreasing rates.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_slew_lim_process()</code> * <li>Added debugging checks from <code>bw_slew_lim_process()</code>
* to <code>bw_slew_lim_process_multi()</code>.</li> * to <code>bw_slew_lim_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -99,9 +102,13 @@
#ifndef BW_SLEW_LIM_H #ifndef BW_SLEW_LIM_H
#define BW_SLEW_LIM_H #define BW_SLEW_LIM_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -339,7 +346,7 @@ static inline char bw_slew_lim_state_is_valid(
* than or equal to that of `bw_slew_lim_state`. * than or equal to that of `bw_slew_lim_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -348,9 +355,13 @@ static inline char bw_slew_lim_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -892,13 +903,16 @@ static inline char bw_slew_lim_state_is_valid(
return bw_is_finite(state->y_z1); return bw_is_finite(state->y_z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -918,33 +932,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setMaxRate( void setMaxRate(
float value); float value);
@ -999,14 +1013,14 @@ inline void SlewLim<N_CHANNELS>::reset(
bw_slew_lim_reset_state(&coeffs, states + i, x0); bw_slew_lim_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SlewLim<N_CHANNELS>::reset( inline void SlewLim<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SlewLim<N_CHANNELS>::reset( inline void SlewLim<N_CHANNELS>::reset(
@ -1016,14 +1030,14 @@ inline void SlewLim<N_CHANNELS>::reset(
bw_slew_lim_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_slew_lim_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SlewLim<N_CHANNELS>::reset( inline void SlewLim<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SlewLim<N_CHANNELS>::process( inline void SlewLim<N_CHANNELS>::process(
@ -1033,7 +1047,7 @@ inline void SlewLim<N_CHANNELS>::process(
bw_slew_lim_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_slew_lim_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SlewLim<N_CHANNELS>::process( inline void SlewLim<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1041,7 +1055,7 @@ inline void SlewLim<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SlewLim<N_CHANNELS>::setMaxRate( inline void SlewLim<N_CHANNELS>::setMaxRate(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* Sample rate reducer. * Sample rate reducer.
@ -31,8 +31,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_sr_reduce_process()</code> * <li>Added debugging checks from <code>bw_sr_reduce_process()</code>
* to <code>bw_sr_reduce_process_multi()</code>.</li> * to <code>bw_sr_reduce_process_multi()</code>.</li>
* <li>Added debugging checks in * <li>Added debugging checks in
@ -101,9 +104,13 @@
#ifndef BW_SR_REDUCE_H #ifndef BW_SR_REDUCE_H
#define BW_SR_REDUCE_H #define BW_SR_REDUCE_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -263,7 +270,7 @@ static inline char bw_sr_reduce_state_is_valid(
* than or equal to that of `bw_sr_reduce_state`. * than or equal to that of `bw_sr_reduce_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -272,9 +279,13 @@ static inline char bw_sr_reduce_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -578,13 +589,16 @@ static inline char bw_sr_reduce_state_is_valid(
return bw_is_finite(state->phase) && state->phase >= 0.f && bw_is_finite(state->y_z1); return bw_is_finite(state->phase) && state->phase >= 0.f && bw_is_finite(state->y_z1);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -604,33 +618,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setRatio( void setRatio(
float value); float value);
@ -676,14 +690,14 @@ inline void SRReduce<N_CHANNELS>::reset(
bw_sr_reduce_reset_state(&coeffs, states + i, x0); bw_sr_reduce_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRReduce<N_CHANNELS>::reset( inline void SRReduce<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRReduce<N_CHANNELS>::reset( inline void SRReduce<N_CHANNELS>::reset(
@ -693,14 +707,14 @@ inline void SRReduce<N_CHANNELS>::reset(
bw_sr_reduce_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_sr_reduce_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRReduce<N_CHANNELS>::reset( inline void SRReduce<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRReduce<N_CHANNELS>::process( inline void SRReduce<N_CHANNELS>::process(
@ -710,7 +724,7 @@ inline void SRReduce<N_CHANNELS>::process(
bw_sr_reduce_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_sr_reduce_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRReduce<N_CHANNELS>::process( inline void SRReduce<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -718,7 +732,7 @@ inline void SRReduce<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRReduce<N_CHANNELS>::setRatio(float value) { inline void SRReduce<N_CHANNELS>::setRatio(float value) {

View File

@ -20,13 +20,20 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.0 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* Aribtrary-ratio IIR sample rate converter. * Aribtrary-ratio IIR sample rate converter.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.2.0</strong>:
* <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul>
* </li>
* <li>Version <strong>1.1.0</strong>: * <li>Version <strong>1.1.0</strong>:
* <ul> * <ul>
* <li>Now using <code>BW_NULL</code> and * <li>Now using <code>BW_NULL</code> and
@ -79,9 +86,13 @@
#ifndef BW_SRC_H #ifndef BW_SRC_H
#define BW_SRC_H #define BW_SRC_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -213,7 +224,7 @@ static inline char bw_src_state_is_valid(
* than or equal to that of `bw_src_state`. * than or equal to that of `bw_src_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -222,9 +233,13 @@ static inline char bw_src_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -521,13 +536,16 @@ static inline char bw_src_state_is_valid(
&& bw_is_finite(state->xz3); && bw_is_finite(state->xz3);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -545,21 +563,21 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * BW_RESTRICT const * BW_RESTRICT x, const float * BW_RESTRICT const * BW_RESTRICT x,
@ -567,13 +585,13 @@ public:
size_t * BW_RESTRICT nInSamples, size_t * BW_RESTRICT nInSamples,
size_t * BW_RESTRICT nOutSamples); size_t * BW_RESTRICT nOutSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float * BW_RESTRICT, N_CHANNELS> x, std::array<const float * BW_RESTRICT, N_CHANNELS> x,
std::array<float * BW_RESTRICT, N_CHANNELS> y, std::array<float * BW_RESTRICT, N_CHANNELS> y,
std::array<size_t, N_CHANNELS> & nInSamples, std::array<size_t, N_CHANNELS> & nInSamples,
std::array<size_t, N_CHANNELS> & nOutSamples); std::array<size_t, N_CHANNELS> & nOutSamples);
#endif # endif
/*! <<<... /*! <<<...
* } * }
* ``` * ```
@ -610,14 +628,14 @@ inline void SRC<N_CHANNELS>::reset(
bw_src_reset_state(&coeffs, states + i, x0); bw_src_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRC<N_CHANNELS>::reset( inline void SRC<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRC<N_CHANNELS>::reset( inline void SRC<N_CHANNELS>::reset(
@ -626,14 +644,14 @@ inline void SRC<N_CHANNELS>::reset(
bw_src_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_src_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRC<N_CHANNELS>::reset( inline void SRC<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRC<N_CHANNELS>::process( inline void SRC<N_CHANNELS>::process(
@ -644,7 +662,7 @@ inline void SRC<N_CHANNELS>::process(
bw_src_process_multi(coeffs, statesP, x, y, N_CHANNELS, nInSamples, nOutSamples); bw_src_process_multi(coeffs, statesP, x, y, N_CHANNELS, nInSamples, nOutSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRC<N_CHANNELS>::process( inline void SRC<N_CHANNELS>::process(
std::array<const float * BW_RESTRICT, N_CHANNELS> x, std::array<const float * BW_RESTRICT, N_CHANNELS> x,
@ -653,7 +671,7 @@ inline void SRC<N_CHANNELS>::process(
std::array<size_t, N_CHANNELS> & nOutSamples) { std::array<size_t, N_CHANNELS> & nOutSamples) {
process(x.data(), y.data(), nInSamples.data(), nOutSamples.data()); process(x.data(), y.data(), nInSamples.data(), nOutSamples.data());
} }
#endif # endif
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.0 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math }}} * requires {{{ bw_common bw_math }}}
* description {{{ * description {{{
* Integer-ratio IIR sample rate converter. * Integer-ratio IIR sample rate converter.
@ -33,6 +33,13 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.2.0</strong>:
* <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul>
* </li>
* <li>Version <strong>1.1.0</strong>: * <li>Version <strong>1.1.0</strong>:
* <ul> * <ul>
* <li>Now using <code>BW_NULL</code> and * <li>Now using <code>BW_NULL</code> and
@ -85,9 +92,13 @@
#ifndef BW_SRC_INT_H #ifndef BW_SRC_INT_H
#define BW_SRC_INT_H #define BW_SRC_INT_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -221,7 +232,7 @@ static inline char bw_src_int_state_is_valid(
* than or equal to that of `bw_src_int_state`. * than or equal to that of `bw_src_int_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -230,9 +241,13 @@ static inline char bw_src_int_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_math.h"
#else
# include <bw_math.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -496,13 +511,16 @@ static inline char bw_src_int_state_is_valid(
&& bw_is_finite(state->z4); && bw_is_finite(state->z4);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -520,21 +538,21 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * BW_RESTRICT const * BW_RESTRICT x, const float * BW_RESTRICT const * BW_RESTRICT x,
@ -542,13 +560,13 @@ public:
size_t nInSamples, size_t nInSamples,
size_t * BW_RESTRICT nOutSamples = nullptr); size_t * BW_RESTRICT nOutSamples = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float * BW_RESTRICT, N_CHANNELS> x, std::array<const float * BW_RESTRICT, N_CHANNELS> x,
std::array<float * BW_RESTRICT, N_CHANNELS> y, std::array<float * BW_RESTRICT, N_CHANNELS> y,
size_t nInSamples, size_t nInSamples,
std::array<size_t, N_CHANNELS> * BW_RESTRICT nOutSamples = nullptr); std::array<size_t, N_CHANNELS> * BW_RESTRICT nOutSamples = nullptr);
#endif # endif
/*! <<<... /*! <<<...
* } * }
* ``` * ```
@ -585,14 +603,14 @@ inline void SRCInt<N_CHANNELS>::reset(
bw_src_int_reset_state(&coeffs, states + i, x0); bw_src_int_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRCInt<N_CHANNELS>::reset( inline void SRCInt<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRCInt<N_CHANNELS>::reset( inline void SRCInt<N_CHANNELS>::reset(
@ -601,14 +619,14 @@ inline void SRCInt<N_CHANNELS>::reset(
bw_src_int_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_src_int_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRCInt<N_CHANNELS>::reset( inline void SRCInt<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRCInt<N_CHANNELS>::process( inline void SRCInt<N_CHANNELS>::process(
@ -619,7 +637,7 @@ inline void SRCInt<N_CHANNELS>::process(
bw_src_int_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nInSamples, nOutSamples); bw_src_int_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nInSamples, nOutSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SRCInt<N_CHANNELS>::process( inline void SRCInt<N_CHANNELS>::process(
std::array<const float * BW_RESTRICT, N_CHANNELS> x, std::array<const float * BW_RESTRICT, N_CHANNELS> x,
@ -628,7 +646,7 @@ inline void SRCInt<N_CHANNELS>::process(
std::array<size_t, N_CHANNELS> * BW_RESTRICT nOutSamples) { std::array<size_t, N_CHANNELS> * BW_RESTRICT nOutSamples) {
process(x.data(), y.data(), nInSamples, nOutSamples ? nOutSamples->data() : nullptr); process(x.data(), y.data(), nInSamples, nOutSamples ? nOutSamples->data() : nullptr);
} }
#endif # endif
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole }}} * requires {{{ bw_common bw_math bw_one_pole }}}
* description {{{ * description {{{
* State variable filter (2nd order, 12 dB/oct) model with separated lowpass, * State variable filter (2nd order, 12 dB/oct) model with separated lowpass,
@ -28,8 +28,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_svf_process()</code> to * <li>Added debugging checks from <code>bw_svf_process()</code> to
* <code>bw_svf_process_multi()</code>.</li> * <code>bw_svf_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_svf_process_multi()</code> to * <li>Added debugging checks in <code>bw_svf_process_multi()</code> to
@ -115,9 +118,13 @@
#ifndef BW_SVF_H #ifndef BW_SVF_H
#define BW_SVF_H #define BW_SVF_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -334,7 +341,7 @@ static inline char bw_svf_state_is_valid(
* than or equal to that of `bw_svf_state`. * than or equal to that of `bw_svf_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -343,10 +350,15 @@ static inline char bw_svf_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_math.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_one_pole.h> # include "bw_math.h"
# include "bw_one_pole.h"
#else
# include <bw_math.h>
# include <bw_one_pole.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -1084,13 +1096,16 @@ static inline char bw_svf_state_is_valid(
return 1; return 1;
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -1112,13 +1127,13 @@ public:
float * BW_RESTRICT yBp0 = nullptr, float * BW_RESTRICT yBp0 = nullptr,
float * BW_RESTRICT yHp0 = nullptr); float * BW_RESTRICT yHp0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT yLp0, std::array<float, N_CHANNELS> * BW_RESTRICT yLp0,
std::array<float, N_CHANNELS> * BW_RESTRICT yBp0, std::array<float, N_CHANNELS> * BW_RESTRICT yBp0,
std::array<float, N_CHANNELS> * BW_RESTRICT yHp0); std::array<float, N_CHANNELS> * BW_RESTRICT yHp0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
@ -1126,13 +1141,13 @@ public:
float * yBp0 = nullptr, float * yBp0 = nullptr,
float * yHp0 = nullptr); float * yHp0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT yLp0 = nullptr, std::array<float, N_CHANNELS> * BW_RESTRICT yLp0 = nullptr,
std::array<float, N_CHANNELS> * BW_RESTRICT yBp0 = nullptr, std::array<float, N_CHANNELS> * BW_RESTRICT yBp0 = nullptr,
std::array<float, N_CHANNELS> * BW_RESTRICT yHp0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT yHp0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
@ -1141,14 +1156,14 @@ public:
float * const * yHp, float * const * yHp,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> yLp, std::array<float *, N_CHANNELS> yLp,
std::array<float *, N_CHANNELS> yBp, std::array<float *, N_CHANNELS> yBp,
std::array<float *, N_CHANNELS> yHp, std::array<float *, N_CHANNELS> yHp,
size_t nSamples); size_t nSamples);
#endif # endif
void setCutoff( void setCutoff(
float value); float value);
@ -1250,7 +1265,7 @@ inline void SVF<N_CHANNELS>::reset(
} }
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SVF<N_CHANNELS>::reset( inline void SVF<N_CHANNELS>::reset(
float x0, float x0,
@ -1259,7 +1274,7 @@ inline void SVF<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT yHp0) { std::array<float, N_CHANNELS> * BW_RESTRICT yHp0) {
reset(x0, yLp0 != nullptr ? yLp0->data() : nullptr, yBp0 != nullptr ? yBp0->data() : nullptr, yHp0 != nullptr ? yHp0->data() : nullptr); reset(x0, yLp0 != nullptr ? yLp0->data() : nullptr, yBp0 != nullptr ? yBp0->data() : nullptr, yHp0 != nullptr ? yHp0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SVF<N_CHANNELS>::reset( inline void SVF<N_CHANNELS>::reset(
@ -1271,7 +1286,7 @@ inline void SVF<N_CHANNELS>::reset(
bw_svf_reset_state_multi(&coeffs, statesP, x0, yLp0, yBp0, yHp0, N_CHANNELS); bw_svf_reset_state_multi(&coeffs, statesP, x0, yLp0, yBp0, yHp0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SVF<N_CHANNELS>::reset( inline void SVF<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
@ -1280,7 +1295,7 @@ inline void SVF<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> * BW_RESTRICT yHp0) { std::array<float, N_CHANNELS> * BW_RESTRICT yHp0) {
reset(x0.data(), yLp0 != nullptr ? yLp0->data() : nullptr, yBp0 != nullptr ? yBp0->data() : nullptr, yHp0 != nullptr ? yHp0->data() : nullptr); reset(x0.data(), yLp0 != nullptr ? yLp0->data() : nullptr, yBp0 != nullptr ? yBp0->data() : nullptr, yHp0 != nullptr ? yHp0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SVF<N_CHANNELS>::process( inline void SVF<N_CHANNELS>::process(
@ -1292,7 +1307,7 @@ inline void SVF<N_CHANNELS>::process(
bw_svf_process_multi(&coeffs, statesP, x, yLp, yBp, yHp, N_CHANNELS, nSamples); bw_svf_process_multi(&coeffs, statesP, x, yLp, yBp, yHp, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SVF<N_CHANNELS>::process( inline void SVF<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -1302,7 +1317,7 @@ inline void SVF<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), yLp.data(), yBp.data(), yHp.data(), nSamples); process(x.data(), yLp.data(), yBp.data(), yHp.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void SVF<N_CHANNELS>::setCutoff( inline void SVF<N_CHANNELS>::setCutoff(

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ * requires {{{
* bw_common bw_math bw_one_pole bw_osc_sin bw_phase_gen bw_ring_mod * bw_common bw_math bw_one_pole bw_osc_sin bw_phase_gen bw_ring_mod
* }}} * }}}
@ -29,8 +29,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_trem_process()</code> to * <li>Added debugging checks from <code>bw_trem_process()</code> to
* <code>bw_trem_process_multi()</code>.</li> * <code>bw_trem_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_trem_process_multi()</code> * <li>Added debugging checks in <code>bw_trem_process_multi()</code>
@ -90,9 +93,13 @@
#ifndef BW_TREM_H #ifndef BW_TREM_H
#define BW_TREM_H #define BW_TREM_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -266,7 +273,7 @@ static inline char bw_trem_state_is_valid(
* than or equal to that of `bw_trem_state`. * than or equal to that of `bw_trem_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -275,11 +282,17 @@ static inline char bw_trem_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_phase_gen.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_osc_sin.h> # include "bw_phase_gen.h"
#include <bw_ring_mod.h> # include "bw_osc_sin.h"
# include "bw_ring_mod.h"
#else
# include <bw_phase_gen.h>
# include <bw_osc_sin.h>
# include <bw_ring_mod.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -610,13 +623,16 @@ static inline char bw_trem_state_is_valid(
return bw_phase_gen_state_is_valid(coeffs ? &coeffs->phase_gen_coeffs : BW_NULL, &state->phase_gen_state); return bw_phase_gen_state_is_valid(coeffs ? &coeffs->phase_gen_coeffs : BW_NULL, &state->phase_gen_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -636,33 +652,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setRate( void setRate(
float value); float value);
@ -711,14 +727,14 @@ inline void Trem<N_CHANNELS>::reset(
bw_trem_reset_state(&coeffs, states + i, x0); bw_trem_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Trem<N_CHANNELS>::reset( inline void Trem<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Trem<N_CHANNELS>::reset( inline void Trem<N_CHANNELS>::reset(
@ -728,14 +744,14 @@ inline void Trem<N_CHANNELS>::reset(
bw_trem_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_trem_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Trem<N_CHANNELS>::reset( inline void Trem<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Trem<N_CHANNELS>::process( inline void Trem<N_CHANNELS>::process(
@ -745,7 +761,7 @@ inline void Trem<N_CHANNELS>::process(
bw_trem_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_trem_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Trem<N_CHANNELS>::process( inline void Trem<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -753,7 +769,7 @@ inline void Trem<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Trem<N_CHANNELS>::setRate( inline void Trem<N_CHANNELS>::setRate(

View File

@ -20,17 +20,19 @@
/*! /*!
* module_type {{{ utility }}} * module_type {{{ utility }}}
* version {{{ 1.0.2 }}} * version {{{ 1.1.0 }}}
* requires {{{ bw_common bw_note_queue }}} * requires {{{ bw_common bw_note_queue }}}
* description {{{ * description {{{
* Basic voice allocator with low/high note priority. * Basic voice allocator with low/high note priority.
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.0.2</strong>: * <li>Version <strong>1.1.0</strong>:
* <ul> * <ul>
* <li>Added <code>static inline</code> to * <li>Added <code>static inline</code> to
* <code>bw_voice_alloc()</code>.</li> * <code>bw_voice_alloc()</code>.</li>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code> and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* </ul> * </ul>
* </li> * </li>
* <li>Version <strong>1.0.1</strong>: * <li>Version <strong>1.0.1</strong>:
@ -71,10 +73,15 @@
#ifndef BW_VOICE_ALLOC_H #ifndef BW_VOICE_ALLOC_H
#define BW_VOICE_ALLOC_H #define BW_VOICE_ALLOC_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
#include <bw_note_queue.h> # include "bw_common.h"
# include "bw_note_queue.h"
#else
# include <bw_common.h>
# include <bw_note_queue.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -142,7 +149,7 @@ static inline void bw_voice_alloc(
* the number of elements in `voices`. * the number of elements in `voices`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -151,7 +158,7 @@ static inline void bw_voice_alloc(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -215,7 +222,7 @@ static inline void bw_voice_alloc(
} }
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif

View File

@ -20,7 +20,7 @@
/*! /*!
* module_type {{{ dsp }}} * module_type {{{ dsp }}}
* version {{{ 1.1.1 }}} * version {{{ 1.2.0 }}}
* requires {{{ bw_common bw_math bw_one_pole bw_svf }}} * requires {{{ bw_common bw_math bw_one_pole bw_svf }}}
* description {{{ * description {{{
* Wah effect. * Wah effect.
@ -29,8 +29,11 @@
* }}} * }}}
* changelog {{{ * changelog {{{
* <ul> * <ul>
* <li>Version <strong>1.1.1</strong>: * <li>Version <strong>1.2.0</strong>:
* <ul> * <ul>
* <li>Added support for <code>BW_INCLUDE_WITH_QUOTES</code>,
* <code>BW_NO_CXX</code>, and
* <code>BW_CXX_NO_EXTERN_C</code>.</li>
* <li>Added debugging checks from <code>bw_wah_process()</code> to * <li>Added debugging checks from <code>bw_wah_process()</code> to
* <code>bw_wah_process_multi()</code>.</li> * <code>bw_wah_process_multi()</code>.</li>
* <li>Added debugging checks in <code>bw_wah_process_multi()</code> to * <li>Added debugging checks in <code>bw_wah_process_multi()</code> to
@ -104,9 +107,13 @@
#ifndef BW_WAH_H #ifndef BW_WAH_H
#define BW_WAH_H #define BW_WAH_H
#include <bw_common.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_common.h"
#else
# include <bw_common.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -266,7 +273,7 @@ static inline char bw_wah_state_is_valid(
* than or equal to that of `bw_wah_state`. * than or equal to that of `bw_wah_state`.
* }}} */ * }}} */
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#endif #endif
@ -275,9 +282,13 @@ static inline char bw_wah_state_is_valid(
/* WARNING: This part of the file is not part of the public API. Its content may /* 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. */ * change at any time in future versions. Please, do not use it directly. */
#include <bw_svf.h> #ifdef BW_INCLUDE_WITH_QUOTES
# include "bw_svf.h"
#else
# include <bw_svf.h>
#endif
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
extern "C" { extern "C" {
#endif #endif
@ -586,13 +597,16 @@ static inline char bw_wah_state_is_valid(
return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state); return bw_svf_state_is_valid(coeffs ? &coeffs->svf_coeffs : BW_NULL, &state->svf_state);
} }
#ifdef __cplusplus #if !defined(BW_CXX_NO_EXTERN_C) && defined(__cplusplus)
} }
#ifndef BW_CXX_NO_ARRAY
# include <array>
#endif #endif
#if !defined(BW_NO_CXX) && defined(__cplusplus)
# ifndef BW_CXX_NO_ARRAY
# include <array>
# endif
namespace Brickworks { namespace Brickworks {
/*** Public C++ API ***/ /*** Public C++ API ***/
@ -612,33 +626,33 @@ public:
float x0 = 0.f, float x0 = 0.f,
float * BW_RESTRICT y0 = nullptr); float * BW_RESTRICT y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0); std::array<float, N_CHANNELS> * BW_RESTRICT y0);
#endif # endif
void reset( void reset(
const float * x0, const float * x0,
float * y0 = nullptr); float * y0 = nullptr);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void reset( void reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr); std::array<float, N_CHANNELS> * BW_RESTRICT y0 = nullptr);
#endif # endif
void process( void process(
const float * const * x, const float * const * x,
float * const * y, float * const * y,
size_t nSamples); size_t nSamples);
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
void process( void process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
std::array<float *, N_CHANNELS> y, std::array<float *, N_CHANNELS> y,
size_t nSamples); size_t nSamples);
#endif # endif
void setWah( void setWah(
float value); float value);
@ -684,14 +698,14 @@ inline void Wah<N_CHANNELS>::reset(
bw_wah_reset_state(&coeffs, states + i, x0); bw_wah_reset_state(&coeffs, states + i, x0);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Wah<N_CHANNELS>::reset( inline void Wah<N_CHANNELS>::reset(
float x0, float x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0, y0 != nullptr ? y0->data() : nullptr); reset(x0, y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Wah<N_CHANNELS>::reset( inline void Wah<N_CHANNELS>::reset(
@ -701,14 +715,14 @@ inline void Wah<N_CHANNELS>::reset(
bw_wah_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS); bw_wah_reset_state_multi(&coeffs, statesP, x0, y0, N_CHANNELS);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Wah<N_CHANNELS>::reset( inline void Wah<N_CHANNELS>::reset(
std::array<float, N_CHANNELS> x0, std::array<float, N_CHANNELS> x0,
std::array<float, N_CHANNELS> * BW_RESTRICT y0) { std::array<float, N_CHANNELS> * BW_RESTRICT y0) {
reset(x0.data(), y0 != nullptr ? y0->data() : nullptr); reset(x0.data(), y0 != nullptr ? y0->data() : nullptr);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Wah<N_CHANNELS>::process( inline void Wah<N_CHANNELS>::process(
@ -718,7 +732,7 @@ inline void Wah<N_CHANNELS>::process(
bw_wah_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples); bw_wah_process_multi(&coeffs, statesP, x, y, N_CHANNELS, nSamples);
} }
#ifndef BW_CXX_NO_ARRAY # ifndef BW_CXX_NO_ARRAY
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Wah<N_CHANNELS>::process( inline void Wah<N_CHANNELS>::process(
std::array<const float *, N_CHANNELS> x, std::array<const float *, N_CHANNELS> x,
@ -726,7 +740,7 @@ inline void Wah<N_CHANNELS>::process(
size_t nSamples) { size_t nSamples) {
process(x.data(), y.data(), nSamples); process(x.data(), y.data(), nSamples);
} }
#endif # endif
template<size_t N_CHANNELS> template<size_t N_CHANNELS>
inline void Wah<N_CHANNELS>::setWah( inline void Wah<N_CHANNELS>::setWah(