mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-14 03:59:35 -04:00
NPH fix: prevent offsets from going over period limit
This commit is contained in:
@@ -76,6 +76,7 @@ NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack,
|
||||
m_midiChannel( midiEventChannel >= 0 ? midiEventChannel : instrumentTrack->midiPort()->realOutputChannel() ),
|
||||
m_origin( origin )
|
||||
{
|
||||
qDebug( "offset %d", _offset );
|
||||
if( hasParent() == false )
|
||||
{
|
||||
m_baseDetuning = new BaseDetuning( detuning() );
|
||||
@@ -187,6 +188,13 @@ void NotePlayHandle::play( sampleFrame * _working_buffer )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// if the note offset falls over to next period, then don't start playback yet
|
||||
if( offset() >= engine::mixer()->framesPerPeriod() )
|
||||
{
|
||||
setOffset( offset() - engine::mixer()->framesPerPeriod() );
|
||||
return;
|
||||
}
|
||||
|
||||
// number of frames that can be played this period
|
||||
f_cnt_t framesThisPeriod = m_totalFramesPlayed == 0
|
||||
|
||||
Reference in New Issue
Block a user