From 6a765a78c58baabc56d399d80d41ef9e54a93228 Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Sun, 21 Mar 2021 18:19:26 +0100 Subject: [PATCH] If the voice just started, output from the first source sample --- src/sfizz/Voice.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sfizz/Voice.cpp b/src/sfizz/Voice.cpp index 12c92bd6..94aba5bb 100644 --- a/src/sfizz/Voice.cpp +++ b/src/sfizz/Voice.cpp @@ -927,6 +927,11 @@ void Voice::Impl::fillWithData(AudioSpan buffer) noexcept return; fill(*jumps, pitchRatio_ * speedRatio_); + + // Take the first sample if the voice just started + if (age_ == 0) + jumps->front() = 0.0f; + pitchEnvelope(*jumps); jumps->front() += floatPositionOffset_;