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

From: Lars Luthman <lars.luthman@email-addr-hidden>
Date: Wed Apr 16 2008 - 18:48:37 EEST

This software package contains libraries and programs that should make
it easier to write LV2 plugins and GUIs.

Download it: http://ll-plugins.nongnu.org/hacking.html
Read documentation: http://ll-plugins.nongnu.org/dox/lv2-c++-tools/
Or read a nice tutorial: http://ll-plugins.nongnu.org/lv2pftci/

To build and install, run

 ./configure
 make
 su -c 'make install'

You can pass some options to configure, e.g. --prefix=/usr to install
everything in /usr (the default is /usr/local).

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/");

And here's the code you would need for a GUI for a synth plugin with a
button that sends a test tone:

 #include <lv2gui.hpp>
 #include "mysynth.peg"
 
 class MySynthGUI : public LV2::GUI<MySynthGUI, LV2::WriteMIDI<true> > {
 public:
   MySynthGUI(const std::string& URI) : m_button("Click me!") {
     m_button.signal_pressed().connect(mem_fun(*this, &MySynthGUI::send_note_on));
     m_button.signal_released().connect(mem_fun(*this, &MySynthGUI::send_note_off));
     pack_start(m_button);
   }
 protected:
   void send_note_on() {
     uint8_t event[] = { 0x90, 0x40, 0x40 };
     write_midi(p_midi, 3, event);
   }
   void send_note_off() {
     uint8_t event[] = { 0x80, 0x40, 0x40 };
     write_midi(p_midi, 3, event);
   }
   Gtk::Button m_button;
 };
 
 static int _ = MySynthGUI::register_class("http://my.gui/");

See? Trivial. Read more in the tutorial linked above.

--ll

_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user

Received on Wed Apr 16 20:15:16 2008

This archive was generated by hypermail 2.1.8 : Wed Apr 16 2008 - 20:15:17 EEST