[Clam-devel] [PATCH] TonalAnalysis configuration, take two

Roman Goj roman.goj at gmail.com
Fri Jul 13 10:08:33 PDT 2007


(patch includes step 3)

Well, I decided to try configuring the "hard one"...

This patch makes _binsPerOctave (which is a member of
ConstantQTransform) configurable through TonalAnalysis. In my previous
"bloated patch" approach I did this basically by copying the insides
of the ConstantQTransform constructor and pasting them into a new
function reconfigure(). This was basically a duplicate of the same
code... somehow it never struck me that this would be so much nicer
with a helper function, so now:

There is a new function configuration( ..., binsPerOctave ); in
ConstantQTransform, which has the insides of the constructor
(+clearing the mSparseKernels etc., which is necessary I think before
sparsekernel gets called) and is called both by the constructor and by
a function ConstantQTransformConfiguration( binsPerOctave ).

One method to avoid all this would be to just do
delete _implementation;
_implementation = new Simac::ChordExtractor;

but even just adding these two lines into
TonalAnalysis::ConcreteConfigure() without any configuration
whatsoever, causes crashes when something is connected to the outputs
of TonalAnalysis :(

Anyway I think that this approach may not be that nice - there's still
the need either for a bloated constructor or some configuration
functions inside the processings.

So - is this new approach to configuring ConstantQTransform any
better? I think it is ;)

Anyway, changelog:
Changelog:
* Adds constantQTransformConfiguration(...) in Simac::ChordExtractor
* Adds configuration(...) in ConstantQTransform
* Adds a filterInertia accessor in Simac::ChordExtractor
* Adds _inertia accessor in Simac::PCPSmoother
* Adds _peakWindowingEnabled accessor in Simac::ChordExtractor
* Adds hopRatio accessors in Simac::ChordExtractor
* _binsPerOctave, _hopRatio, _peakWindowing, and _filter's inertia
parameter are now
configurable in TonalAnalysis

(it all seems to be working nicely... except for the obvious glitch
that increasing binsPerOctave above some threshold will cause the
algorithm to stop working as the size of the FFT needs to be increased
also... this should be soon easily fixed by the next patches (if this
is the right approach that is), already encountered this doing the
previous reconfigure() patch)

roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TonalAnalysisConfig-step4-binsPerOctave-proposal.patch
Type: text/x-diff
Size: 5601 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070713/95b8ab38/attachment-0004.patch>


More information about the clam-devel mailing list