sawbass.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 A band-pass filtered sawtooth instrument
wrapper
(sawbass plist dur [:vel][:arpeg][:pos][:filter][:bw][:tab])
A bandpass filtered sawtooth.
plist - list or flonum. List of MIDI key numbers. Alternatively a single key
number may be specified.
dur - flonum. Duration in seconds.
:vel - INTEGER. Velocity 0 <= vel < 128 , default 64
:arpeg - flonum. Arpeggio interval, default 0
:pos - flonum or SOUND. Pan position as either a fixed number in
interval (0,5) or a control signal over the same interval.
Default 0.5
:filter - flonum. The filter modulation depth as a ratio of the
pitch. Default 0.5
:tab - table. Wave table. Default *saw-16*
return - sound vector.
;; sawbass.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
;;
;; A band-pass filtered sawtooth instrument
;;
(require 'saw-16)
(require 'definst )
(provide 'sawbass)
(current-file "sawbass")
(definst sawbass:voice (filter tab bw)
(let* ((filter (or filter 0.5))
(tab (or tab *saw-16*))
(bw (or bw 100))
(frq (step-to-hz pitch))
(amp 1) ; (* 2 filter))
(env (percussion dur))
(aenv (scale amp env))
(filter-scale (* frq filter 1))
(fenv (scale filter-scale (percussion (* 1.1 dur)))))
(mult (reson (osc pitch dur tab) fenv bw 2 ) aenv)))
;; @doc wrapper sawbass
;; (sawbass plist dur [:vel][:arpeg][:pos][:filter][:bw][:tab])
;;
;; A bandpass filtered sawtooth.
;;
;; plist - list or flonum. List of MIDI key numbers. Alternatively a single key
;; number may be specified.
;;
;; dur - flonum. Duration in seconds.
;;
;; :vel - INTEGER. Velocity 0 <= vel < 128 , default 64
;;
;; :arpeg - flonum. Arpeggio interval, default 0
;;
;; :pos - flonum or SOUND. Pan position as either a fixed number in
;; interval (0,5) or a control signal over the same interval.
;; Default 0.5
;;
;; :filter - flonum. The filter modulation depth as a ratio of the
;; pitch. Default 0.5
;;
;; :tab - table. Wave table. Default *saw-16*
;;
;; return - sound vector.
;;
(defwrapper sawbass #'sawbass:voice #'definst:ampscale)