Skip to content

Commit

Permalink
Make FreeRun/VST3 do the right thing if transport isn't running (surg…
Browse files Browse the repository at this point in the history
…e-synthesizer#1493)

If there's no transport, constantly resetting ppqPos is the wrong
thing. So let it evolve so freerun works.

Closes surge-synthesizer#1491
  • Loading branch information
baconpaul authored Jan 22, 2020
1 parent 143cfb6 commit 06fd810
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vst3/SurgeVst3Processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 06fd810

Please sign in to comment.