;;; -*- syntax: common-lisp; package: clm; base: 10; mode:lisp -*- ;;; ;;; Moog style four pole filter ;;; low pass, 24db/Oct, variable resonance, warm, analog sound ;-) ;;; [all this digital wizardry and we're back where we started!] ;;; by Fernando Lopez-Lezcano, nando@ccrma.stanford.edu ;;; (translation into clm of Tim Stilson's c moog filter implementation) ;;; ;;; Filter some noise as an example ;;; (definstrument filter-noise (start-time duration amp &key (noise-freq 10000) (freq-env '(0 400 1 400)) (res-env '(0 0.7 1 0.7))) (multiple-value-bind (beg end) (get-beg-end start-time duration) (let* ((fenv (make-env :envelope freq-env :start-time start-time :duration duration)) (qenv (make-env :envelope res-env :start-time start-time :duration duration)) (f (make-moog-filter :frequency 0 :Q 0.9)) (noi (make-randi :frequency noise-freq :amplitude amp))) (Run (loop for i from beg to end do (setf (moog-Q f)(env qenv) (moog-frequency f)(env fenv)) (outa i (moog-filter f (randi noi)))))))) #| (with-sound(:statistics t :sndfile "/zap/test.snd" :srate 44100) (filter-noise 0 5 0.041 :res-env '(0 0.94 1 0.94) :freq-env '(0 50 1 22050) :noise-freq 22050)) |#