
(defun reverberate (input-name &optional (output-name "/zap/test.snd") (rev-amount .1) (rev-dur 3))
  (unwind-protect 
      (let* ((inf (open-input input-name))
	     (true-input-name (IO-nam inf))
	     (dur (clm-get-duration inf))
	     (outf (open-output output-name
				(make-header :channels (clm-get-channels inf)
					     :sampling-rate (set-srate (clm-get-sampling-rate inf))
					     :info (format nil "reverberate ~A ~A" input-name (clm-get-default-header)))))
	     ;;here we are making sure the output file agrees with the input file
	     ;;"clm-get-default-header" provides a time stamp
	     (true-output-name (IO-nam outf)))
	(nrev 0 (+ dur rev-dur) :volume rev-amount)
	(close-input inf)		;close reverb input
	(fasmix true-input-name)
	(close-output outf)
	(dac true-output-name))		;play the result
    (clu-reset)))


