summaryrefslogtreecommitdiff
path: root/sms/synthesis.c
diff options
context:
space:
mode:
authorJohn Glover <glover.john@gmail.com>2010-12-10 16:38:12 +0000
committerJohn Glover <glover.john@gmail.com>2010-12-10 16:38:12 +0000
commit60b5bb138640e97a3ff6315c3ec702dec51019c1 (patch)
tree87ca3e0678984f5c7a4aae83f8be7cf9d2b0d597 /sms/synthesis.c
parent5ca314e5ccf3dfb98fdea9d37646baca66d75ec3 (diff)
downloadsimpl-60b5bb138640e97a3ff6315c3ec702dec51019c1.tar.gz
simpl-60b5bb138640e97a3ff6315c3ec702dec51019c1.tar.bz2
simpl-60b5bb138640e97a3ff6315c3ec702dec51019c1.zip
Bug fix: synthesis via sineSynthFrame was failing because magnitudes were not in DB.
Diffstat (limited to 'sms/synthesis.c')
-rw-r--r--sms/synthesis.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sms/synthesis.c b/sms/synthesis.c
index c7439f1..3a7682a 100644
--- a/sms/synthesis.c
+++ b/sms/synthesis.c
@@ -50,7 +50,7 @@ static void SineSynthIFFT(SMS_Data *pSmsData, SMS_SynthParams *pSynthParams)
if(pSynthParams->prevFrame.pFSinAmp[i] <= 0)
pSynthParams->prevFrame.pFSinPha[i] = TWO_PI * sms_random();
- // fMag = sms_dBToMag(fMag);
+ fMag = sms_dBToMag(fMag);
fTmp = pSynthParams->prevFrame.pFSinPha[i] +
TWO_PI * fFreq * fSamplingPeriod * sizeMag;
fPhase = fTmp - floor(fTmp * INV_TWO_PI) * TWO_PI;
@@ -126,8 +126,6 @@ static int StocSynthApprox(SMS_Data *pSmsData, SMS_SynthParams *pSynthParams)
if (*(pSmsData->pFStocGain) <= 0)
return 0;
- // *(pSmsData->pFStocGain) = sms_dBToMag(*(pSmsData->pFStocGain));
-
sizeSpec1Used = sizeSpec1 * pSynthParams->iSamplingRate /
pSynthParams->iOriginalSRate;
@@ -165,7 +163,7 @@ void sms_synthesize(SMS_Data *pSmsData, sfloat *pFSynthesis, SMS_SynthParams *p
memset(pSynthParams->pSynthBuff+sizeHop, 0, sizeof(sfloat) * sizeHop);
/* convert mags from linear to db */
- /*sms_arrayMagToDB(pSmsData->nTracks, pSmsData->pFSinAmp);*/
+ sms_arrayMagToDB(pSmsData->nTracks, pSmsData->pFSinAmp);
/* decide which combo of synthesis methods to use */
if(pSynthParams->iSynthesisType == SMS_STYPE_ALL)