correction octaver
This commit is contained in:
1 parent
10c023cc3c
commit
5cf2212fc0
4 files changed
+20
-5
No files matched your search
@@ -8,8 +8,12 @@
|
||||
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_BUFFER_SIZE 4096U /* buffer circulaire (puissance de 2) */
|
||||
#define FX_OCTAVER_GRAIN_SIZE 2048U /* taille de grain, en echantillons (~43ms a 48kHz) :
|
||||
* doit largement couvrir la periode des notes les plus
|
||||
* graves jouees (ex. do2 ~65Hz, periode ~734 echantillons
|
||||
* a 48kHz) pour limiter les artefacts de phase entre les
|
||||
* deux grains en fondu croise. */
|
||||
#define FX_OCTAVER_NUM_VOICES 4U /* -2oct, -1oct, +1oct, +2oct (la voie seche est geree a part) */
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -11,7 +11,7 @@ static const float fx_eq_default_freqs[FX_EQ_NUM_BANDS] =
|
||||
|
||||
void FxEqualizer_Init(FxEqualizerState *state, FxEqualizerParams *params)
|
||||
{
|
||||
params->enabled = false;
|
||||
params->enabled = true;
|
||||
for (uint32_t i = 0; i < FX_EQ_NUM_BANDS; i++)
|
||||
{
|
||||
params->bands[i].freq_hz = fx_eq_default_freqs[i];
|
||||
@@ -23,6 +23,11 @@ void FxEqualizer_Init(FxEqualizerState *state, FxEqualizerParams *params)
|
||||
state->band_state[i].last_q = 0.0f;
|
||||
state->x1[i] = state->x2[i] = state->y1[i] = state->y2[i] = 0.0f;
|
||||
}
|
||||
|
||||
// Pour couper les basses par defaukt et éviter les larsens :
|
||||
params->bands[0].gain_db = -15.0f;
|
||||
params->bands[1].gain_db = -10.0f;
|
||||
params->bands[2].gain_db = -2.5f;
|
||||
}
|
||||
|
||||
/* Filtre "peaking EQ" (cloche), formule de l'Audio EQ Cookbook (Robert Bristow-Johnson). */
|
||||
|
||||
@@ -47,7 +47,13 @@ static inline float FxOctaver_EnvLookup(float phase)
|
||||
|
||||
static inline float FxOctaver_ReadInterpolated(const float *buffer, uint32_t write_idx, float delay)
|
||||
{
|
||||
float read_pos = (float)write_idx - delay;
|
||||
/* write_idx grandit sans jamais etre replie (compteur perpetuel) ; le convertir
|
||||
* directement en float finirait par perdre en precision (un float ne represente
|
||||
* exactement les entiers que jusqu'a ~16.7 millions, soit quelques minutes a
|
||||
* 48kHz). On calcule donc la position de lecture uniquement a partir de l'index
|
||||
* DEJA REPLIE dans le buffer, qui reste toujours petit. */
|
||||
float write_pos = (float)(write_idx & FX_OCTAVER_BUFFER_MASK);
|
||||
float read_pos = write_pos - delay;
|
||||
while (read_pos < 0.0f)
|
||||
{
|
||||
read_pos += (float)FX_OCTAVER_BUFFER_SIZE;
|
||||
|
||||
@@ -835,7 +835,7 @@
|
||||
"InteractionName": "Interaction7",
|
||||
"Trigger": {
|
||||
"Type": "TriggerSliderValueChanged",
|
||||
"TriggerComponent": "slider4"
|
||||
"TriggerComponent": "slider5"
|
||||
},
|
||||
"Action": {
|
||||
"Type": "ActionCustom",
|
||||
|
||||
Reference in new issue
Block a user