From 09395a2f3ec5102c47fc6811958acdc56835a2f5 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 26 Jan 2014 19:09:11 +0100 Subject: [PATCH] NotePlayHandle: stop properly when arpeggio is played via MIDI If a note is played via MIDI (e.g. with infinite frame count) and arpeggio is enabled the NotePlayHandle never got deleted as framesLeft() always returned a big value even after release. Closes #169. --- src/core/note_play_handle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 6a434aea6..16ce402fe 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -305,9 +305,10 @@ void notePlayHandle::play( sampleFrame * _working_buffer ) // can set m_releaseFramesDone to m_releaseFramesToDo so that // notePlayHandle::done() returns true and also this base-note is // removed from mixer's active note vector - if( isArpeggioBaseNote() && m_subNotes.size() == 0 ) + if( m_released && isArpeggioBaseNote() && m_subNotes.size() == 0 ) { m_releaseFramesDone = m_releaseFramesToDo; + m_frames = 0; } // update internal data