renamed bw_env_gen_update_state_ctrl as bw_env_gen_process_ctrl

This commit is contained in:
Stefano D'Angelo 2023-08-14 12:22:56 +02:00
parent ee94fba57b
commit 4313cea18c
2 changed files with 8 additions and 7 deletions

3
TODO
View File

@ -6,7 +6,6 @@ code:
* check all examples again * check all examples again
* osc post filter (and one pole init, slew rate, etc.) val from input? set state instead? * osc post filter (and one pole init, slew rate, etc.) val from input? set state instead?
* audio rate optional pulse width/slope inputs? * audio rate optional pulse width/slope inputs?
* one pole process const input? (return also if const out)
* empty functions etc. to keep consistency and forward compatibility? * empty functions etc. to keep consistency and forward compatibility?
* float in [-1,1] for velocity, pitch bend, mod wheel * float in [-1,1] for velocity, pitch bend, mod wheel
* should clip slope in triangle? * should clip slope in triangle?
@ -25,7 +24,6 @@ code:
* bw_fuzz gain compensation? * bw_fuzz gain compensation?
* make gain of distortions homogeneous? * make gain of distortions homogeneous?
* max_delay -> set sample rate? see reverb * max_delay -> set sample rate? see reverb
* update state ctrl -> process ctrl?
* mem req -> return value of set sample rate? * mem req -> return value of set sample rate?
* peak gain + Q ??? * peak gain + Q ???
* sr_reduce reset_coeffs? update_coeffs? process_multi? * sr_reduce reset_coeffs? update_coeffs? process_multi?
@ -71,6 +69,7 @@ code:
* any chance to avoid casts in C for const X * const * input arguments? * any chance to avoid casts in C for const X * const * input arguments?
* heavy debug (e.g. also stripping restrict) vs light debug vs release vs optimized makefile rules * heavy debug (e.g. also stripping restrict) vs light debug vs release vs optimized makefile rules
* smaller optimized modules (e.g., simple one pole) * smaller optimized modules (e.g., simple one pole)
* one pole, slew lim, maybe others: process const input? (return also if const out)
build system: build system:
* make makefiles handle paths with spaces etc * make makefiles handle paths with spaces etc

View File

@ -42,6 +42,8 @@
* <ul> * <ul>
* <li>Version <strong>1.0.0</strong>: * <li>Version <strong>1.0.0</strong>:
* <ul> * <ul>
* <li>Renamed <code>bw_env_gen_update_state_ctrl()</code> as
* <code>bw_env_gen_process_ctrl()</code>.</li>
* <li><code>bw_env_gen_process()</code> and * <li><code>bw_env_gen_process()</code> and
* <code>bw_env_gen_process_multi()</code> now use * <code>bw_env_gen_process_multi()</code> now use
* <code>size_t</code> to count samples and channels.</li> * <code>size_t</code> to count samples and channels.</li>
@ -168,9 +170,9 @@ static inline void bw_env_gen_update_coeffs_audio(bw_env_gen_coeffs *BW_RESTRICT
/*! <<<``` /*! <<<```
* Triggers audio-rate update of coefficients in `coeffs`. * Triggers audio-rate update of coefficients in `coeffs`.
* *
* #### bw_env_gen_update_state_ctrl() * #### bw_env_gen_process_ctrl()
* ```>>> */ * ```>>> */
static inline void bw_env_gen_update_state_ctrl(const bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate); static inline void bw_env_gen_process_ctrl(const bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate);
/*! <<<``` /*! <<<```
* Triggers control-rate update of the internal `state` using `coeffs` and * Triggers control-rate update of the internal `state` using `coeffs` and
* the given `gate` value (`0` for off, non-`0` for on). * the given `gate` value (`0` for off, non-`0` for on).
@ -342,7 +344,7 @@ static inline void bw_env_gen_update_coeffs_audio(bw_env_gen_coeffs *BW_RESTRICT
(void)coeffs; (void)coeffs;
} }
static inline void bw_env_gen_update_state_ctrl(const bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate) { static inline void bw_env_gen_process_ctrl(const bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate) {
(void)coeffs; (void)coeffs;
if (gate) { if (gate) {
if (state->phase == bw_env_gen_phase_off || state->phase == bw_env_gen_phase_release) if (state->phase == bw_env_gen_phase_off || state->phase == bw_env_gen_phase_release)
@ -391,7 +393,7 @@ static inline float bw_env_gen_process1(const bw_env_gen_coeffs *BW_RESTRICT coe
static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate, float *BW_RESTRICT y, size_t n_samples) { static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT state, char gate, float *BW_RESTRICT y, size_t n_samples) {
bw_env_gen_update_coeffs_ctrl(coeffs); bw_env_gen_update_coeffs_ctrl(coeffs);
bw_env_gen_update_state_ctrl(coeffs, state, gate); bw_env_gen_process_ctrl(coeffs, state, gate);
if (y != NULL) if (y != NULL)
for (size_t i = 0; i < n_samples; i++) for (size_t i = 0; i < n_samples; i++)
y[i] = bw_env_gen_process1(coeffs, state); y[i] = bw_env_gen_process1(coeffs, state);
@ -403,7 +405,7 @@ static inline void bw_env_gen_process(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_
static inline void bw_env_gen_process_multi(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT const *BW_RESTRICT state, const char *BW_RESTRICT gate, float *BW_RESTRICT const *BW_RESTRICT y, size_t n_channels, size_t n_samples) { static inline void bw_env_gen_process_multi(bw_env_gen_coeffs *BW_RESTRICT coeffs, bw_env_gen_state *BW_RESTRICT const *BW_RESTRICT state, const char *BW_RESTRICT gate, float *BW_RESTRICT const *BW_RESTRICT y, size_t n_channels, size_t n_samples) {
bw_env_gen_update_coeffs_ctrl(coeffs); bw_env_gen_update_coeffs_ctrl(coeffs);
for (size_t j = 0; j < n_channels; j++) for (size_t j = 0; j < n_channels; j++)
bw_env_gen_update_state_ctrl(coeffs, state[j], gate[j]); bw_env_gen_process_ctrl(coeffs, state[j], gate[j]);
if (y != NULL) if (y != NULL)
for (size_t i = 0; i < n_samples; i++) for (size_t i = 0; i < n_samples; i++)
for (size_t j = 0; j < n_channels; j++) { for (size_t j = 0; j < n_channels; j++) {