[LAD] [ANN] lv2-c++-tools 1.0.0

Pau Arumí Albó parumi at iua.upf.edu
Wed Apr 16 16:36:54 UTC 2008

(answering to LAD only)

Luthman va escriure:

> This is a development tool, but I'm sending it to the LAU list as well
> in case there are any not-yet-hackers who would like to start writing
> effects or synths. It's easy, I promise. Here's the code you would need
> to write for a simple gain effect:
>  #include <lv2plugin.hpp>
>  #include "gain.peg"
>  class Gain : public LV2::Plugin<Gain> {
>  public:
>    Gain(double rate) : LV2::Plugin<Gain>(p_n_ports) { }
>    void run(uint32_t nframes) {
>      for (uint32_t i = 0; i < nframes; ++i)
>        p(p_out)[i] = p(p_gain) * p(p_in);
>    }
>  };
>  static int _ = Gain::register_class("http://my.plugin/");

This is simple indeed.
However, this code brings me some questions. Are all variables (p,
p_out, p_in, p_gain) declared as Plugin base class members? 
It does not make much sense to me that "p_gain" is a generic
What about p_n_ports? Seems undefined to me.
( Also i assume that p(p_in) should be p(p_in)[i] )

Hmmm, i smell that gain.peg might be the answer to some of this
questions. Could you explain what goes in there?


More information about the Linux-audio-dev mailing list