[Clam-devel] PATCH: new ControlTrace{Reader,Writer} classes

Zach Welch zach-clam-devel at splitstring.com
Thu Apr 12 16:19:26 PDT 2007


Hi all,

As part of my present work with neural networks in CLAM, I realized that
I needed a means of recording and playing back control signals. I spent
a few hours implementing a pair of new classes: ControlTraceReader and
ControlTraceWriter.  These new processing components provide the ability
to replay or store a series of control values from or to an XML file,
respectively.

For a concrete example, one could store the output generated by a
Fundamental2Control processing over the duration of an audio file, using
the resulting file for analysis.  This specific example derives from IRC
logs between David and a user working with CLAM to analyze bird songs,
but there should be other present uses for these processing components.

The current implementation is fairly trivial.  It will hog a lot of
memory if run with many inputs or for very long; however, it should work
fine until it runs out of memory.  I can think of a couple of fairly
easy optimizations in this area, but they should be implementable as
extensions to the existing configuration and file format.  Even with
these limits, this implementation should be useful for various purposes.

This patch includes a new test file that exercises the configuration
portions of the new processing units.  I will revisit the Do portions of
the tests as part of my work on testing my neural networks; meanwhile,
the functionality can be exercised completely in the NetworkEditor:

1) Add a ControlTraceWriter with 2-inputs, and connect it to a new
   ControlSurface.  After configuring, start, drag the surface handle
   for a bit, and stop; when stopped, you will have a newly saved trace
   in the file specified during configuration.  If repeated without
   reconfiguring, this process will overwrite the existing file.

2) Create a new network with a ControlTraceReader and a ControlPrinter.
   Upon configuring the Reader with the file saved in step #1, two
   outputs should appear; connect them, start, and watch your actions
   be replayed in the Printer.

The attached patch requires the "common-file-refactoring-v3.patch" that
was sent in my last message.  This patch demonstrates the new re-use at
the Qt4Configurator level; without that patch, these same results would
have required duplicating code in several places.

Cheers,

Zach
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: control-traces-v4.patch
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070412/53db5ef9/attachment.ksh>


More information about the clam-devel mailing list