SampleTrack: Fix TCO not being played on the first tick (if it starts on

tick 0)
This commit is contained in:
Shmuel H
2017-11-06 22:29:10 +02:00
parent 1971879726
commit 5a08e9ed9f

View File

@@ -620,7 +620,7 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames,
float framesPerTick = Engine::framesPerTick();
if( _start >= sTco->startPosition() && _start < sTco->endPosition() )
{
if( sTco->isPlaying() == false && _start > sTco->startPosition() + sTco->startTimeOffset() )
if( sTco->isPlaying() == false && _start >= (sTco->startPosition() + sTco->startTimeOffset()) )
{
f_cnt_t sampleStart = framesPerTick * ( _start - sTco->startPosition() - sTco->startTimeOffset() );
f_cnt_t tcoFrameLength = framesPerTick * ( sTco->endPosition() - sTco->startPosition() - sTco->startTimeOffset() );