diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 103b7df08..eee44e7da 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -749,6 +749,21 @@ void instrumentTrack::deleteNotePluginData( notePlayHandle * _n ) { m_instrument->deleteNotePluginData( _n ); } + + m_notesMutex.lock(); + // Notes deleted when keys still pressed + if( m_notes[_n->key()] == _n ) + { + note done_note( NULL, midiTime( static_cast( + _n->totalFramesPlayed() * 64 / + eng()->getSongEditor()->framesPerTact() ) ), + 0, _n->tone(), _n->octave(), + _n->getVolume(), _n->getPanning() ); + _n->noteOff(); + m_notes[_n->key()] = NULL; + emit noteDone( done_note ); + } + m_notesMutex.unlock(); }