From b46a708644731dc4ba18d4f0aba86681d3894d80 Mon Sep 17 00:00:00 2001 From: Christoph Hart <> Date: Sun, 15 Dec 2024 22:23:04 +0100 Subject: [PATCH] - fix sampler crash with using timestretched multimic samples --- currentGitHash.txt | 2 +- hi_backend/backend/currentGit.h | 2 +- hi_core/hi_sampler/sampler/ModulatorSamplerVoice.cpp | 2 ++ hi_streaming/hi_streaming/StreamingSamplerVoice.cpp | 5 +++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/currentGitHash.txt b/currentGitHash.txt index 1884179725..bb1dfb3f4d 100644 --- a/currentGitHash.txt +++ b/currentGitHash.txt @@ -1 +1 @@ -0bf3e5c096504bdfd08c109fb91e10e28fac51c9 +d141f8ca68142cc287297ceaffe615748f4fac02 diff --git a/hi_backend/backend/currentGit.h b/hi_backend/backend/currentGit.h index 47bd48d6a1..76b5df0733 100644 --- a/hi_backend/backend/currentGit.h +++ b/hi_backend/backend/currentGit.h @@ -1 +1 @@ -#define PREVIOUS_HISE_COMMIT "0bf3e5c096504bdfd08c109fb91e10e28fac51c9" +#define PREVIOUS_HISE_COMMIT "d141f8ca68142cc287297ceaffe615748f4fac02" diff --git a/hi_core/hi_sampler/sampler/ModulatorSamplerVoice.cpp b/hi_core/hi_sampler/sampler/ModulatorSamplerVoice.cpp index 51207fe49b..533c7d5fd0 100644 --- a/hi_core/hi_sampler/sampler/ModulatorSamplerVoice.cpp +++ b/hi_core/hi_sampler/sampler/ModulatorSamplerVoice.cpp @@ -437,6 +437,8 @@ ModulatorSamplerVoice(ownerSynth) wrappedVoices.getLast()->setLoaderBufferSize((int)getOwnerSynth()->getAttribute(ModulatorSampler::BufferSize)); wrappedVoices.getLast()->setTemporaryVoiceBuffer(ms->getTemporaryVoiceBuffer(), ms->getTemporaryStretchBuffer()); wrappedVoices.getLast()->setDebugLogger(&ownerSynth->getMainController()->getDebugLogger()); + + wrappedVoices.getLast()->setSuspendOnDelayedStartFunction(std::bind(&ModulatorSynth::syncAfterDelayStart, ownerSynth, std::placeholders::_1, std::placeholders::_2), getVoiceIndex()); } // just call this once... diff --git a/hi_streaming/hi_streaming/StreamingSamplerVoice.cpp b/hi_streaming/hi_streaming/StreamingSamplerVoice.cpp index 389f8bae6d..5b43b5a8e7 100644 --- a/hi_streaming/hi_streaming/StreamingSamplerVoice.cpp +++ b/hi_streaming/hi_streaming/StreamingSamplerVoice.cpp @@ -966,9 +966,10 @@ void StreamingSamplerVoice::renderNextBlock(AudioSampleBuffer &outputBuffer, int { auto isDelayed = initStretcher(pitchSt); - if(isDelayed == sendNotificationAsync) + jassert(delayedStartFunction); + + if(delayedStartFunction && isDelayed == sendNotificationAsync) { - jassert(delayedStartFunction); delayedStartFunction(true, voiceIndexForDelayedStart); }