mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Fixed garbage playback on Looper stop, trackoutput wasn't zeroing the whole buffer
This commit is contained in:
parent
c2d8e045ce
commit
75b48edae2
2 changed files with 9 additions and 5 deletions
|
@ -27,6 +27,8 @@ Looper::Looper(int t) :
|
|||
clips[i] = new LooperClip(track, i);
|
||||
}
|
||||
|
||||
tmpBuffer.resize( MAX_BUFFER_SIZE );
|
||||
|
||||
fpb = 22050;
|
||||
|
||||
// init faust pitch shift variables
|
||||
|
@ -92,14 +94,16 @@ void Looper::process(unsigned int nframes, Buffers* buffers)
|
|||
|
||||
for(unsigned int i = 0; i < nframes; i++ )
|
||||
{
|
||||
out[i] = clips[clip]->getSample(playSpeed);
|
||||
float tmp = clips[clip]->getSample(playSpeed);
|
||||
|
||||
// write the pitch-shifted signal to the track buffer
|
||||
pitchShift( 1, &tmp, &out[i] );
|
||||
}
|
||||
|
||||
//printf("Looper %i playing(), speed = %f\n", track, playSpeed );
|
||||
printf("Looper %i playing(), speed = %f\n", track, playSpeed );
|
||||
|
||||
if ( uiUpdateCounter > uiUpdateConstant )
|
||||
{
|
||||
|
||||
jack->getControllerUpdater()->setTrackSceneProgress(track, clip, clips[clip]->getProgress() );
|
||||
uiUpdateCounter = 0;
|
||||
}
|
||||
|
@ -162,7 +166,7 @@ void Looper::pitchShift(int count, float* input, float* output)
|
|||
float fTemp4 = (fSlow0 + fRec0[0]);
|
||||
int iTemp5 = int(fTemp4);
|
||||
|
||||
*output++ += (float)(((1 - fTemp3) * (((fTemp4 - iTemp5) *
|
||||
*output++ = (float)(((1 - fTemp3) * (((fTemp4 - iTemp5) *
|
||||
fVec0[(IOTA-int((int((1 + iTemp5)) & 65535)))&65535]) + ((0 - ((
|
||||
fRec0[0] + fSlow3) - iTemp5)) * fVec0[(IOTA-int((iTemp5 & 65535)))
|
||||
&65535]))) + (fTemp3 * (((fRec0[0] - iTemp1) * fVec0[(IOTA-int((int(
|
||||
|
|
|
@ -53,7 +53,7 @@ void TrackOutput::process(unsigned int nframes, Buffers* buffers)
|
|||
{
|
||||
// get & zero track buffer
|
||||
float* trackBuffer = buffers->audio[Buffers::TRACK_0 + track];
|
||||
memset( trackBuffer, 0, nframes );
|
||||
memset( trackBuffer, 0, sizeof(float)*nframes );
|
||||
|
||||
// call process() up the chain
|
||||
previousInChain->process( nframes, buffers );
|
||||
|
|
Loading…
Add table
Reference in a new issue