From 31983056ca520f03c7b5bc430b0ba9d561587a20 Mon Sep 17 00:00:00 2001 From: Julien Verneuil Date: Mon, 5 Apr 2021 22:14:34 +0200 Subject: [PATCH] reset interpolation state on pause / play --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 74e8d5e..f63bfe1 100644 --- a/src/main.c +++ b/src/main.c @@ -299,6 +299,8 @@ static int audioCallback(float **inputBuffer, float **outputBuffer, unsigned lon if (audio_thread_state == FAS_AUDIO_DO_PAUSE) { last_gain_lr = curr_synth.settings->gain_lr; + curr_synth.lerp_t = 0.0; + audio_thread_state = FAS_AUDIO_PAUSE; } else if (audio_thread_state == FAS_AUDIO_DO_PLAY) { curr_synth.lerp_t = 0.0; @@ -322,6 +324,8 @@ static int audioCallback(float **inputBuffer, float **outputBuffer, unsigned lon last_gain_lr = curr_synth.settings->gain_lr; + curr_synth.lerp_t = 0.0; + audio_thread_state = FAS_AUDIO_PAUSE; }