Mercurial > hg > qm-vamp-plugins
diff plugins/SegmenterPlugin.cpp @ 39:7f499758cb23
* Add MFCC option
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 10 Jan 2008 16:41:43 +0000 |
parents | 9a2edd83775f |
children | 77e394a5f3c9 |
line wrap: on
line diff
--- a/plugins/SegmenterPlugin.cpp Thu Jan 10 15:15:12 2008 +0000 +++ b/plugins/SegmenterPlugin.cpp Thu Jan 10 16:41:43 2008 +0000 @@ -62,8 +62,19 @@ //!!! TODO: print out a helpful error message - if (stepSize != hopsize) return false; - if (blockSize != windowsize) return false; + if (stepSize != hopsize) { + std::cerr << "SegmenterPlugin::initialise: supplied step size " + << stepSize << " differs from required step size " << hopsize + << std::endl; + return false; + } + + if (blockSize != windowsize) { + std::cerr << "SegmenterPlugin::initialise: supplied block size " + << blockSize << " differs from required block size " << windowsize + << std::endl; + return false; + } return true; } @@ -107,15 +118,16 @@ ParameterDescriptor desc2; desc2.identifier = "featureType"; desc2.name = "Feature Type"; - desc2.description = "Try Chroma for acoustic or pre-1980 recordings, otherwise use Constant-Q"; + desc2.description = "Try Chromatic for acoustic or pre-1980 recordings, otherwise use Hybrid"; desc2.unit = ""; desc2.minValue = 1; - desc2.maxValue = 2; + desc2.maxValue = 3; desc2.defaultValue = 1; desc2.isQuantized = true; desc2.quantizeStep = 1; - desc2.valueNames.push_back("Constant-Q"); - desc2.valueNames.push_back("Chroma"); + desc2.valueNames.push_back("Hybrid (Constant-Q)"); + desc2.valueNames.push_back("Chromatic (Chroma)"); + desc2.valueNames.push_back("Timbral (MFCC)"); list.push_back(desc2); return list; @@ -180,6 +192,11 @@ params.histogramLength = 20; params.neighbourhoodLimit = 40; } + if (params.featureType == FEATURE_TYPE_MFCC) + { + params.ncomponents = 20; + params.neighbourhoodLimit = 30; + } delete segmenter; segmenter = new ClusterMeltSegmenter(params);