51 lines
961 B
C
51 lines
961 B
C
#ifndef FX_REVERB_H
|
|
#define FX_REVERB_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define FX_REVERB_NUM_COMBS 8U
|
|
#define FX_REVERB_NUM_ALLPASS 4U
|
|
|
|
typedef struct
|
|
{
|
|
bool enabled;
|
|
float room_size; /* 0.0 a 1.0 */
|
|
float damping; /* 0.0 (brillant) a 1.0 (etouffe) */
|
|
float mix; /* 0.0 (sec) a 1.0 (100% reverbere) */
|
|
} FxReverbParams;
|
|
|
|
typedef struct
|
|
{
|
|
float *buffer;
|
|
uint32_t size;
|
|
uint32_t idx;
|
|
float filter_store;
|
|
} FxCombState;
|
|
|
|
typedef struct
|
|
{
|
|
float *buffer;
|
|
uint32_t size;
|
|
uint32_t idx;
|
|
} FxAllpassState;
|
|
|
|
typedef struct
|
|
{
|
|
FxCombState combs[FX_REVERB_NUM_COMBS];
|
|
FxAllpassState allpass[FX_REVERB_NUM_ALLPASS];
|
|
} FxReverbState;
|
|
|
|
void FxReverb_Init(FxReverbState *state, FxReverbParams *params);
|
|
float FxReverb_Process(FxReverbState *state, const FxReverbParams *params, float input);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* FX_REVERB_H */
|