[CM] LADSPA implementation
e deleflie
edeleflie@gmail.com
Tue, 19 Jun 2007 11:14:31 +1000
There is LV2 (http://lv2plug.in/), apparently the 'successor' spec to
LADSPA but there isn't much evidence of uptake (in either form:
plugins or hosts).... perhaps still a bit early.
... I still cant get apply-ladspa to write to the 'currently
selected' sound. I've written a simplified test script that
illustrates my problem (included below). So far, with my track-record,
I've probably written some bad code somewhere ... although the below
script executes without errors, but the resultant file is empty...
#!/usr/local/bin/snd -b
!#
(use-modules (ice-9 format))
; set some global variables
(set! (ladspa-dir) "/usr/lib/ladspa")
(let* ((outsound (new-sound "out.wav" :channels 2))
(insound (open-sound "in.wav")))
(let ((readers
(list (make-sample-reader 0 insound 0)
(make-sample-reader 0 insound 1) )))
; make sure the outsound is selected so LADSPA can write to it
(select-sound outsound)
; execute the ladspa plugin
(apply-ladspa readers
(list "amp.so" "amp_stereo" 0.5)
(mus-sound-frames "in.wav")
"applying amp_stereo")
; free up the reader buffers
(for-each (lambda (r) (if r (free-sample-reader r))) readers))
; write outsound to disk
(save-sound-as "out.wav" :sound outsound)
(close-sound insound)
(close-sound outsound)
)
(exit)