Main Page       Index


map-vibrato.lsp


 map-vibrato.lsp
 Version 1.00 	29 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

 Provides map between MIDI controller value and FM modulation index.
 See map.lsp


var

map:*vibrato*

 Contains a default mapping for MIDI mod wheel to modulation index mapping.
 (send map:*mod* :get m) --> i
 0 <= m < 128            --> 0 <= i <~ 0.05


function

map:vibrato

 (map:vibrato chz vib [mapobj])
 Determine modulator amplitude for given carrier frequency and modulation
 depth. 

 chz     - flonum. The frequency of the carrier in hertz.

 vib     - flonum. The modulation depth normalized to MIDI controller data 
           range 0<= vib < 128

 modobj - Object. An instance of a map object which must expose a :get
          method. The default is map:*vibrato* which results in a 
          modulation index between 0 and 0.05 over the vibrato depth 
          range 0 to 128.

 return - flonum


View the Sourcecode :



;; map-vibrato.lsp
;; Version 1.00 	29 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
;;
;; Provides map between MIDI controller value and FM modulation index.
;; See map.lsp
;;

(require 'map)
(provide 'map-vibrato)


;; @doc var map:*vibrato*
;; Contains a default mapping for MIDI mod wheel to modulation index mapping.
;; (send map:*mod* :get m) --> i
;; 0 <= m < 128            --> 0 <= i <~ 0.05
;;

(setf map:*vibrato* (send map:functional :new #'(lambda (x)(* x 0.0004))))


;; @doc function map:vibrato
;; (map:vibrato chz vib [mapobj])
;; Determine modulator amplitude for given carrier frequency and modulation
;; depth. 
;;
;; chz     - flonum. The frequency of the carrier in hertz.
;;
;; vib     - flonum. The modulation depth normalized to MIDI controller data 
;;           range 0<= vib < 128
;;
;; modobj - Object. An instance of a map object which must expose a :get
;;          method. The default is map:*vibrato* which results in a 
;;          modulation index between 0 and 0.05 over the vibrato depth 
;;          range 0 to 128.
;;
;; return - flonum
;;

(defun map:vibrato  (chz vib &optional (mapobj map:*vibrato*))
  (* chz (send mapobj :get vib)))


Main Page       Index