;;; -*- Lisp -*-

(definstrument cnv (beg dur filter file &optional (size 128))
  (let* ((start (floor (* beg sampling-rate)))
	 (end (+ start (floor (* dur sampling-rate))))
	 (fil (open-input file))
	 (filt (open-input filter))
	 (ff (make-convolve :file fil :filter filt :start-time beg :fft-size size)))
    (Run
     (loop for i from start to end do
       (outa i (convolve ff))))
    (close-input filt)
    (close-input fil)))
