Main Page       Index


timpani.lsp


 timpani.lsp
 Version 1.00  29 March 05
 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

 A timpani simulation based on Sound On Sound Tutorials.


function

sos:timpani

 (sos:timpani  [:step][:decay][:vel][:trem][:tfrq][:tdecay])
 A timpani simulation based of Sound On Sound Tutorials.
 Uses 6 partial additive synthesis. 

 :step   - MIDI step number. default 50 
 :decay  - MIDI CTRL. decay time, default 32
 :vel    - MIDI Velocity. default 64
 :trem   - MIDI CTRL. Tremolo depth, default 16
 :tfrq   - MIDI CTRL. Tremolo frequency, default 8 
 :tdecay - MIDI CTRL. Tremolo delay time, default 1
 
 return  - sound.


View the Sourcecode :



;; timpani.lsp
;; Version 1.00  29 March 05
;; 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
;;
;; A timpani simulation based on Sound On Sound Tutorials.
;;

(require 'map)
(require 'map-vel6)
(require 'dlfo)
(require 'saw-16)
(provide 'timpani)
(current-file "timpani")


;; @doc function sos:timpani
;; (sos:timpani  [:step][:decay][:vel][:trem][:tfrq][:tdecay])
;; A timpani simulation based of Sound On Sound Tutorials.
;; Uses 6 partial additive synthesis. 
;;
;; :step   - MIDI step number. default 50 
;; :decay  - MIDI CTRL. decay time, default 32
;; :vel    - MIDI Velocity. default 64
;; :trem   - MIDI CTRL. Tremolo depth, default 16
;; :tfrq   - MIDI CTRL. Tremolo frequency, default 8 
;; :tdecay - MIDI CTRL. Tremolo delay time, default 1
;; 
;; return  - sound.
;;

(defun timpani (&key (step 50)(decay 32)(vel 64)(trem 16)(tfrq 8)(tdelay 1))
  (let (frq rise cfrq mfrq tnefn nsecomp nseenv decay-time tremfrq tdelay-time)
    (setf frq (step-to-hz step))
    (setf decay-time (map:ctrl 16 decay 1))
    (setf cfrq (* 0.58 frq))
    (setf mfrq (* 0.75 frq))
    (setf tremfrq (map:ctrl 20 tfrq 0.25))
    (setf tdelay-time (map:ctrl 4 tdelay 0))
    (setf tnefn #'(lambda (amp rfrq rdecay)
		    (mult (osc (hz-to-step (* rfrq frq)) decay-time)
			  (scale amp (percussion (* rdecay decay-time))))))
    (setf nseenv (percussion (* 0.4 decay-time)))
    (setf nsecomp
	  (reson (mult (highpass8 (mult (osc (hz-to-step cfrq) decay-time *saw-16*)
					(osc (hz-to-step mfrq) decay-time *saw-16*))
				  (* frq 1.33))
		       nseenv)
		 (scale (* 3.33 frq) nseenv) 500 1))
    (scale-db (send map:*vel6* :get vel)
	      (mult (sum 
		     (funcall tnefn 1.00 1.00 0.45)
		     (funcall tnefn 0.80 1.50 0.73)
		     (funcall tnefn 0.60 1.98 0.91)
		     (funcall tnefn 0.20 2.44 0.84)
		     (scale (send (map:quad 0 1 0 128) :get vel)
			    (sum
			     (funcall tnefn 0.10 3.60 0.90)
			     (funcall tnefn 0.05 5.00 0.95)))
		    (scale .25 nsecomp)
		    )
	      (sum
	       (percussion decay-time)
	       (scale (map:ctrl 0.5 trem 0) 
		      (dlfo tremfrq decay-time 
			    :delay (* .75 tdelay-time) 
			    :attack (* .25 tdelay-time))))))))


Main Page       Index