Posted by hordia on 17th May 2010
If you ever wrote at least 2 audio plugins in your life, for sure you have noticed you had to write a lot of duplicated code. In other words, most of the times, writing a plugin there is very little entropy from your code.
My first approach to this problem was some years ago when i did a simple code generator of the base code of a clam plugin (see these clam-devel threads for more info ‘Commit #11195: templated plugins generator‘ and ‘Frontend for automatic generation of plugin code‘)
Now i’m with a simple but i think powerful project (derived from the needs i noticed at club de audio de la fiuba) to have an application to generate code of different standards using XML based specifications. Then, as before, you nearly only need to write the signal processing code of the plugin (and can forget about the mechanical work).
The idea is to get VST, LADSPA, lv2, CLAM, Audio Units and possibly others standards base code ready to compile for different operating systems and using different build systems. Indeed, once finished, will be easy to implement new modules for others plugins specifications since will consist only into implement an interface.
My proposed xml specification (comments and suggestions are welcome!), showed as a clam plugin definition example is here. Basically contains metadata, input and output ports and controls and other build definitions:
< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE AudioPlugin SYSTEM "AudioPluginDef.dtd">
<audioplugin Version="0.1">
<metadata>
<name>TestRtPlugin</name>
<description>This is a test realtime audio plugin</description>
<authors>Fulano, Sultano, Mengano</authors>
<copyright Year="2010">Club de Audio FIUBA</copyright>
<license>GPL</license>
<category>Plugins</category>
</metadata>
<inputs>
<port Name="L Input">AudioInPort</port>
<port Name="R Input">AudioInPort</port>
<control Name="Gain" Min="0." Max="1.0" DefaultValue=".5">InControlFloat</control>
</inputs>
<outputs>
<port Name="L Output">AudioOutPort</port>
<port Name="R Output">AudioOutPort</port>
</outputs>
<outputplugin Standard="CLAM" BuildSystem="Scons" OS="Linux">
<basetemplatename>Default</basetemplatename>
<clam_defaultconfig> <!-- CLAM plugin specific configuration -->
<baseclass>Processing</baseclass>
<withconfig>True</withconfig>
</clam_defaultconfig>
</outputplugin>
</audioplugin>
I also thought about an UID (Uniqued ID) field at metadata, there is not showed in the example since is not needed to clam plugins.
There is also a .dtd file to check the correctness of the plugin spec.
audio
, CLAM
, ClubAudioFiuba
, english
, free software
, ideas
, plugins
, programming
, projects
, python
, signal processing
, specifications
, standards 
Share This/Compártelo
Posted in audio, signal processing, free software, programming, python, projects, English, CLAM, standards, plugins, specifications, ideas, ClubAudioFiuba | No Comments »
Posted by hordia on 11th March 2010
(Note: I wrote this as something to tell to the clam-devel mailing list about some of my source-code commits)
About eight months ago, there was a foundation of something like an “audio club” in my university [1]. As soon i learned about that, i quickly got in touch with them and noticed that there was a major interest in analog issues (the only audio area with at least elective, courses in the university). So i told them about all the cool things that are available and ready to do with digital audio, mostly signal processing related. I talked in general, but of course i also talked about clam, with all its prototyping, real-time and easy development of plugins features. Even many of them ended installing and using it, and some even developing with more or less help. One thing to notice is that most of them are students from first years and most (but not all) are students with a basic programming level (because they are from electronics) but strong dsp knowledge (behind this is an university with more emphasis in theory than practice)
We started specifying plugins from a more abstract level (inputs/outputs/controls) and generating the source code base using
CLAM’s Templated Plugins Code Generator [2] and prototyping some simple applications. But one of the things we ended up doing was to take advantage of clam as platform to prototype medic related applications like filter ECG signal from noise in realtime, and some like _vice-versa_, i mean applying some processing knowledge from that area to audio.
Some of that work (one hour per week average) it’s now in the repo, most remarkable i think are filters work, by above the adaptative notch one (which even was used as a demo of a talk of one of the members about the steepest descent algorithm and its application to filter ECG signals)
Some development screenshots:
http://clam-project.org/wiki/Image:FilterByCoefExample.jpg
http://clam-project.org/wiki/Image:FilterExample-LP-HP.jpg
http://clam-project.org/wiki/Image:ThreeBandFilterOutputWithWhiteNoiseAsInput.jpg
http://clam-project.org/wiki/Image:GaussianWhiteNoiseHistogram.jpg
http://clam-project.org/wiki/Image:UniformWhiteNoiseHistogram.jpg
[0] FIUBA: Engineering Faculty of Buenos Aires University
[1] Group: http://code.google.com/p/club-audio-fiuba
Source code repo: http://groups.google.com/group/club_de_audio_fiuba
[2] http://audiores.uint8.com.ar/blog/2009/08/17/showing-a-little-about-clam-as-a-prototyping-tool-at-the-audio-club-of-fiuba/
algorithms
, audio
, blog
, c++
, CLAM
, ClubAudioFiuba
, effects
, english
, free software
, GPL
, ideas
, math
, matlab
, news
, noise
, plugins
, programming
, projects
, python
, signal processing 
Share This/Compártelo
Posted in audio, algorithms, effects, signal processing, free software, programming, matlab, GPL, c++, blog, noise, python, projects, math, English, CLAM, news, plugins, ideas, ClubAudioFiuba | No Comments »
Posted by hordia on 17th August 2009
Last week, at the recent ‘audio club’ of my university, I was showing how to work with the CLAM framework as a tool to prototype realtime audio signal processing applications in a simple and fast way.
We started with an example network to show some about the NetworkEditor capabilities: karaoke.clamnetwork

After that, we continue with a simple ‘diodo distortion’ plugin:
We specified and generated the source code base in this way:

We wrote this code:
bool Do()
{
bool result = Do( mEntrada.GetAudio(), mSalida.GetAudio() );
mEntrada.Consume();
mSalida.Produce();
return result;
}
bool Do(const Audio& in, Audio& out)
{
int size = in.GetSize();
const DataArray& inb = in.GetBuffer();
DataArray& outb = out.GetBuffer();
for (int i=0;i<size ;i++)
{
if ( fabs(inb[i])>0.8 )
outb[i] = inb[i]<0.? -0.8:0.8;
else
outb[i] = inb[i];
}
return true;
}
</size>
And built this net to try it:

The source code of the plugin ready to be compiled is here: pluginDistorsiónDiodo_ClubAudioFiuba.tar.gz
As extra, I leave here pluginDistorsiónDiodoConControlDeClipping_ClubAudioFiuba.tar.gz the same diode distortion, but with a clipping control to set the threshold when playing.
They liked these kind of prototyping features a lot, so probably we’re going to keep using it at the club.
audio
, CLAM
, ClubAudioFiuba
, effects
, english
, plugins
, programming
, signal processing 
Share This/Compártelo
Posted in audio, effects, signal processing, programming, English, CLAM, plugins, ClubAudioFiuba | 1 Comment »
Posted by hordia on 14th August 2009
Ayer estuve mostrando un poco de como usar el framework CLAM para prototipar aplicaciones de procesamiento en tiempo real de audio de forma rápida y sencilla.
Empezamos con una red de ejemplo para mostrar un poco el NetworkEditor: karaoke.clamnetwork

Luego seguimos con el plugin “distorsión de diodo”.
Especificamos y generamos el código base asi:

Escribimos este código:
bool Do()
{
bool result = Do( mEntrada.GetAudio(), mSalida.GetAudio() );
mEntrada.Consume();
mSalida.Produce();
return result;
}
bool Do(const Audio& in, Audio& out)
{
int size = in.GetSize();
const DataArray& inb = in.GetBuffer();
DataArray& outb = out.GetBuffer();
for (int i=0;i<size ;i++)
{
if ( fabs(inb[i])>0.8 )
outb[i] = inb[i]<0.? -0.8:0.8;
else
outb[i] = inb[i];
}
return true;
}
</size>
Y armamos una red para probarlo:

El código del plugin listo para compilar esta aca: pluginDistorsiónDiodo_ClubAudioFiuba.tar.gz
Como extra, en pluginDistorsiónDiodoConControlDeClipping_ClubAudioFiuba.tar.gz dejo la misma distorsión de diodo pero con un control para poder manejar el umbral de clipping mientras se reproduce.
audio
, Castellano
, CLAM
, ClubAudioFiuba
, effects
, plugins
, programming
, signal processing 
Share This/Compártelo
Posted in audio, effects, signal processing, programming, Castellano, CLAM, plugins, ClubAudioFiuba | No Comments »