[Clam-devel] [PATCH] segmentation in chord extractor as a seperate class

Roman Goj roman.goj at gmail.com
Fri Jul 20 08:34:27 PDT 2007


On 7/19/07, David García Garzón <dgarcia at iua.upf.edu> wrote:
> On Thursday 19 July 2007 20:04:30 Roman Goj wrote:
(...)
> > Generally speaking, the class ChordExtractorSegmentation should stay,
> > but taking only extractor in the constructor.
>
> Indeed, that's not a good solution. Normally processings are decoupled one
> each other unless one includes other in a composition (like ChordExtractor
> with all its subprocessings). Processings should be coupled just to the input
> data. I mean, you should pass to the segmentator the output of the extractor
> on each doIt call as parameter, just as most small processings do. Who does
> that? Someone who has access to both processing, several candidates. Indeed
> once your only coupling is the data, you can move the processing up and down
> which is our target. Once you have it decoupled you could move the
> segmentator inside the ChordExtractor.
>
> In summary:
>
> Goal 1 remove reference to the pool (after each step compile test and patch):
> * Convert currentChord and _lastChord from string into indexes (should be
> equivalent, and 0~None). This will simplify all the rest of the work.
> * Create a vector of time positions and another of chord indexes as members
> * Populate them as the chordSegmentation and pool. (do not remove the old
> code)
> * Move the old pool code to the destructor but now looping and translating one
> to the other.
> * Add accessors to the new vectors
> * Move the old pool code loop to the destructor of the Dumper using such
> accessors.
> * Remove all pool dependant code
> * I don't know if it would be usefull switching to the Segmentation at this
> stage. Let's ignore that by now.
>
> Goal 2 remove reference to the segmentator (after each step compile test and
> patch):
>
> * Add a doIt parameter to pass the chordCorrelation as parameter, and pass it
> on the segmentator::doit caller taking it from the ChordExtractor
> * Do the same with first and second candidate
> * Do the currentChord logic just with indexes instead strings to avoid other
> dependencies on the get fullname
> * Move the pool work out of the processing (this would also
> * Remove the reference to the extractor as member

It took me a while to understand the steps, but I think I should be
heading in the right direction now :)

Goal 1, first bullet:
* Convert currentChord and _lastChord from string into indexes (should be
equivalent, and 0~None). This will simplify all the rest of the work.

is attached in the patch.

cheers,
roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ChordExtractorSegmentation-step2-chords-numbers.patch
Type: text/x-diff
Size: 4497 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070720/d381f5d4/attachment-0004.patch>


More information about the clam-devel mailing list