Merge pull request #2877 from serdnab/sf2sustain-rev

Revision to a previous PR. midi sustain of sf2 player
This commit is contained in:
Javier Serrano Polo
2016-06-29 03:33:01 +00:00
committed by GitHub

View File

@@ -576,11 +576,15 @@ void sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * )
m_playingNotes.append( _n );
m_playingNotesMutex.unlock();
}
else if( _n->isReleased() ) // note is released during this period
else if( _n->isReleased() && ! _n->instrumentTrack()->isSustainPedalPressed() ) // note is released during this period
{
SF2PluginData * pluginData = static_cast<SF2PluginData *>( _n->m_pluginData );
pluginData->offset = _n->framesBeforeRelease();
pluginData->isNew = false;
m_playingNotesMutex.lock();
m_playingNotes.append( _n );
m_playingNotesMutex.unlock();
}
}