pitchShift add delay even for playSpeed=1.0 !! Fixed by disableing pitchShift

when playSpeed=1.0
This commit is contained in:
Gerald 2016-09-26 10:35:46 +02:00 committed by Harry van Haaren
parent 804bca9135
commit c084601d0e

View file

@ -147,7 +147,12 @@ void Looper::process(unsigned int nframes, Buffers* buffers)
semitoneShift = -deltaPitch; semitoneShift = -deltaPitch;
// write the pitch-shifted signal to the track buffer // write the pitch-shifted signal to the track buffer
pitchShift( 1, &tmp, &out[i] ); //FIXME: pitchShift adds delay even for playSpeed = 1.0!!
//we should use something better (e.g librubberband)
if(playSpeed!=1.0f)
pitchShift( 1, &tmp, &out[i] );
else
out[i]+=tmp;
} }
//printf("Looper %i playing(), speed = %f\n", track, playSpeed ); //printf("Looper %i playing(), speed = %f\n", track, playSpeed );
@ -190,14 +195,15 @@ void Looper::pitchShift(int count, float* input, float* output)
float fTemp3 = min((fSlow2 * fRec0[0]), 1.f ); float fTemp3 = min((fSlow2 * fRec0[0]), 1.f );
float fTemp4 = (fSlow0 + fRec0[0]); float fTemp4 = (fSlow0 + fRec0[0]);
int iTemp5 = int(fTemp4); int iTemp5 = int(fTemp4);
float out=output[0];
*output++ = (float)(((1 - fTemp3) * (((fTemp4 - iTemp5) * out += (float)(((1 - fTemp3) * (((fTemp4 - iTemp5) *
fVec0[(IOTA-int((int((1 + iTemp5)) & 65535)))&65535]) + ((0 - (( fVec0[(IOTA-int((int((1 + iTemp5)) & 65535)))&65535]) + ((0 - ((
fRec0[0] + fSlow3) - iTemp5)) * fVec0[(IOTA-int((iTemp5 & 65535))) fRec0[0] + fSlow3) - iTemp5)) * fVec0[(IOTA-int((iTemp5 & 65535)))
&65535]))) + (fTemp3 * (((fRec0[0] - iTemp1) * fVec0[(IOTA-int((int( &65535]))) + (fTemp3 * (((fRec0[0] - iTemp1) * fVec0[(IOTA-int((int(
iTemp2) & 65535)))&65535]) + ((iTemp2 - fRec0[0]) * fVec0[(IOTA-int(( iTemp2) & 65535)))&65535]) + ((iTemp2 - fRec0[0]) * fVec0[(IOTA-int((
iTemp1 & 65535)))&65535])))); iTemp1 & 65535)))&65535]))));
output[0]=out;
fRec0[1] = fRec0[0]; fRec0[1] = fRec0[0];
IOTA = IOTA+1; IOTA = IOTA+1;
} }