diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index a3970cd8aba..78045fc670e 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -415,17 +415,23 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) if( extended ) { - // Skip notes randomly - if( m_arpSkipModel.value() ) + /* TODO: Muting the notes, as it's done nown (see further down) + the code is a bit wasteful. Skipped notes should be + handled early in the while loop by actually skipping over + notes and not by muting them.*/ +/* + // Skip notes randomly + if( m_arpSkipModel.value() ) + { + if( 101 * ( (float) rand() / (float) RAND_MAX ) < m_arpSkipModel.value() ) { - if( 101 * ( (float) rand() / (float) RAND_MAX ) < m_arpSkipModel.value() ) - { - // update counters - frames_processed += arp_frames; - cur_frame += arp_frames; - continue; - } + // update counters + frames_processed += arp_frames; + cur_frame += arp_frames; + continue; } + } +*/ // Miss notes randomly. We intercept int dir and abuse it // after need. :) @@ -516,6 +522,17 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) vol_level = _n->volumeLevel( cur_frame + gated_frames ); } + if( extended ) + { + // Skip notes randomly by muting. + if( m_arpSkipModel.value() ) + { + if( 101 * ( (float) rand() / (float) RAND_MAX ) < m_arpSkipModel.value() ) + { + vol_level = 0.0f; + } + } + } // create new arp-note // create sub-note-play-handle, only ptr to note is different