Skip to content

Commit

Permalink
Fix stuck keys when dragging on piano view (LMMS#5127)
Browse files Browse the repository at this point in the history
* Fix stuck keys when dragging on piano view
* Add comment

Co-Authored-By: Shmuel H. <[email protected]>
  • Loading branch information
2 people authored and zonkmachine committed Sep 8, 2019
1 parent dcbaf70 commit cebc669
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/NotePlayHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,12 @@ void NotePlayHandle::play( sampleFrame * _working_buffer )

lock();

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

0 comments on commit cebc669

Please sign in to comment.