summaryrefslogtreecommitdiff
path: root/sms
diff options
context:
space:
mode:
authorJohn Glover <glover.john@gmail.com>2010-12-21 19:36:52 +0000
committerJohn Glover <glover.john@gmail.com>2010-12-21 19:36:52 +0000
commit0fc0718e4e06f3ffc8518b3a3672ede08369617a (patch)
tree926f2c2de5611c73419c1fbcf70af637995cbce7 /sms
parent8373f12eaf63b6db27a1848202a86aeeb15c4d26 (diff)
downloadsimpl-0fc0718e4e06f3ffc8518b3a3672ede08369617a.tar.gz
simpl-0fc0718e4e06f3ffc8518b3a3672ede08369617a.tar.bz2
simpl-0fc0718e4e06f3ffc8518b3a3672ede08369617a.zip
Fixed bug in SMSPartialTracking
Diffstat (limited to 'sms')
-rw-r--r--sms/analysis.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sms/analysis.c b/sms/analysis.c
index 95ddf60..345b95f 100644
--- a/sms/analysis.c
+++ b/sms/analysis.c
@@ -256,12 +256,12 @@ void sms_setPeaks(SMS_AnalParams *pAnalParams, int numamps, sfloat* amps,
{
/* get a reference fundamental */
sfloat refFundamental = 0;
- sfloat avgDeviation = sms_fundDeviation(pAnalParams, 1);
+ sfloat avgDeviation = sms_fundDeviation(pAnalParams, currentFrame-1);
if(pAnalParams->iSoundType == SMS_SOUND_TYPE_NOTE)
refFundamental = pAnalParams->fDefaultFundamental;
/* if sound is stable use the last fundamental as a reference */
else if(avgDeviation != -1 && avgDeviation <= pAnalParams->maxDeviation)
- refFundamental = pAnalParams->ppFrames[1]->fFundamental;
+ refFundamental = pAnalParams->ppFrames[currentFrame-1]->fFundamental;
else
refFundamental = 0;
@@ -320,12 +320,6 @@ int sms_findPartials(SMS_Data *pSmsData, SMS_AnalParams *pAnalParams)
memcpy((char *) pSmsData->pFSinPha, (char *)
pAnalParams->ppFrames[0]->deterministic.pFSinPha, length);
- /* do post-processing (for now, spectral envelope calculation and storage) */
- if(pAnalParams->specEnvParams.iType != SMS_ENV_NONE)
- {
- sms_spectralEnvelope(pSmsData, &pAnalParams->specEnvParams);
- }
-
return 1;
}