;;; ;;; Simple demonstration of one pole filter ;;; nando, October 28 1996 ;;; (definstrument rawnoise(start-time duration amplitude) (multiple-value-bind (beg end) (get-beg-end start-time duration) (let* ((noise (make-randh :frequency (* 0.49 sampling-rate) :amplitude amplitude))) (Run (loop for i from beg to end do (outa i (randh noise))))))) (definstrument onezero(start-time duration amplitude &key (a1 '(0 0.5 1 0.5))) (multiple-value-bind (beg end) (get-beg-end start-time duration) (let* ((noise (make-randh :frequency (* 0.49 sampling-rate) :amplitude amplitude)) (a1-env (make-env :envelope a1)) (ozfilt (make-one-zero :a0 1.0 :a1 0.5))) (Run (loop for i from beg to end do (setf (smpflt-a1 ozfilt) (env a1-env)) (outa i (one-zero ozfilt (randh noise)))))))) ;;; Coeff > 0 --> weak low pass ;;; (with-sound()(rawnoise 0 4 0.02)) ;;; (with-sound()(onezero 0 4 0.02 :a1 '(0 0 1 1))) ;;; Coeff < 0 --> weak high pass ;;; (with-sound()(rawnoise 0 4 0.02)) ;;; (with-sound()(onezero 0 4 0.02 :a1 '(0 0 1 -1)))