Arpeggiator - Cut off trailing short notes (#5523)

Prevent triggering of extra notes at the end by not counting trailing
notes shorter than one fifth of the notes arp_frames. This value
being arbitrarily found by trial and error.
This commit is contained in:
Oskar Wallgren
2020-11-02 18:36:49 +01:00
committed by GitHub
parent f56cf60578
commit c39690d8e0

View File

@@ -388,8 +388,10 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n )
while( frames_processed < Engine::mixer()->framesPerPeriod() )
{
const f_cnt_t remaining_frames_for_cur_arp = arp_frames - ( cur_frame % arp_frames );
// does current arp-note fill whole audio-buffer?
if( remaining_frames_for_cur_arp > Engine::mixer()->framesPerPeriod() )
// does current arp-note fill whole audio-buffer or is the remaining time just
// a short bit that we can discard?
if( remaining_frames_for_cur_arp > Engine::mixer()->framesPerPeriod() ||
_n->frames() - _n->totalFramesPlayed() < arp_frames / 5 )
{
// then we don't have to do something!
break;