[Clam-devel] Re: KeySpace and Tonnetz dummy data sources

David García Garzón dgarcia at iua.upf.edu
Wed Jun 6 23:26:37 PDT 2007


On Thursday 07 June 2007 02:32:36 bennett kolasinski wrote:
> David (& list):
>
> I just got back from my trip (no internet for 3 days- the horror!!) and
> while I was working in my sandbox I noticed that the implementations of
> TonnetzPlugin and KeyspacePlugin within InstantViewPlugin.cxx were
> virtually the same except for the string id of each class... so I set to
> work on reworking those two classes into default implementations for all
> the virtual functions instead of two classes with 99% the same code... I
> figured this would make adding a plugin (such as BarGraph) as simple as
> inheriting from InstantViewPlugin and simply passing the id string to the
> constructor (unless you needed to override any of the functions).

Well seen that duplication. Anyway i foresee we will have more InstantViews 
than float arrays. So derive one from another (as we do on the widget) or 
create a new intermediate class, but don't move such an implementation to the 
InstantViewPlugin base class.

Another thing to be noticed is that Tonnetz and keySpace filter attributes to 
be applied differently. So they are not so identical, beware. Both require 
having bin labels, but keySpace requires 24 bins while Tonnetz may work with 
12 or 24. BarGraph would have no such restriction. Maybe you could isolate 
the different by moving the code to a new virtual fuction such as:

virtual bool isAttributeAppliable(const CLAM_Annotator::SchemaAttribute & 
attribute)

> Anyhow, I made a big mess and overwrote my backed-up copies of
> InstantViewPlugin.[c/h]xx so I'm updating my source now.  This was after
> spending some time working on integrating BarGraph so all is not lost but
> I'd like to spend a bit of time cleaning up what I've done before sending
> anything out.

Don't be shy, Bennett, just send the patch, explain what you don't like of it, 
and announce the fix if you know how to. It's better to discuss on code than 
on air and to make commits on smaller set of changes. It also shows how hard 
are you working so the other GSoC students get motivated and start sending 
patches too and CLAM gets better and better and then we will dominate the 
world ;-)

> So I guess the purpose of this email is twofold: 1) seeing if anyone wanted
> to argue against changing InstantViewPlugin into default implementations
> for its virtual functions instead of having to implement each function for
> each plugin class and 2) to say that I'll be working more on rolling
> BarGraph into Annotator and will have something to send out shortly :)

I arged against but no show stopper. If you already did that, send the patch 
and let's fix it later if needed. We can even delay the fix until we need a 
new type of attribute not being FloatArray or when adding the BarGraph.

I really want to see the BarGraph working, so, common, send the patch ;-)

PS: After talking with our Graphics experts at the UPF (Sergi and Edu, 
Gonzalez bross) I am changing the KeySpace code to be faster, so try not to 
change the order of the methods on such file to avoid conflicts.


> On 6/4/07, David García Garzón <dgarcia at iua.upf.edu> wrote:
> > Bennett, if you already did any change to Tonnetz don't update your
> > sandbox or
> > you might get some conflicts. I did some changes to get ride of the Dummy
> > data sources for KeySpace and Tonnetz. If you send the patch to the list
> > ill
> > try to merge it.
> >
> > The changes i did consisted on removing the DummyXXXDataSources  classes
> > on
> > the KeySpace and Tonnetz which provided dummy constant data for qt
> > designer.
> > I used instead the generic dummy data source i already used for the
> > BarGraph,
> > the DummyFloatArrayDataSource class which is 'programable' with the
> > constant
> > data to show. I just added programmable labels to fit KeySpace and
> > Tonnetz needs.
> >
> > When you split the monitor class all the common files will get 'almost'
> > identical.
> >
> > Looking forward your changes, it will be very interesting viewing PCP's
> > and
> > MFCC's as a BarGraph on the Annotator.
> >
> > --
> > David García Garzón
> > (Work) dgarcia at iua dot upf anotherdot es
> > http://www.iua.upf.edu/~dgarcia






More information about the clam-devel mailing list