correction octaver

This commit is contained in:
thomas committed 2026-09-05 19:19:42 +02:00
1 parent 10c023cc3c
commit 5cf2212fc0
4 files changed
+20 -5

No files matched your search

+7 -1
View File
@@ -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;