From 67bd3b7ce79f82b495328c774dc4692d9f6447c9 Mon Sep 17 00:00:00 2001 From: John Glover Date: Wed, 8 Dec 2010 16:12:33 +0000 Subject: Fixed a SMS issue in sms_initSynth where having a hop size that was not a power of 2 would stop execution. Fixed another SMS test. --- sms/sineSynth.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sms/sineSynth.c') diff --git a/sms/sineSynth.c b/sms/sineSynth.c index f2110af..c91bf65 100644 --- a/sms/sineSynth.c +++ b/sms/sineSynth.c @@ -163,25 +163,23 @@ void sms_sineSynthFrame(SMS_Data *pSmsData, sfloat *pFBuffer, int iHalfSamplingRate = iSamplingRate >> 1; /* go through all the tracks */ - for (i = 0; i < nTracks; i++) + for(i = 0; i < nTracks; i++) { - /* get magnitude */ fMag = pSmsData->pFSinAmp[i]; - fFreq = pSmsData->pFSinFreq[i]; - /* gaurd so transposed frequencies don't alias */ - if (fFreq > iHalfSamplingRate || fFreq < 0) + /* make that sure transposed frequencies don't alias */ + if(fFreq > iHalfSamplingRate || fFreq < 0) fMag = 0; /* generate sines if there are magnitude values */ - if ((fMag > 0) || (pLastFrame->pFSinAmp[i] > 0)) + if((fMag > 0) || (pLastFrame->pFSinAmp[i] > 0)) { /* frequency from Hz to radians */ fFreq = (fFreq == 0) ? 0 : TWO_PI * fFreq / iSamplingRate; /* \todo make seperate function for SineSynth /wo phase */ - if (pSmsData->pFSinPha == NULL) + if(pSmsData->pFSinPha == NULL) { SineSynth(fFreq, fMag, pLastFrame, pFBuffer, sizeBuffer, i); } -- cgit v1.2.3