From 06fd81074ea41bfbb7ec4050d9a5703670c3a91b Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 21 Jan 2020 22:17:12 -0500 Subject: [PATCH] Make FreeRun/VST3 do the right thing if transport isn't running (#1493) If there's no transport, constantly resetting ppqPos is the wrong thing. So let it evolve so freerun works. Closes #1491 --- src/vst3/SurgeVst3Processor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vst3/SurgeVst3Processor.cpp b/src/vst3/SurgeVst3Processor.cpp index f54959137ec..8ce896d3b91 100644 --- a/src/vst3/SurgeVst3Processor.cpp +++ b/src/vst3/SurgeVst3Processor.cpp @@ -237,7 +237,7 @@ void SurgeVst3Processor::processEvent(const Event& e) case Event::kNoteOnEvent: if (e.noteOn.velocity == 0.f) { - std::cout << "NoteOff with 0 v " << e.noteOff.velocity << std::endl; + // std::cout << "NoteOff with 0 v " << e.noteOff.velocity << std::endl; getSurge()->releaseNote(e.noteOn.channel, e.noteOn.pitch, e.noteOn.velocity); } else @@ -382,7 +382,10 @@ tresult PLUGIN_API SurgeVst3Processor::process(ProcessData& data) int noteEventIndex = 0; int parameterEventIndex = 0; - if (data.processContext && data.processContext->state & ProcessContext::kProjectTimeMusicValid) + if (data.processContext && + data.processContext->state & ProcessContext::kProjectTimeMusicValid && + data.processContext->state & ProcessContext::kPlaying // See #1491 for a discussion of this choice + ) { surgeInstance->time_data.ppqPos = data.processContext->projectTimeMusic; }