Fix stuck notes with Helm VSTi

This commit is contained in:
Dominic Clark
2020-01-05 20:53:54 +00:00
committed by Johannes Lorenz
parent a9640c8898
commit c52682dfb1

View File

@@ -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;