Skip to content

Commit

Permalink
loopback one tick earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
BaraMGB committed Jan 5, 2017
1 parent d784d75 commit b04f8b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/core/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ void Song::processNextBuffer()
( tl->loopBegin().getTicks() * 60 * 1000 / 48 ) / getTempo();
m_playPos[m_playMode].setTicks(
tl->loopBegin().getTicks() );
emit updateSampleTracks();
}
}

Expand Down Expand Up @@ -339,14 +338,17 @@ void Song::processNextBuffer()
// if looping-mode is enabled and we have got
// past the looping range, return to the
// beginning of the range
if( m_playPos[m_playMode] == tl->loopEnd() - 1 )
{
emit updateSampleTracks();
}
if( m_playPos[m_playMode] >= tl->loopEnd() )
{
m_playPos[m_playMode].setTicks( tl->loopBegin().getTicks() );

m_elapsedMilliSeconds =
( ( tl->loopBegin().getTicks() ) * 60 * 1000 / 48 ) /
getTempo();
emit updateSampleTracks();
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion src/tracks/SampleTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames,
//else we play the sample to the end but nothing more
f_cnt_t samplePlayLength = tcoFrameLength > sampleBufferLength ? sampleBufferLength : tcoFrameLength;
//we only play within the sampleBuffer limits
if( sampleStart < sTco->sampleBuffer()->frames() )
if( sampleStart < sampleBufferLength )
{
sTco->setSampleStartFrame( sampleStart );
sTco->setSamplePlayLength( samplePlayLength );
Expand Down

0 comments on commit b04f8b8

Please sign in to comment.