InstrumentTrack: always process silence at least one time

As of commit 1266278229 silent buffers
from InstrumentPlayHandle-driven instruments are ignored. This is a good
thing but can beak PeakController instances attached to e.g. ZynAddSubFX.

Fixes playback of unfa-Spoken.mmpz.
This commit is contained in:
Tobias Doerffel
2014-02-06 23:40:50 +01:00
parent 1266278229
commit 8c06cb60f4
2 changed files with 14 additions and 2 deletions

View File

@@ -229,6 +229,8 @@ private:
int m_runningMidiNotes[NumKeys];
bool m_sustainPedalPressed;
bool m_silentBuffersProcessed;
IntModel m_baseNoteModel;
NotePlayHandleList m_processHandles;

View File

@@ -100,6 +100,7 @@ InstrumentTrack::InstrumentTrack( TrackContainer* tc ) :
this, this ),
m_notes(),
m_sustainPedalPressed( false ),
m_silentBuffersProcessed( false ),
m_baseNoteModel( 0, 0, KeysPerOctave * NumOctaves - 1, this,
tr( "Base note" ) ),
m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 0.1f, this, tr( "Volume" ) ),
@@ -165,8 +166,17 @@ void InstrumentTrack::processAudioBuffer( sampleFrame* buf, const fpp_t frames,
// 99 of 100 cases so that test would be a waste of time.
if( n == NULL && MixHelpers::isSilent( buf, frames ) )
{
// skip further processing
return;
// at least pass one silent buffer to allow
if( m_silentBuffersProcessed )
{
// skip further processing
return;
}
m_silentBuffersProcessed = true;
}
else
{
m_silentBuffersProcessed = false;
}
// if effects "went to sleep" because there was no input, wake them up