;;;
;;; Simple demonstration of one pole filter
;;; nando, October 28 1996
;;;

(definstrument onepole(start-time duration amplitude
				  &key
				  (b1 '(0 0.5 1 0.5)))
  (multiple-value-bind (beg end) (times->samples start-time duration)
    (let* ((noise (make-rand :frequency (* 0.49 *srate*) 
			      :amplitude amplitude))
	   (b1-env (make-env :envelope b1
			     :duration duration))
	   (opfilt (make-one-pole :a0 1.0 :b1 0.5)))
      (run
       (loop for i from beg to end do
	     (setf (mus-b1 opfilt) (env b1-env))
	     (outa i (one-pole opfilt (rand noise))))))))

