[Clam-devel] CLAM XMMS pluggin

David García Garzón dgarcia at iua.upf.edu
Thu Sep 6 11:48:55 PDT 2007


Hi, Ben. I'll try to give you some hints.

First of all, the short how'tos on the wiki will help you a lot.
http://clam.iua.upf.edu/wikis/clam/index.php/Main_Page

KeySpace is a qt widget but it's display code is mainly OpenGL (the exception 
is the text drawing code). You can easily move the widget to a different 
toolkit supporting opengl, such as libvisual. Input data of the widget is the 
correlation of each chord (not audio neither spectrum). The good news on that 
is that it uses an interface to get such a data and you can use do 
DummyFloatArrayDataSource while doing the toolkit port.

Your plug-in should then compute the actual chord correlation. You should 
build a simple network with an AudioSource, a TonalAnalysis and a KeySpace 
(warning the processing module is KeySpaceMonitor but the factory id is just 
KeySpace).

Look at the code at
http://clam.iua.upf.edu/wikis/clam/index.php/Constructing_and_playing_a_simple_network

Note that we are doing  
	network.SetPlayer(new CLAM::PANetworkPlayer);

The network player is an entity that feeds context audio into the audio 
sources. The example uses PANetworkPlayer to deal with PortAudio, but your 
context is an xmms plugin, so you should develop a similar class  
(XmmsVisualizationNetworkPlayer?) Create and populate the network in the Init 
callback, and take PANetworkPlayer as reference to implement the rest of the 
callbacks in a similar way.

Of course, you are in an unexplored land, do not hesitate to mail us again for 
any help.


On Thursday 06 September 2007 19:54:14 Ben Erridge wrote:
> I am not all very familiar with QT, also I haven't written C++ in years(c,
> java primarily) but I have tried to integrate a simple qt widget into my
> xmms plugin unsuccessfully. I am thinking of just proxying the data from
> xmms into a block of shared memory and then develope a QT-CLAM app that
> reads the shared memory block to get the audio/control data...
>
> What do you think about that?
> Ben
>
> On 9/5/07, Pau Arumi <parumi at iua.upf.edu> wrote:
> > En/na Ben Erridge ha escrit:
> > > Hello,
> > > I am trying to write a plugin for xmms which will display the
> > > keyspacemonitor for the currently playing song. xmms provides the music
> > > data in two ways
> > > 1.)  fequency array (gint16 freq_data[2][256])
> > > 2.) PCM data
> > >
> > >  From what I have found the keyspace needs a floatarraydatasource but I
> > > haven't been able to find out exactly how to construct one from the
> > > data I have.
> >
> > Hi Ben,
> > I think that is a great idea!
> >
> > Keyspace widget uses a (FloatArray)DataSource polymorphic object
> > to get its data while giving flexibility to connect the widget to
> > sources of different nature, like in NetworkEditor (streaming
> > data) and Music Annotator (offline data pool).
> >
> > See in NetworkEditor/src/ProcessingBox.cxx 130:
> > CLAM::VM::KeySpace * widget = new CLAM::VM::KeySpace(canvas);
> >                 widget->setDataSource(
> > *dynamic_cast<KeySpaceMonitor*>(processing) );
> >
> > Here, "processing" parameter is a PortMonitor, an object which is
> > (inherits) both a Processing and a DataSource.
> > Of course, you also need to construct a network like this:
> > AudioSource -> TonalAnalysis -> KeySpaceMonitor
> > Like in this screenshot:
> >
> > http://iua-share.upf.es/wikis/clam/images/4/4c/NetEditQt4-PolarChromaPeak
> >s.png
> >
> >
> > Another useful tool in Clam are NetworkPlayers, which are coupled
> > with an audio back-end such as JACK, PortAudio or LADSPA, and
> > connects the i/o buffers with the Network Sinks and Sources, and
> > finally, drives the Network execution. See for example:
> > CLAM/src/Flow/Networks/PANetworkPlayer.*xx
> > As a first thought --though maybe I'm wrong-- it would make sense
> > to have a XmmsNetworkPlayer.
> > Another aspect to be worked out is how to integrate Qt4 widgets
> > to xmms.
> >
> > > I'm hoping for some tips on the best way to approach this integration
> > > from xmms data to data that the keyspace can use. Any help would be
> > > greatly appreciated
> > > Also if there are API docs, I haven't been able to find them and inline
> > > documentation on the source is mostly non existent.
> >
> > Web -> Doc -> API documentation:
> > http://clam.iua.upf.edu/doc/CLAM-devel-doxygen/
> >
> > I suggest to move further discussion to the devel-list
> >
> > Cheers!
> > Pau
> >
> > > Thanks you in advance!
> > > Ben






More information about the clam-devel mailing list