From 1abc36bbcbd54f7ae08c252b0e11c8a82028b355 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sun, 5 Jan 2020 20:53:54 +0000 Subject: [PATCH] Fix stuck notes with Helm VSTi --- src/core/NotePlayHandle.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index d628573506f..d1a5843eda5 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -540,6 +540,15 @@ void NotePlayHandle::processMidiTime( const MidiTime& time ) void NotePlayHandle::resize( const bpm_t _new_tempo ) { + if (origin() == OriginMidiInput || + (origin() == OriginNoteStacking && m_parent->origin() == OriginMidiInput)) + { + // Don't resize notes from MIDI input - they should continue to play + // until the key is released, and their large duration can cause + // overflows in this method. + return; + } + double completed = m_totalFramesPlayed / (double) m_frames; double new_frames = m_origFrames * m_origTempo / (double) _new_tempo; m_frames = (f_cnt_t)new_frames;