Skip to content

Commit cebc669

Browse files
DomClarkReflexe
authored andcommitted
Fix stuck keys when dragging on piano view (LMMS#5127)
* Fix stuck keys when dragging on piano view * Add comment Co-Authored-By: Shmuel H. <shmuelhazan0@gmail.com>
1 parent dcbaf70 commit cebc669

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/core/NotePlayHandle.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,12 @@ void NotePlayHandle::play( sampleFrame * _working_buffer )
199199

200200
lock();
201201

202-
if( m_totalFramesPlayed == 0 && !m_hasMidiNote
202+
/* It is possible for NotePlayHandle::noteOff to be called before NotePlayHandle::play,
203+
* which results in a note-on message being sent without a subsequent note-off message.
204+
* Therefore, we check here whether the note has already been released before sending
205+
* the note-on message. */
206+
if( !m_released
207+
&& m_totalFramesPlayed == 0 && !m_hasMidiNote
203208
&& ( hasParent() || ! m_instrumentTrack->isArpeggioEnabled() ) )
204209
{
205210
m_hasMidiNote = true;

0 commit comments

Comments
 (0)