Merge pull request #866 from diizy/stable-1.1

Fix stuck notes on notestacking
This commit is contained in:
Tobias Doerffel
2014-06-19 09:54:31 +02:00
3 changed files with 4 additions and 5 deletions

View File

@@ -235,7 +235,7 @@ void InstrumentFunctionNoteStacking::processNote( NotePlayHandle * _n )
// time an audio-buffer is rendered...
if( ( _n->origin() == NotePlayHandle::OriginArpeggio || ( _n->hasParent() == false && _n->instrumentTrack()->isArpeggioEnabled() == false ) ) &&
_n->totalFramesPlayed() == 0 &&
m_chordsEnabledModel.value() == true )
m_chordsEnabledModel.value() == true && ! _n->isReleased() )
{
// then insert sub-notes for chord
const int selected_chord = m_chordsModel.value();

View File

@@ -101,7 +101,7 @@ NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack,
m_instrumentTrack->midiNoteOn( *this );
}
if( hasParent() || !instrumentTrack->isArpeggioEnabled() )
if( hasParent() || ! m_instrumentTrack->isArpeggioEnabled() )
{
const int baseVelocity = m_instrumentTrack->midiPort()->baseVelocity();
@@ -229,7 +229,7 @@ void NotePlayHandle::play( sampleFrame * _working_buffer )
// because we do not allow NotePlayHandle::isFinished() to be true
// until all sub-notes are completely played and no new ones
// are inserted by arpAndChordsTabWidget::processNote()
if( isMasterNote() )
if( ! m_subNotes.isEmpty() )
{
m_releaseFramesToDo = m_releaseFramesDone + 2 * engine::mixer()->framesPerPeriod();
}
@@ -349,7 +349,7 @@ void NotePlayHandle::noteOff( const f_cnt_t _s )
m_framesBeforeRelease = _s;
m_releaseFramesToDo = qMax<f_cnt_t>( 0, actualReleaseFramesToDo() );
if( hasParent() || !instrumentTrack()->isArpeggioEnabled() )
if( hasParent() || ! m_instrumentTrack->isArpeggioEnabled() )
{
// send MidiNoteOff event
f_cnt_t realOffset = offset() + _s; // get actual frameoffset of release, in global time

View File

@@ -240,7 +240,6 @@ MidiEvent InstrumentTrack::applyMasterKey( const MidiEvent& event )
void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
{
engine::mixer()->lock();
bool eventHandled = false;
switch( event.type() )