delay: mix parameter keeps dry signal constant, only fades in wet signal up to 50%

This commit is contained in:
Michael Sippel 2024-12-08 19:35:09 +01:00
parent 17f4de175a
commit bcbce9e1fb
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -42,14 +42,14 @@ void delay_process(
for( size_t i = 0; i < frame_size; ++i ) { for( size_t i = 0; i < frame_size; ++i ) {
if( delay->duration > 0 ) { if( delay->duration > 0 ) {
out[i] = out[i] =
(1.0 - delay->mix) * in[i] 0.5 * in[i]
+ delay->mix * delay->buf[ delay->buf_idx ]; + 0.5 * delay->mix * delay->buf[ delay->buf_idx ];
delay->buf[ delay->buf_idx ] *= delay->feedback; delay->buf[ delay->buf_idx ] *= delay->feedback;
delay->buf[ delay->buf_idx ] += (1.0 - delay->feedback) * in[i]; delay->buf[ delay->buf_idx ] += (1.0 - delay->feedback) * in[i];
delay->buf_idx = (delay->buf_idx + 1) % delay->duration; delay->buf_idx = (delay->buf_idx + 1) % delay->duration;
} else { } else {
out[i] = in[i]; out[i] = 0.5 * in[i];
} }
} }
} }