Main Page       Index


ebass.lsp


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

 Another fm bass instrument, this one adapted from the DX7 patch "E.BASS A"


function

ebass

 (ebass step dur [:vel])
 An FM bass instrument.

 step   - MIDI key number.
 dur    - Flonum. Tones duration in seconds
 :vel   - MIDI velocity. Default 64
 return - Sound.


View the Sourcecode :



;; ebass.lsp 
;; Version  1.00   17 April 2005
;; 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
;;
;; Another fm bass instrument, this one adapted from the DX7 patch "E.BASS A"
;;

(require 'xenvelope)
(require 'saw-16)
(require 'map)
(require 'fmop)
(provide 'ebass)
(current-file "ebass")


(setf ebass:*map-decay-1* (map:linear-knee 4.85 0.50 0.40 00 72 128))
(setf ebass:*map-op1*     (map:linear-knee 1.33 1.00 1.00 00 45 128))
;(setf ebass:*map-op5*     (map:linear-knee 0.00 1.00 1.00 00 61 128))
(setf ebass:*velmap*      (map:linear-knee 0.00 1.00 2.00 00 64 128))


;; @doc function ebass
;; (ebass step dur [:vel])
;; An FM bass instrument.
;;
;; step   - MIDI key number.
;; dur    - Flonum. Tones duration in seconds
;; :vel   - MIDI velocity. Default 64
;; return - Sound.
;;

(defun ebass (step dur &key (vel 64))
  (let (hz p hz4 hz6 decay op2 op3 op5)
    (setf hz (* 0.5 (step-to-hz step)))
    (setf p (hz-to-step hz))
    (setf hz4 (* 10 hz))
    ;(setf hz6 (* 18 hz))
    (setf decay (send ebass:*map-decay-1* :get step))
    
    (setf op2 (mult (osc p (* decay 5))
		    (scale (* hz 2.530)(percussion (* decay 5)))))
   

    (setf op3 (mult (fmosc p (mult (osc (hz-to-step hz4) 2)
				   (scale (* hz 3.280)
					  (percussion (/ decay 5.0)))))
		    (scale (* hz 1.060 (send ebass:*velmap* :get vel))
			   (sum (percussion 0.001)
			   	(scale 0.80 (percussion (/ decay 3.00)))))))


    ;(setf op5 (mult (fmosc p (mult (osc (hz-to-step hz6) decay *saw-16*)
    ;				   (scale (* hz 2.530)(percussion 0.30))))
    ;		    (scale (* hz 0.530 
    ;			      ;(send ebass:*map-op5* :get step)
    ;			      (send ebass:*velmap* :get vel))
    ;			   (percussion decay))))
    (setf op5 (s-rest))

     (mult (fmosc p (sum op2 op3 op5))
	   (scale (send ebass:*map-op1* :get step)
		  (xasd 0.04 0.05 (max 0 (- dur 0.09)))))
    ))


Main Page       Index