fix bw_env_gen_reset_state (gate_0) + fix doc
This commit is contained in:
parent
e49cae6c8b
commit
dad7485016
@ -268,6 +268,8 @@ static inline size_t bw_delay_get_length(
|
|||||||
/*! <<<```
|
/*! <<<```
|
||||||
* Returns the length of the delay line in samples as stored in `coeffs`.
|
* Returns the length of the delay line in samples as stored in `coeffs`.
|
||||||
*
|
*
|
||||||
|
* `coeffs` must be at least in the "sample-rate-set" state.
|
||||||
|
*
|
||||||
* #### bw_delay_coeffs_is_valid()
|
* #### bw_delay_coeffs_is_valid()
|
||||||
* ```>>> */
|
* ```>>> */
|
||||||
static inline char bw_delay_coeffs_is_valid(
|
static inline char bw_delay_coeffs_is_valid(
|
||||||
|
@ -497,15 +497,20 @@ static inline void bw_env_gen_reset_coeffs(
|
|||||||
static inline float bw_env_gen_reset_state(
|
static inline float bw_env_gen_reset_state(
|
||||||
const bw_env_gen_coeffs * BW_RESTRICT coeffs,
|
const bw_env_gen_coeffs * BW_RESTRICT coeffs,
|
||||||
bw_env_gen_state * BW_RESTRICT state,
|
bw_env_gen_state * BW_RESTRICT state,
|
||||||
char gate) {
|
char gate_0) {
|
||||||
BW_ASSERT(coeffs != NULL);
|
BW_ASSERT(coeffs != NULL);
|
||||||
BW_ASSERT_DEEP(bw_env_gen_coeffs_is_valid(coeffs));
|
BW_ASSERT_DEEP(bw_env_gen_coeffs_is_valid(coeffs));
|
||||||
BW_ASSERT_DEEP(coeffs->state >= bw_env_gen_coeffs_state_reset_coeffs);
|
BW_ASSERT_DEEP(coeffs->state >= bw_env_gen_coeffs_state_reset_coeffs);
|
||||||
BW_ASSERT(state != NULL);
|
BW_ASSERT(state != NULL);
|
||||||
|
|
||||||
bw_one_pole_reset_state(&coeffs->smooth_coeffs, &state->smooth_state, coeffs->sustain);
|
bw_one_pole_reset_state(&coeffs->smooth_coeffs, &state->smooth_state, coeffs->sustain);
|
||||||
|
if (gate_0) {
|
||||||
|
state->phase = bw_env_gen_phase_sustain;
|
||||||
|
state->v = coeffs->sustain_v;
|
||||||
|
} else {
|
||||||
state->phase = bw_env_gen_phase_off;
|
state->phase = bw_env_gen_phase_off;
|
||||||
state->v = gate ? coeffs->sustain_v : 0;
|
state->v = 0;
|
||||||
|
}
|
||||||
const float y = (1.f / (float)BW_ENV_V_MAX) * state->v;
|
const float y = (1.f / (float)BW_ENV_V_MAX) * state->v;
|
||||||
|
|
||||||
#ifdef BW_DEBUG_DEEP
|
#ifdef BW_DEBUG_DEEP
|
||||||
|
@ -216,6 +216,8 @@ static inline float bw_gain_get_gain_cur(
|
|||||||
/*! <<<```
|
/*! <<<```
|
||||||
* Returns the actual current gain coefficient (linear gain) in `coeffs`.
|
* Returns the actual current gain coefficient (linear gain) in `coeffs`.
|
||||||
*
|
*
|
||||||
|
* `coeffs` must be at least in the "reset" state.
|
||||||
|
*
|
||||||
* #### bw_gain_coeffs_is_valid()
|
* #### bw_gain_coeffs_is_valid()
|
||||||
* ```>>> */
|
* ```>>> */
|
||||||
static inline char bw_gain_coeffs_is_valid(
|
static inline char bw_gain_coeffs_is_valid(
|
||||||
|
@ -188,6 +188,8 @@ static inline float bw_noise_gen_get_scaling_k(
|
|||||||
* Returns the sample rate scaling factor that is applied or would be applied
|
* Returns the sample rate scaling factor that is applied or would be applied
|
||||||
* if sample rate scaling were enabled, as stored in `coeffs`.
|
* if sample rate scaling were enabled, as stored in `coeffs`.
|
||||||
*
|
*
|
||||||
|
* `coeffs` must be at least inthe "sample-rate-set" state.
|
||||||
|
*
|
||||||
* #### bw_noise_gen_coeffs_is_valid()
|
* #### bw_noise_gen_coeffs_is_valid()
|
||||||
* ```>>> */
|
* ```>>> */
|
||||||
static inline char bw_noise_gen_coeffs_is_valid(
|
static inline char bw_noise_gen_coeffs_is_valid(
|
||||||
|
@ -266,6 +266,8 @@ static inline float bw_pink_filt_get_scaling_k(
|
|||||||
* Returns the sample rate scaling factor that is applied or would be applied
|
* Returns the sample rate scaling factor that is applied or would be applied
|
||||||
* if sample rate scaling were enabled, as stored in `coeffs`.
|
* if sample rate scaling were enabled, as stored in `coeffs`.
|
||||||
*
|
*
|
||||||
|
* `coeffs` must be at least in the "sample-rate-set" state.
|
||||||
|
*
|
||||||
* #### bw_pink_filt_coeffs_is_valid()
|
* #### bw_pink_filt_coeffs_is_valid()
|
||||||
* ```>>> */
|
* ```>>> */
|
||||||
static inline char bw_pink_filt_coeffs_is_valid(
|
static inline char bw_pink_filt_coeffs_is_valid(
|
||||||
|
Loading…
Reference in New Issue
Block a user