Main Page       Index


bog.lsp


 bog.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

 This started as an experiment to produce brass sounds, got this instead.

function

bog

 (bog pitch dur [:vel][:bw][:vib][:vdelay][:vtab][:vphase][:release][:fm])
 Produce croaking sounds. 

 pitch    - flonum. MIDI key number

 dur      - flonum. Duration

 :vel     - INTEGER. Velocity controls attack times and filter modulation
            depth. 0 <= vel < 128, default 64

 :bw      - flonum. Filter band width, default 200

 :vib     - flonum. Vibrato depth, default 0

 :vdelay  - flonum. Vibrato delay time, default 0.

 :vfrq    - flonum. Vibrato frequency, default 7.00 Hz.

 :vtab    - table. Vibrato wave table, default *tri-table*

 :vphase  - any. Vibrato phase. See phase function in utilities.lsp
            Default 'RANDOM

 :release - flonum. Release time, default 0.1

 :fm      - SOUND. Secondary fm modulator. Default NIL

 return   - SOUND.


View the Sourcecode :



;; bog.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
;;
;; This started as an experiment to produce brass sounds, got this instead.
;; 
;; 

(require 'posc)
(require 'dlfo)
(require 'map)
(require 'definst)
(provide 'bog)
(current-file "bog")


(setq +1HZ+ (hz-to-step 1))


(setq bog:tab (list (posc +1HZ+ :dur 1 :r 64 :tab *tri-table*) 1 t))
(setq bog:vel-attack-map (map:linear 0.25 0.01))
(setq bog:vel-filter-map (map:linear 300 1200))


;; @doc function bog
;; (bog pitch dur [:vel][:bw][:vib][:vdelay][:vtab][:vphase][:release][:fm])
;; Produce croaking sounds. 
;;
;; pitch    - flonum. MIDI key number
;;
;; dur      - flonum. Duration
;;
;; :vel     - INTEGER. Velocity controls attack times and filter modulation
;;            depth. 0 <= vel < 128, default 64
;;
;; :bw      - flonum. Filter band width, default 200
;;
;; :vib     - flonum. Vibrato depth, default 0
;;
;; :vdelay  - flonum. Vibrato delay time, default 0.
;;
;; :vfrq    - flonum. Vibrato frequency, default 7.00 Hz.
;;
;; :vtab    - table. Vibrato wave table, default *tri-table*
;;
;; :vphase  - any. Vibrato phase. See phase function in utilities.lsp
;;            Default 'RANDOM
;;
;; :release - flonum. Release time, default 0.1
;;
;; :fm      - SOUND. Secondary fm modulator. Default NIL
;;
;; return   - SOUND.
;;

(definst bog (vel bw vib vfrq vdelay vtab vphase release fm)
  (let* ((hz (step-to-hz pitch))
	(vel (or vel 64))
	(bw (or bw 200))
	(vamp (* hz (or vib 0.00) 0.001))
	(vfrq (or vfrq 7.00))
	(vdelay (or vdelay 0.25))
	(vattack 0.25)
	(vtab (or vtab *tri-table*))
	(vphase (or vphase 'RANDOM))

	;; Amplitude envelope
	(a (send bog:vel-attack-map :get vel))
	(d 0.2)
	(r (or release 0.1))

	;; Filter envelope
	(fa (* a 2))
	(fd 0.50)
	(fr r)
	(bw (or bw 200))
	(fscale (send bog:vel-filter-map :get vel)))
    (mult (highpass2
	   (reson 
	    (fmosc (hz-to-step hz)
		   (sum (or fm 0)
			(scale vamp 
			       (dlfo vfrq dur 
				     :delay vdelay :attack vattack
				     :tab vtab :phase vphase)))
		   bog:tab)
	    (scale fscale (adsr fa fd 0 fr 0.75 dur))
	    bw 1)
	   500)
	  (adsr a d 0 r 0.5 dur)))) 


Main Page       Index