Main Page       Index


obx840.lsp


 obx840.lsp 
 Version 1.00  17 April 2005
 AuthorSteven 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

 Inspired by Oberheim matrix-1000 patch 8.40  


function

obx840:mono

 (obx840:mono dur [:afreq])
 A swooshing noise and warbling tone sound inspired by patch 8.40,
 "baseball", on the Oberheim Matrix 1000.

 dur    - Flonum. Signals duration in seconds.
 :afreq - Flonum. Tonal component center frequency, default 2 KHZ
 return - Sound.


function

obx840

 (obx840 dur)
 A stereo Version of obx840:mono
 
 dur    - Flonum. The tones duration in seconds
 return - Sound vector.


View the Sourcecode :



;; obx840.lsp 
;; Version 1.00  17 April 2005
;; AuthorSteven 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
;;
;; Inspired by Oberheim matrix-1000 patch 8.40  
;;

(require 'dlfo)
(require 'xenvelope)
(require 'skewsaw33)
(provide 'obx840)
(current-file "obx840")


;; Function obx840:filter 
;; Envelope and duel LFO modulated lp filter with amplitude envelope.
;;
;; The floor and ceiling variables set the (approximate) minimum and maximum
;; filter cutoff. Together they determine the amplitude of the envelope
;; generator which has a slow attack, 0 sustain and very long decay. There are
;; 2 LFOs one at 0.5 HZ and the other with random frequency around 0.35
;; HZ. The amplitude of the LFOs is kept low resulting and slight "swooshing"
;; of the filter.
;;
;; asig - sound. Source signal
;; dur  - flonum. Tones duration
;; return - sound.
;;

(defun obx840:filter (asig dur)
  (let (attack decay floor ceiling dev rate envsig)
    (setf attack 2.70)
    (setf decay (max 0 (- dur attack)))
    (setf floor 100)
    (setf ceiling 1000)
    (setf dev 100)
    (setf rate 0.50)
    (setf envsig (xasd attack 0 decay))
    (mult 
     (lp asig 
	 (sum floor
	      (scale (- ceiling floor) envsig)
	      (mult
	       (sum (dlfo rate dur :delay (* attack 3))
		    (dlfo (about (* rate 0.707)) dur :delay (* attack 2)))
	       (scale (* 0.5 dev) envsig))))
     envsig)))


;; function obx840:lfo
;; An LFO controlled LFO.
;;
;; cfreq  - flonum. The center frequency of the output LFO
;; dur    - flonum. Signals duration.
;; :dev   - flonum. Deviation in Hertz of output LFO frequency.
;; :rate  - flonum. Frequency of "inner" LFO.
;; :tab1  - Wtab.
;; :tab2  - Wtab.
;; return - Sound at control sample rate.
;;

(defun obx840:lfo (cfreq dur &key dev rate tab1 tab2)
  (setf dev (* -1 (or dev 4.00)))
  (setf rate (or rate 0.01))
  (setf tab1 (or tab1 *skewsaw33*))
  (setf tab2 (or tab2 *skewsaw33*))
  (fmlfo (sum cfreq (scale dev (lfo rate dur tab2))) tab1 (phase 0)))


;; function obx840:osc
;; LFO modulated triangle-wave oscillator.
;;
;; afreq  - Flonum. Audio center frequency in Hertz
;; dur    - Flonum. Tones duration in seconds.
;; lfreq  - Flonum. LFO center frequency
;; dev    - Flonum. LFO frequency deviation
;; rate   - Flonum. Rate at which LFO changes frequency.
;; atab   - WTAB. Audio wave table
;; ltab1  - WTAB. LFO "outer" wave table
;; ltab2  - WTAB. LFO "inner" wave table.
;; return - Sound.
;;

(defun obx840:osc (afreq dur &key lfreq dev rate atab ltab1 ltab2)
  (let (delay attack decay)
    (setf delay 2.0)
    (setf attack 2.0)
    (setf decay (max 0 (- (* .80 dur) attack)))
    (setf lfreq (or lfreq 4.01))
    (setf dev (or dev 4.00))
    (setf rate (or rate 0.05))
    (setf atab (or atab *tri-table*))
    (mult
     (fmosc (hz-to-step afreq)
	    (scale (* 0.5 afreq)(obx840:lfo lfreq dur 
					    :dev dev
					    :rate (about rate)
					    :tab1 ltab1 
					    :tab2 ltab2))
	    atab)
     (dasd delay attack 0 decay))))


;; @doc function obx840:mono 
;; (obx840:mono dur [:afreq])
;; A swooshing noise and warbling tone sound inspired by patch 8.40,
;; "baseball", on the Oberheim Matrix 1000.
;;
;; dur    - Flonum. Signals duration in seconds.
;; :afreq - Flonum. Tonal component center frequency, default 2 KHZ
;; return - Sound.
;;

(defun obx840:mono (dur &key afreq)
   (sum (obx840:filter (noise dur) dur)
	(scale 0.05 (obx840:osc (or afreq 2000) dur))))


;; @doc function obx840
;; (obx840 dur)
;; A stereo Version of obx840:mono
;; 
;; dur    - Flonum. The tones duration in seconds
;; return - Sound vector.
;;

(defun obx840 (dur)
  (sim (at 0.000 (cue (pan (obx840:mono dur :afreq 2000) 0.2)))
       (at 0.100 (cue (pan (obx840:mono dur :afreq 2000) 0.8)))))



Main Page       Index