Main Page       Index


mutron.lsp


 mutron.lsp
 Version 1.00  31 October 2004
 Author Steven Jones

 Contact jones57@swbell.net include the word "nyquist" in subject line

 The contents of this file are released under the terms of the GNU General
 Public License. See the file LICENSE.txt

 An envelope follower controlled filter


function

mutron

 (mutron snd [:drive][:floor][:bw][:mode])
 An envelope follower controlled filter

 snd     - sound. The source signal.  snd may contain any number of channels
           but only the first channel is used as a control to the filter.

 :drive  - flonom.  Filter modulation depth in Hz. The drive value may be
           either negative of positive, default 5000

 :floor  - flonom.  The un-modulated filter frequency, default 500 Hz

 :bw     - flonom.  Filter band-width in Hertz, default 100.

 :mode   - symbol.  There are four modes:
           'LP ~ Low pass filter
           'HP ~ High pass filter
           'BR ~ Band reject filter
           'BP ~ Band pass filter (the default)

 wet     - flonum. Relative mix of effect and orignal signals 
           0 <= wet <= 1, default 1

 return  - sound.


View the Sourcecode :



;; mutron.lsp
;; Version 1.00  31 October 2004
;; Author Steven Jones
;;
;; Contact jones57@swbell.net include the word "nyquist" in subject line
;;
;; The contents of this file are released under the terms of the GNU General
;; Public License. See the file LICENSE.txt
;;
;; An envelope follower controlled filter
;;

(require 'reslp)
(require 'xmix)
(provide 'mutron)
(current-file "mutron")


;; @doc function mutron
;; (mutron snd [:drive][:floor][:bw][:mode])
;; An envelope follower controlled filter
;;
;; snd     - sound. The source signal.  snd may contain any number of channels
;;           but only the first channel is used as a control to the filter.
;;
;; :drive  - flonom.  Filter modulation depth in Hz. The drive value may be
;;           either negative of positive, default 5000
;;
;; :floor  - flonom.  The un-modulated filter frequency, default 500 Hz
;;
;; :bw     - flonom.  Filter band-width in Hertz, default 100.
;;
;; :mode   - symbol.  There are four modes:
;;           'LP ~ Low pass filter
;;           'HP ~ High pass filter
;;           'BR ~ Band reject filter
;;           'BP ~ Band pass filter (the default)
;;
;; wet     - flonum. Relative mix of effect and orignal signals 
;;           0 <= wet <= 1, default 1
;;
;; return  - sound.
;;

(defun mutron  (snd &key (drive 5000)(floor 500)(bw 100) mode (wet 1))
  (let (ctrlsrc modsig)
    (setf ctrlsig (if (soundp snd) snd (aref snd 0)))
    (setf modsig (sum floor (scale drive (rms ctrlsig))))
    (setf wet (float (min (max wet 0) 1)))
    (xmix:static 
     (cond ((eq mode 'LP)
	    (reslp snd modsig :bw bw))
	   ((eq mode 'HP)
	    (reshp snd modsig :bw bw))
	   ((eq mode 'BR)
	    (areson snd modsig bw 1))
	   (t (reson snd modsig bw 1)))
     snd
     wet)))


Main Page       Index