ladspar is a Ruby module for using LADSPA plugins. Here's a short
example:
---
require 'ladspa'
require 'narray'
# load the CMT library
cmt = LADSPA.load_library('cmt')
# get an instance of the amp_mono plugin
amp_mono = cmt.plugins.find {|p| p.label == 'amp_mono'}.instantiate(44100)
# The ports are Gain, Input, and Output.
amp_mono.ports[0].connect_port(1.5) # gain
input = NArray.sfloat(44100)
amp_mono.ports[1].connect_port(input)
output = NArray.sfloat(44100)
amp_mono.ports[2].connect_port(output)
amp_mono.activate if amp_mono.has_activate
# prep the input data ...
amp_mono.run
amp_mono.deactivate if amp_mono.has_deactivate
amp_mono.cleanup
---
This is the first release of ladspar; I consider it beta quality. I have
put it through its paces (more test code than swig code), but I am the
only one to have tested it. Nevertheless I think it is usable, and I am
eager to fix any bugs you may find.
Go grab it at
http://rubyforge.org/projects/ladspar
--
.O. Hans Fugal | De gustibus non disputandum est.
..O
http://hans.fugal.net | Debian, vim, mutt, ruby, text, gpg
OOO | WindowMaker, gaim, UTF-8, RISC, JS Bach
---------------------------------------------------------------------
GnuPG Fingerprint: 6940 87C5 6610 567F 1E95 CB5E FC98 E8CD E0AA D460