Ajout octaver

This commit is contained in:
thomas committed 2026-09-05 18:51:17 +02:00
1 parent faef8f3673
commit 10c023cc3c
12 files changed
+701 -5

No files matched your search

+3 -1
View File
@@ -2,6 +2,7 @@
#define AUDIO_EFFECTS_H
#include <stdbool.h>
#include "fx_octaver.h"
#include "fx_equalizer.h"
#include "fx_overdrive.h"
#include "fx_saturation.h"
@@ -14,10 +15,11 @@ extern "C" {
/* Structure regroupant les parametres de tous les effets. Modifiable directement
* (ex: depuis l'IHM) via AudioEffects_GetParams(). L'ordre de traitement fixe est :
* egaliseur -> overdrive -> saturation -> echo -> reverberation. */
* octaveur -> egaliseur -> overdrive -> saturation -> echo -> reverberation. */
typedef struct
{
bool audio_on_off;
FxOctaverParams octaver;
FxEqualizerParams equalizer;
FxOverdriveParams overdrive;
FxSaturationParams saturation;
+44
View File
@@ -0,0 +1,44 @@
#ifndef FX_OCTAVER_H
#define FX_OCTAVER_H
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define FX_OCTAVER_BUFFER_SIZE 2048U /* buffer circulaire (puissance de 2) */
#define FX_OCTAVER_GRAIN_SIZE 1024U /* taille de grain, en echantillons (~21ms a 48kHz) */
#define FX_OCTAVER_NUM_VOICES 4U /* -2oct, -1oct, +1oct, +2oct (la voie seche est geree a part) */
typedef struct
{
bool enabled;
float level_down2; /* niveau voix -2 octaves, 0.0 a 1.0 */
float level_down1; /* niveau voix -1 octave, 0.0 a 1.0 */
float level_dry; /* niveau voix originale, 0.0 a 1.0 */
float level_up1; /* niveau voix +1 octave, 0.0 a 1.0 */
float level_up2; /* niveau voix +2 octaves, 0.0 a 1.0 */
} FxOctaverParams;
typedef struct
{
float delay[2]; /* decalage courant (en echantillons) des deux grains en fondu croise */
} FxOctaverVoiceState;
typedef struct
{
float buffer[FX_OCTAVER_BUFFER_SIZE];
uint32_t write_idx;
FxOctaverVoiceState voices[FX_OCTAVER_NUM_VOICES];
} FxOctaverState;
void FxOctaver_Init(FxOctaverState *state, FxOctaverParams *params);
float FxOctaver_Process(FxOctaverState *state, const FxOctaverParams *params, float input);
#ifdef __cplusplus
}
#endif
#endif /* FX_OCTAVER_H */