[Clam-devel] Re: Turnaround

David García Garzón dgarcia at iua.upf.edu
Wed Aug 6 12:31:58 PDT 2008


Taking a look at the code. Just a note of warning in case you didnt notice. 
TonalAnalysis decides the hopsize and framesize according the configuration 
parameters, so the safer approach is to configure it and query for the values 
at the input port hop and size in order to compute the number of frames.

Also as intermediate step before building FloatVectorStorage, you can just 
create a free Inport (without processing) and reusing the data structure.

Inport<vector<TData>> fetcher
tonalAnalysis.GetOutport("Pitch Profile").ConnectToIn(fetcher)
while reader.Do()
	if not tonalAnalysis.IsAbleToExectute(): continue
	tonalanalysis.Do()
	copy fetcher.GetData()[0] into data

This way you get it working faster, and you can later extract the code into a 
processing to enable later reuse.


On Dimecres 06 Agost 2008, David García Garzón wrote:
> I will be out for holydays since the next weekend. Just checking the mail
> from time to time. So take profit of me being there for those few days.
>
> I just compiled the commited version. I like the binary counter!! :-)
>
> Well, the next step is filling it with real PCP data.
>
> I would create a new type of processing in TurnAround (FloatVectorStorage)
> that can be configured with a number of bins and maybe with a number of
> frames to store, and contains and fills the float buffer you are now
> managing in loadAudioFile. I would connect it, without a network, using
> CLAM::Connect, with a tonal analysis and that one to to a regular file
> reader (not the in-memory, no seek neither realtime requirements here).
>
> Once you have them configured and connected, start them, and do the
> following bucle:
> while reader.Do()
> 	if not tonalAnalysis.IsAbleToExectute: continue
> 	tonalanalysis.Do()
> 	pcpStorage.Do()
>
> _dataSource.updateData(pcpStorate.data(), .....)
>
> At this point we should have real pcp data being displayed.
>
> Next steps:
> - Add a second tonnetz view sharing the same dataSource object
> - Add a second dataSource for the ChordCorrelation port and bind it to a
> ChordRanking view
> - Proceed with KeySpace (notice that KeySpaceMonitor limits to 24 the
> number of bins so you might need to provide a solution)
> - Consider a new type not being a vector<float> such as PolarPeaks
> - Build a segmentation view
> - Consider using the progress control to build a progress bar for the
> offline computing.
> - Make the TonalAnalysis configuration editable as settings for the
> application reusing NetworkEditor Configurators and storing them as
> QSettings or as an xml file at ~/.turnaroundrc or similar
> - Disscuss with me how these features could be generalized for other
> similar applications (offline computing, dumping into an in-memory storage,
> syncing real-time and in-memory storage...) with the goal of providing more
> support from the framework.
>
> On Dimarts 05 Agost 2008, Pawel Bartkiewicz wrote:
> > Ok, it took me some time to understand, but here's a patch. I'm not
> > committing it, because it's not complete yet. It replaces the realtime
> > analysis with a VectorView displaying the time code. I had to change
> > AudioFileMemoryLoader a bit.
> >
> > BTW, I had to update scons 0.97 to 0.98.5 (masked as unstable in
> > Gentoo) because one of the recent commits added the following error in
> > sconstools/qt4.py when building Turnaround:
> > "SConsEnvironment instance has no attribute 'AddMethod'"
> >
> > On 02/08/2008, David García Garzón <dgarcia at iua.upf.edu> wrote:
> > > Pawel, I did some changes on the PoolDataArraysource in order to easy
> > > your task, so update your repository before going on.
> > >
> > > El Saturday 02 August 2008 00:06:23 David García Garzón va escriure:
> > >> Back to the list.
> > >>
> > >> We'll take it step by step.
> > >>
> > >> First clearance:
> > >> - Do not use toStdString to get file names. Use
> > >> toLocal8Bit().constData() in order to support current locale.
> > >> toStdString uses Latin1 despite the current one. :-(
> > >> - Remove the nameProject parameter unless you are using it for
> > >> anything. If
> > >> you want to provide a song as parameter, rename it and don't forget to
> > >> use the fromLocal8Bit.
> > >>
> > >> Then the actual forward steps. As you have the widgets that make more
> > >> noise
> > >> than any other thing if you want the analysis, let's forget about the
> > >> analysis and lets concetrate first on the widgets.
> > >>
> > >> The first phase is having a FloatArrayDataSource that allows to travel
> > >> on an extracted pool of dummy data.
> > >>
> > >> First lets create and fill the dummy data on loading the file.
> > >> * Create an array of floats of nFrames*12 slots. By now let's take the
> > >> hop size from a constant and the lenght from the audio size.
> > >> * Fill the array with a 12 bits binary time code 0, 1, 10, 11, 100,
> > >> ... loop
> > >>
> > >> Then we should create a view for such data.
> > >> * Substitute the KeySpace with a VectorView, changing the port to PCP
> > >> which
> > >> is simpler to debug than ChordCorrelation port (12 bins vs. a varying
> > >> number of chords depending on the configuration).
> > >> * Copy annotator's PoolFloatArrayDataSource.
> > >>
> > >> Instead of relying on the pools and schemas we want to provide the
> > >> dummy parameters by hand, so:
> > >> * Comment out the setDataSource and the UpdateData notice that they
> > >> use the
> > >> Schema (structure) and the DataPool (actual data) to fill some
> > >> members. * Provide a setDataSource with nBins, binGap, firstBinOffset
> > >> and binLabels as parameters  so you can do direct mapping. (those bins
> > >> are bins in a frame, pitches, so binGap=firstBinOffset=0 and binLabels
> > >> are G,G#,A,A#,B...
> > >> * Provide an UpdateData with a sampling rate, a frame division, and
> > >> the array of data that you will copy into _data
> > >> * Create a PFADS on the Turnarround
> > >> * Set the PFADS as the VectorView data source
> > >> * Connect the progress control to a Turnaround slot that calls
> > >> PFADS::updateTime with the appropiate parameter.
> > >> * Try to use a Tonnetz instead of a VectorView to check the labels
> > >>
> > >> At this point we'll have the widgets visualizing offline dummy data,
> > >> so you
> > >> can remove the TonalAnalysis and monitors from the real-time network.
> > >> Then start building an offline network that fills the offline
> > >> structures, our widgets know how to display.
> > >>
> > >> El Friday 01 August 2008 21:17:33 Pawel Bartkiewicz va escriure:
> > >> > Yes, I was reading mail and working on Turnaround from Monday, but I
> > >> > still can't make the offline analysis working, so I haven't sent any
> > >> > new patches.
> > >> >
> > >> > I forgot to commit that old patch, sorry. I've just done it but I
> > >> > had to revert and clean up the new code because it wasn't working.
> > >> >
> > >> > I'm afraid I'll have to write some hack or simply copy the code from
> > >> > Annotator's ChordExtractor, because I'm stuck and otherwise I may
> > >> > not finish the project on time.
> > >> >
> > >> > On 01/08/2008, David García Garzón <dgarcia at iua.upf.edu> wrote:



-- 
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20080806/3d23423e/attachment.sig>


More information about the clam-devel mailing list