From 86dece6032fce8522bf6baa9aefcb42350eb3550 Mon Sep 17 00:00:00 2001 From: John Glover Date: Mon, 13 Dec 2010 13:09:12 +0000 Subject: Fixed bug in SMSSynthesis, Partials were not being correctly linked --- sms/synthesis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sms') diff --git a/sms/synthesis.c b/sms/synthesis.c index 3a7682a..8a679ca 100644 --- a/sms/synthesis.c +++ b/sms/synthesis.c @@ -39,8 +39,8 @@ static void SineSynthIFFT(SMS_Data *pSmsData, SMS_SynthParams *pSynthParams) sfloat fMag=0.0, fFreq=0.0, fPhase=0.0, fLoc, fSin, fCos, fBinRemainder, fTmp, fNewMag, fIndex; sfloat fSamplingPeriod = 1.0 / pSynthParams->iSamplingRate; - memset (pSynthParams->pSpectra, 0, sizeFft * sizeof(sfloat)); - for (i = 0; i < nTracks; i++) + memset(pSynthParams->pSpectra, 0, sizeFft * sizeof(sfloat)); + for(i = 0; i < nTracks; i++) { if(((fMag = pSmsData->pFSinAmp[i]) > 0) && ((fFreq = (pSmsData->pFSinFreq[i])) < iHalfSamplingRate)) @@ -52,7 +52,7 @@ static void SineSynthIFFT(SMS_Data *pSmsData, SMS_SynthParams *pSynthParams) fMag = sms_dBToMag(fMag); fTmp = pSynthParams->prevFrame.pFSinPha[i] + - TWO_PI * fFreq * fSamplingPeriod * sizeMag; + TWO_PI * fFreq * fSamplingPeriod * sizeMag; fPhase = fTmp - floor(fTmp * INV_TWO_PI) * TWO_PI; fLoc = sizeFft * fFreq * fSamplingPeriod; iFirstBin = (int) fLoc - 3; -- cgit v1.2.3