private void mixChannelIntoBuffers ( final int [ ] leftBuffer , final int [ ] rightBuffer , final int startIndex , final int endIndex , final ChannelMemory actMemo ) { for ( int i = startIndex ; i < endIndex ; i ++ ) { // Retrieve the Sampledata for this point (interpolated, if necessary) long sample = actMemo . currentSample . getInterpolatedSample ( doISP , actMemo . currentSamplePos , actMemo . currentTuningPos ) ; // Resonance Filters if ( actMemo . filterOn ) sample = doResonance ( actMemo , sample ) ; // Volume Ramping (deClick) Left! long volL = actMemo . actRampVolLeft ; if ( ( actMemo . deltaVolLeft > 0 && volL > actMemo . actVolumeLeft ) || ( actMemo . deltaVolLeft < 0 && volL < actMemo . actVolumeLeft ) ) { volL = actMemo . actRampVolLeft = actMemo . actVolumeLeft ; actMemo . deltaVolLeft = 0 ; } else { actMemo . actRampVolLeft += actMemo . deltaVolLeft ; } // Volume Ramping (deClick) Right! long volR = actMemo . actRampVolRight ; if ( ( actMemo . deltaVolRight > 0 && volR > actMemo . actVolumeRight ) || ( actMemo . deltaVolRight < 0 && volR < actMemo . actVolumeRight ) ) { volR = actMemo . actRampVolRight = actMemo . actVolumeRight ; actMemo . deltaVolRight = 0 ; } else { actMemo . actRampVolRight += actMemo . deltaVolRight ; } // Fit into volume for the two channels leftBuffer [ i ] += ( int ) ( ( sample * volL ) >> Helpers . MAXVOLUMESHIFT ) ; rightBuffer [ i ] += ( int ) ( ( sample * volR ) >> Helpers . MAXVOLUMESHIFT ) ; // Now fit the loops of the current Sample fitIntoLoops ( actMemo ) ; if ( actMemo . instrumentFinished ) break ; } }
Fill the buffers with channel data