From b01d1a2b112328cdbff6eeb19294e2c09b7481e9 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 16 Aug 2007 10:01:00 +0000 Subject: [PATCH] reverted previous changes (behaviour with monophonic instruments) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@522 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ include/instrument.h | 9 --------- src/tracks/instrument_track.cpp | 16 +++++++++++----- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index cde0fae1d..59ff97cd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-16 Tobias Doerffel + + * include/instrument.h: + * src/tracks/instrument_track.cpp: + reverted previous changes (behaviour with monophonic instruments) + 2007-08-06 Tobias Doerffel * plugins/triple_oscillator/triple_oscillator.h: diff --git a/include/instrument.h b/include/instrument.h index 9194e753c..1f1888f35 100644 --- a/include/instrument.h +++ b/include/instrument.h @@ -105,15 +105,6 @@ public: return( FALSE ); } - // some monophonic instruments need a certain number of frames for a - // transition between notes - such instruments can re-implement this - // method for returning how many frames they at least like to have for - // transition - virtual f_cnt_t desiredTransitionFrames( void ) const - { - return( 0 ); - } - inline virtual bool notePlayHandleBased( void ) const { return( TRUE ); diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 390dcde08..4ced4c992 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -781,8 +781,8 @@ void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing ) { processInEvent( midiEvent( NOTE_OFF, 0, _n->key(), 0 ), midiTime() ); - _n->noteOff( ( *youngest_note )->offset()+m_instrument->desiredTransitionFrames() ); -#if 0 + //printf("%d\n",( *youngest_note )->offset()+m_instrument->desiredTransitionFrames()); + //_n->noteOff( ( *youngest_note )->offset()+m_instrument->desiredTransitionFrames() ); if( ( *youngest_note )->offset() > _n->offset() ) { @@ -799,13 +799,19 @@ void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing ) // in last period and have // to clear parts of it _n->noteOff(); -/* engine::getMixer()->clearAudioBuffer( m_audioPort->firstBuffer(), + engine::getMixer()->clearAudioBuffer( m_audioPort->firstBuffer(), engine::getMixer()->framesPerPeriod() - ( *youngest_note )->offset(), ( *youngest_note )->offset() ); - return;*/ + return; } -#endif + } + // we do not play previously released notes + // anymore + else if( *youngest_note != _n && + _n->released() ) + { + return; } } }