[CM] LADSPA implementation

Bill Schottstaedt bil@ccrma.Stanford.EDU
Fri, 15 Jun 2007 06:40:50 -0700


I pressed "send" and immediately thought, ladspa-channel is:


(define* (ladspa-channel ladspa-data #:optional (beg 0) ndur nsnd nchn (edpos -1))
  (let* ((selsnd (selected-sound))
         (selchn (selected-channel))
         (snd (or nsnd selsnd (car (sounds))))
         (chn (or nchn sndchn))
         (dur (or ndur (- (frames snd chn) beg)))
         (reader (make-sample-reader beg snd chn 1 edpos)))
    (select-sound snd)
    (select-channel chn)
    (let ((result (apply-ladspa reader ladspa-data dur "apply-ladspa")))
      (free-sample-reader reader)
      (if selsnd (select-sound selsnd))
      (if selchn (select-channel selchn))
      result)))


You could separate the input and output choices by adding more arguments --
in-snd in-chn and out-snd out-chn or whatever.