ladspar 0.1
I released ladspar, a Ruby module for using LADSPA plugins. I'm pretty psyched about it, mostly because it will let me write the textfile-driven software synth I've been dreaming about, but also because it's so darned cool and only took me a week to write. (of course it helps that Erin is out of town...)
Every silver lining has its cloud, though, and mine is my example in the README was seriously flawed. Here's the corrected example (I'm too lazy to repackage and reupload it):
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(2.0) # 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


