sosdrums.lsp Version 1.00 20 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 Synthetic percussion instruments based on Sound On Sound Tutorials.
function
(sos:kick1 [:step][:decay][:vel][:pb][:click][:filter]) A "simplified" kick drum sound using triangle wave oscillator. :step - MIDI step. Default 31 :decay - MIDI CTRL. Decay time, default 28 :vel - MIDI VEL. Default 64 :pb - MIDI CTRL. Pitch bend amount, default 6 :click - MIDI CTRL. Relative mix click/tone, default 64 :filter - MIDI CTRL. Click filter parameter, default 12 return - sound.
function
(sos:kick2 [:step][:decay][:vel][:pb][:click][:filter][:shift]) Kick drum simulation using 6 partial additive synthesis with stretch tuning. :step - MIDI STEP. Default 31 :decay - MIDI CTRL. Decay time, default 28 :vel - MIDI VEL. Velocity, default 64 :pb - MIDI CTRL. Pitch bend depth, default 6 :click - MIDI CTRL. Click/tone mix, default 16 :filter - MIDI CTRL. Click filter, default 6 :shift - MIDI CTRL. Harmonic shift, default 5 return - sound.
function
(sos:snare [:step][:vel][:shift1][:shift2][:decay][:notch]) Snare drum simulation. The simulation uses three "additive lines" for the drum sound proper and sculpted noise for the snares. Two of the additive sounds utilize 4 odd harmonics partials with independently variable frequency shift. The third additive tone use two fixed non-harmonic partials. :step - MIDI STEP. Default 45 :vel - MIDI VEL. Default 64 :shift1 - MIDI CTRL. Harmonic shift, line 1, default 71 :shift2 - MIDI CTRL. Harmonic shift, line 2, default 112 :decay - MIDI CTRL. Decay time, default 24 :notch - MIDI CTRL. Noise notch filter, default 32
function
(sos:_kluster_ chz mhz [:i][:mod][:ctab][:mtab][:modsig][:dur]) Uses deep FM with harmonically rich waveforms to provide dense sound spectrum. _kluster_ forms the primary component for metallic sounds. chz - Flonum. Carrier frequency in HZ mhz - Flonum. Modulator frequency in HZ :i - MIDI CTRL. Modulation index, default 128 :mod - MIDI CTRL. Modulation index for external mod source, default 2 :ctab - Table. Carrier wave table, default *square-16* :mtab - Table. Modulator wave table, default *pulse25* :modsig - Sound. external modulation source, default (s-rest) :dur - Flonum. Tones duration in seconds, default 1 return - Sound.
function
(sos:kluster [:step][:c1][:c2][:c3][:m1][:m2][:m3][:i][:mod][:ctab][:mtab][:modsig][:dur]) Produces very dense cluster of sound by calling sos:_kluster_ 3 times in parallel :step - MIDI STEP. :c1 - Flonum. Relative frq carrier 1. Default 1.00000 :c2 - Flonum. Relative frq carrier 2. Default 1.05922 :c3 - Flonum. Relative frq carrier 2. Default 1.12225 :m1 - Flonum. Relative frq modulator 1. Default 1.41452 :m2 - Flonum. Relative frq modulator 1. Default 1.00191 :m3 - Flonum. Relative frq modulator 1. Default 1.41356 :i - MIDI CTRL. Modulation index, default 128 :mod - MIDI CTRL. Aux modulation source index, default 2 :ctab - Table. Carrier wave table. Default *square-16* :mtab - Table. Modulator wave table. Default *pulse25* :modsig - Sound. Aux modulation source. Default (s-rest) :dur - Flonum. Duration in seconds. Default 1 return - Sound.
function
(sos:ping amp sig decay floor sweep bw) Provides the initial "ping" for cymbal simulation. Its not very realistic in isolation. amp - Flonum. Relative linear amplitude. sig - Sound. Source signal. decay - Flonum. Decay time. floor - Flonum. Bandpass filter floor. sweep - Flonum. Bandpass filter sweep amount. bw - Flonum. Bandpass filter band width. return - sound.
function
(sos:sizzle amp sig attack decay floor sweep) Provides the sizzle component for cymbal simulation. amp - Flonum. Relative linear amplitude. sig - Sound. Source signal. attack - Flonum. Attack time. decay - Flonum. Decay time. floor - Flonum. Highpass filter floor. sweep - Flonum. Highpass filter sweep amount. return - sound
function
(sos:cym [:step][:rnd][:i][:mod][:modsig][:ctab][:mtab][:ping][:decay][:c1][:c2][:c3][:m1][:m2][:m3]) Cymbal simulation utilizing very dense sound clusters. The raw cluster tones are processed in parallel to provide "ping" and "sizzle" components. :step - MIDI step. Default 84. :rnd - MIDI CTRL. Amount of random deviation applied to step. Default 1. :i - MIDI CTRL. Modulation index, see sos:kluster. Default 128. :mod - MIDI CTRL. Auxiliary mod source index, see sos:kluster. Default 2. :modsig - Sound. Auxiliary pitch modulation source. Default silence. :ctab - Table. Carrier wave table. Default *square-16*. :mtab - Table. Modulator wave table. Default *pulse25*. :ping - MIDI CTRL. Relative mix of ping/sizzle components. Default 64. :decay - MIDI CTRL. Overal decay time. Default 12. :c1 - Flonum. Relative frq carrier 1. Default 1.00000 :c2 - Flonum. Relative frq carrier 2. Default 1.05922 :c3 - Flonum. Relative frq carrier 2. Default 1.12225 :m1 - Flonum. Relative frq modulator 1. Default 1.41452 :m2 - Flonum. Relative frq modulator 1. Default 1.00191 :m3 - Flonum. Relative frq modulator 1. Default 1.41356 return - Sound.
function
(sos:rimshot [:step][:decay][:vel][:sweep][:bw]) :step - MIDI STEP. Default 84 :decay - MIDI CTRL. Decay time. Default 0 :vel - MIDI VEL. Default 64. :sweep - MIDI CTRL. Filter sweep depth. Default 128 :bw - MIDI CTRL. Filter band width. Default 128
function
(sos:chh [args...]) Closed hi hat. A spcial case of sos:cym
function
(sos:hoh [args ...]) A special case of sos:cym
function
(sos:ohh [args...]) A special case of sos:cym
function
(sos:cow [:step][:decay][:vel][:r][:i][:nse]) A cowbell. :step - MIDI STEP. Default C5 :decay - MIDI CTRL. Decay time. Default 3 :vel - MIDI VEL. Default 64. :r - MIDI CTRL. FM modulation ratio. Default 56 :i - MIDI CTRL. FM modulation index. Default 13 :nse - MIDI CTRL. Relative mix noise/tone. Default 64 return - Sound.
function
(sos:clave [:step][:decay][:filter][:vel][:tab])
function
(sos:woodblock [:step][:decay][:filter][:vel][:tab])
function
(sos:shaker1 [:step][:decay][:vel][:skew][:hp][:lp][c1][:c2][:c3][:m1][:m2][:m3][:i][:mod][:ctab][:mtab][:modsig][:dur])
;; sosdrums.lsp ;; Version 1.00 20 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 ;; ;; Synthetic percussion instruments based on Sound On Sound Tutorials. ;; (require 'dlfo) (require 'rdrum ) (require 'square-16) (require 'pulse25) (require 'map) (require 'map-vel6) (require 'xenvelope) (require 'rmband) (provide 'sosdrums) (current-file "sosdrums") ;; @dic function sos:click ;; (sos:click amp [decay [filter]]) ;; Short duration click sound used as part of bass drum simulation. ;; ;; amp - flonum. Linear amplitude ;; decay - MIDI CTRL. Decay time, default 6 ;; filter - MIDI CTRL. Lowpass filter cutoff, default 32 ;; return - Sound. ;; (defun sos:click (amp &optional decay filter) (let (envsig decay-time cutoff) (setf decay-time (map:ctrl 2 (or decay 6) 0.01)) (setf envsig (percussion decay-time)) (setf cutoff (map:ctrl 9999 (or filter 32) 100)) (mult (sum (force-srate *sound-srate* envsig) (lowpass4 (noise decay-time) cutoff)) (scale amp envsig)))) ;; @doc function sos:kick1 ;; (sos:kick1 [:step][:decay][:vel][:pb][:click][:filter]) ;; A "simplified" kick drum sound using triangle wave oscillator. ;; ;; :step - MIDI step. Default 31 ;; :decay - MIDI CTRL. Decay time, default 28 ;; :vel - MIDI VEL. Default 64 ;; :pb - MIDI CTRL. Pitch bend amount, default 6 ;; :click - MIDI CTRL. Relative mix click/tone, default 64 ;; :filter - MIDI CTRL. Click filter parameter, default 12 ;; ;; return - sound. ;; (defun sos:kick1 (&key (step 31)(decay 28)(vel 64)(pb 6)(click 32) (filter 12)) (let (hz decay-time envsig pb-scale body-amp click-amp) (setf hz (step-to-hz step)) (setf decay-time (map:ctrl 2 decay 0.1)) (setf envsig (percussion decay-time)) (setf pb-scale (map:ctrl 1 pb 0.01)) (setf click-amp (map:ctrl 1.0 click 0 't)) (setf body-amp (- 1 click-amp)) (scale-db (send map:*vel6* :get vel) (sum (mult (fmosc step (scale (* pb-scale hz) envsig) *tri-table* 90) (scale body-amp envsig)) (sos:click click-amp decay filter) )))) ;; @doc function sos:kick2 ;; (sos:kick2 [:step][:decay][:vel][:pb][:click][:filter][:shift]) ;; Kick drum simulation using 6 partial additive synthesis with stretch ;; tuning. ;; ;; :step - MIDI STEP. Default 31 ;; :decay - MIDI CTRL. Decay time, default 28 ;; :vel - MIDI VEL. Velocity, default 64 ;; :pb - MIDI CTRL. Pitch bend depth, default 6 ;; :click - MIDI CTRL. Click/tone mix, default 16 ;; :filter - MIDI CTRL. Click filter, default 6 ;; :shift - MIDI CTRL. Harmonic shift, default 5 ;; ;; return - sound. ;; (defun sos:kick2 (&key (step 31)(decay 28)(pb 6)(vel 64)(click 16)(filter 6)(shift 5)) (let (hz decay-time envsig pb-scale body-amp click-amp frqshft tfn) (setf hz (step-to-hz step)) (setf decay-time (map:ctrl 4 decay 0.1)) (setf envsig (percussion decay-time)) (setf pb-scale (map:ctrl 1.0 pb 0.01)) (setf click-amp (map:ctrl 1.0 click 0 't)) (setf body-amp (- 1 click-amp)) (setf frqshft (map:ctrl 200 shift 0)) (setf tfn #'(lambda (ramp rfrq rdecay) (mult (osc (hz-to-step (+ (* hz rfrq) frqshft)) decay ) (scale ramp (percussion (* decay-time rdecay)))))) (scale-db (send map:*vel6* :get vel) (sum (scale body-amp (sum (funcall tfn 1.000 1.000 0.400) (funcall tfn 0.500 2.000 0.500) (funcall tfn 0.250 3.000 0.600) (funcall tfn 0.125 4.000 0.700) (funcall tfn 0.060 5.000 0.800) (funcall tfn 0.030 6.000 1.000) )) (sos:click click-amp decay filter)) ))) ;; @doc function sos:snare ;; (sos:snare [:step][:vel][:shift1][:shift2][:decay][:notch]) ;; Snare drum simulation. The simulation uses three "additive lines" for the ;; drum sound proper and sculpted noise for the snares. Two of the additive ;; sounds utilize 4 odd harmonics partials with independently variable ;; frequency shift. The third additive tone use two fixed non-harmonic ;; partials. ;; ;; :step - MIDI STEP. Default 45 ;; :vel - MIDI VEL. Default 64 ;; :shift1 - MIDI CTRL. Harmonic shift, line 1, default 71 ;; :shift2 - MIDI CTRL. Harmonic shift, line 2, default 112 ;; :decay - MIDI CTRL. Decay time, default 24 ;; :notch - MIDI CTRL. Noise notch filter, default 32 ;; (defun sos:snare (&key (step 45)(shift1 71)(shift2 112)(decay 24)(notch 32)(vel 64)) (let (hz fn frqshft1 frqshft2 lpfrq nffrq namp tamp decay-time) (setf hz (step-to-hz step)) (setf fn #'(lambda (ramp rfrq shift rdecay) (scale ramp (mult (osc (hz-to-step (+ (* rfrq hz) shift)) decay-time *sine-table* 90) (percussion (* decay-time rdecay)))))) (setf frqshft1 (map:ctrl 200 shift1 0)) (setf frqshft2 (map:ctrl 200 shift2 0)) (setf lpfrq (map:ctrl 5000 vel 500 't)) (setf nffrq (map:ctrl 5000 notch 50 't)) (setf decay-time (map:ctrl 4 decay 0.1)) (setf namp (map:ctrl 0.90 vel 0.3 't)) (setf tamp (- 1 namp )) (sum (mult (notch2 (lowpass4 (noise decay-time) lpfrq) nffrq 0.75) (scale namp (percussion decay-time))) (scale tamp (sum (funcall fn 1.000 1.00 frqshft1 0.40) (funcall fn 0.111 3.00 frqshft1 0.60) (funcall fn 0.040 5.00 frqshft1 0.80) (funcall fn 0.020 7.00 frqshft1 1.00) (funcall fn 1.000 1.00 frqshft2 0.50) (funcall fn 0.111 3.00 frqshft2 0.70) (funcall fn 0.040 5.00 frqshft2 0.90) (funcall fn 0.020 7.00 frqshft2 1.00) (funcall fn 0.111 1.622 0 0.60) (funcall fn 0.040 2.973 0 0.70)))) )) ;; @doc function sos:_kluster_ ;; (sos:_kluster_ chz mhz [:i][:mod][:ctab][:mtab][:modsig][:dur]) ;; Uses deep FM with harmonically rich waveforms to provide dense sound ;; spectrum. _kluster_ forms the primary component for metallic sounds. ;; ;; chz - Flonum. Carrier frequency in HZ ;; mhz - Flonum. Modulator frequency in HZ ;; :i - MIDI CTRL. Modulation index, default 128 ;; :mod - MIDI CTRL. Modulation index for external mod source, default 2 ;; :ctab - Table. Carrier wave table, default *square-16* ;; :mtab - Table. Modulator wave table, default *pulse25* ;; :modsig - Sound. external modulation source, default (s-rest) ;; :dur - Flonum. Tones duration in seconds, default 1 ;; ;; return - Sound. ;; (defun sos:_kluster_ (chz mhz &key i mod ctab mtab modsig dur) (let (mod-index aux-mod-index) (setf mod-index (map:ctrl 10 (or i 128) 0)) (setf aux-mod-index (map:ctrl 10 (or mod 2) 0)) (setf ctab (or ctab *square-16*)) (setf mtab (or mtab *pulse25*)) (setf dur (or dur 1)) (setf modsig (cond ((numberp modsig) (s-rest modsig)) ((soundp modsig) modsig) (t (s-rest dur)))) (fmosc (hz-to-step chz) (sum (scale (* chz aux-mod-index) modsig) (scale (* chz mod-index) (fmosc (hz-to-step mhz) (scale (* mhz aux-mod-index) modsig) mtab))) ctab))) ;; @doc function sos:kluster ;; (sos:kluster [:step][:c1][:c2][:c3][:m1][:m2][:m3][:i][:mod][:ctab][:mtab][:modsig][:dur]) ;; Produces very dense cluster of sound by calling sos:_kluster_ 3 times ;; in parallel ;; ;; :step - MIDI STEP. ;; :c1 - Flonum. Relative frq carrier 1. Default 1.00000 ;; :c2 - Flonum. Relative frq carrier 2. Default 1.05922 ;; :c3 - Flonum. Relative frq carrier 2. Default 1.12225 ;; :m1 - Flonum. Relative frq modulator 1. Default 1.41452 ;; :m2 - Flonum. Relative frq modulator 1. Default 1.00191 ;; :m3 - Flonum. Relative frq modulator 1. Default 1.41356 ;; :i - MIDI CTRL. Modulation index, default 128 ;; :mod - MIDI CTRL. Aux modulation source index, default 2 ;; :ctab - Table. Carrier wave table. Default *square-16* ;; :mtab - Table. Modulator wave table. Default *pulse25* ;; :modsig - Sound. Aux modulation source. Default (s-rest) ;; :dur - Flonum. Duration in seconds. Default 1 ;; return - Sound. ;; (defun sos:kluster (&rest args) (let (step hz arg1 arg2 arg3 c1 c2 c3 m1 m2 m3) (setf step (get-keyword-value ':step args 84)) (setf hz (step-to-hz step)) (setf c1 (get-keyword-value ':c1 args 1.00000)) (setf c2 (get-keyword-value ':c2 args 1.05922)) (setf c3 (get-keyword-value ':c3 args 1.12225)) (setf m1 (get-keyword-value ':m1 args 1.41452)) (setf m2 (get-keyword-value ':m2 args 1.00191)) (setf m3 (get-keyword-value ':m3 args 1.41356)) (setf arg1 (append (list (* hz c1)(* hz m1)) args)) (setf arg2 (append (list (* hz c2)(* hz m2)) args)) (setf arg3 (append (list (* hz c3)(* hz m3)) args)) (sum (apply #'sos:_kluster_ arg1) (apply #'sos:_kluster_ arg2) (apply #'sos:_kluster_ arg3)))) ;; @doc function sos:ping ;; (sos:ping amp sig decay floor sweep bw) ;; Provides the initial "ping" for cymbal simulation. Its not very realistic ;; in isolation. ;; ;; amp - Flonum. Relative linear amplitude. ;; sig - Sound. Source signal. ;; decay - Flonum. Decay time. ;; floor - Flonum. Bandpass filter floor. ;; sweep - Flonum. Bandpass filter sweep amount. ;; bw - Flonum. Bandpass filter band width. ;; return - sound. ;; (defun sos:ping (amp sig decay floor sweep bw) (let (envsig) (setf envsig (percussion decay)) (mult (reson sig (sum floor (scale sweep envsig)) bw 2) (scale amp envsig)))) ;; @doc function sos:sizzle ;; (sos:sizzle amp sig attack decay floor sweep) ;; Provides the sizzle component for cymbal simulation. ;; ;; amp - Flonum. Relative linear amplitude. ;; sig - Sound. Source signal. ;; attack - Flonum. Attack time. ;; decay - Flonum. Decay time. ;; floor - Flonum. Highpass filter floor. ;; sweep - Flonum. Highpass filter sweep amount. ;; return - sound ;; (defun sos:sizzle (amp sig attack decay floor sweep) (let (envsig) (setf envsig (xasd attack 0 decay)) (mult (hp sig (sum floor (scale sweep envsig))) (scale amp envsig)))) ;; @doc function sos:cym ;; (sos:cym [:step][:rnd][:i][:mod][:modsig][:ctab][:mtab][:ping][:decay][:c1][:c2][:c3][:m1][:m2][:m3]) ;; Cymbal simulation utilizing very dense sound clusters. The raw cluster ;; tones are processed in parallel to provide "ping" and "sizzle" components. ;; ;; :step - MIDI step. Default 84. ;; :rnd - MIDI CTRL. Amount of random deviation applied to step. Default 1. ;; :i - MIDI CTRL. Modulation index, see sos:kluster. Default 128. ;; :mod - MIDI CTRL. Auxiliary mod source index, see sos:kluster. Default 2. ;; :modsig - Sound. Auxiliary pitch modulation source. Default silence. ;; :ctab - Table. Carrier wave table. Default *square-16*. ;; :mtab - Table. Modulator wave table. Default *pulse25*. ;; :ping - MIDI CTRL. Relative mix of ping/sizzle components. Default 64. ;; :decay - MIDI CTRL. Overal decay time. Default 12. ;; :c1 - Flonum. Relative frq carrier 1. Default 1.00000 ;; :c2 - Flonum. Relative frq carrier 2. Default 1.05922 ;; :c3 - Flonum. Relative frq carrier 2. Default 1.12225 ;; :m1 - Flonum. Relative frq modulator 1. Default 1.41452 ;; :m2 - Flonum. Relative frq modulator 1. Default 1.00191 ;; :m3 - Flonum. Relative frq modulator 1. Default 1.41356 ;; return - Sound. ;; (defun sos:cym (&rest args) (let (decay klstr ping step rnd pamp pdecay pfloor psweep pbw ; ping samp sattack sdecay sfloor ssweep ; sizzle ) (setf step (get-keyword-value ':step args 84)) (setf rnd (map:ctrl 0.01 (get-keyword-value ':rnd args 1) 0)) (setf decay (map:ctrl 24 (get-keyword-value ':decay args 12) 0.1)) (setf klstr (apply #'sos:kluster (append (flatten (list ':step (about step rnd) args (list ':dur decay)))))) (setf ping (map:ctrl 1 (get-keyword-value ':ping args 64) 0 't)) (setf pamp ping pdecay 0.20 pfloor 1000 psweep 5000 pbw 500 ) (setf samp (- 1 pamp ) sattack 0.10 sdecay (max 4.00 decay) sfloor 1000 ssweep 3000 ) (mult (scale-db (send map:*vel6* :get (get-keyword-value ':vel args 64)) (sum (sos:ping pamp klstr pdecay pfloor psweep pbw) (sos:sizzle samp klstr sattack sdecay sfloor ssweep))) (percussion decay)))) ;; @doc function sos:rimshot ;; (sos:rimshot [:step][:decay][:vel][:sweep][:bw]) ;; ;; :step - MIDI STEP. Default 84 ;; :decay - MIDI CTRL. Decay time. Default 0 ;; :vel - MIDI VEL. Default 64. ;; :sweep - MIDI CTRL. Filter sweep depth. Default 128 ;; :bw - MIDI CTRL. Filter band width. Default 128 ;; (defun sos:rimshot (&key step decay vel sweep bw) (let () (setf decay (map:ctrl 4 (or decay 0) 0.1)) (sos:ping (db-to-linear (send map:*vel6* :get (or vel 64))) (sos:kluster :step (or step 84) :modsig decay) decay 1000 (map:ctrl 5000 (or sweep 128) 0) (map:ctrl 500 (or bw 128) 1)))) ;; @doc function sos:chh ;; (sos:chh [args...]) ;; Closed hi hat. ;; A spcial case of sos:cym ;; (defun sos:chh (&rest args) (let (cargs) (setf cargs '()) (push (list ':step (get-keyword-value ':step args 89)) cargs) (push (list ':decay (get-keyword-value ':decay args 1)) cargs) (push (list ':rnd (get-keyword-value ':rnd args 1)) cargs) (setf cargs (append (flatten cargs) args)) (apply #'sos:cym cargs) )) ;; @doc function sos:hoh ;; (sos:hoh [args ...]) ;; A special case of sos:cym ;; (defun sos:hoh (&rest args) (let (cargs) (setf cargs '()) (push (list ':step (get-keyword-value ':step args 90)) cargs) (push (list ':decay (get-keyword-value ':decay args 6)) cargs) (push (list ':rnd (get-keyword-value ':rnd args 1)) cargs) (setf cargs (append (flatten cargs) args)) (apply #'sos:cym cargs) )) ;; @doc function sos:ohh ;; (sos:ohh [args...]) ;; A special case of sos:cym ;; (defun sos:ohh (&rest args) (let (cargs) (setf cargs '()) (push (list ':step (get-keyword-value ':step args 90)) cargs) (push (list ':decay (get-keyword-value ':decay args 8)) cargs) (push (list ':rnd (get-keyword-value ':rnd args 1)) cargs) (push (list ':ping (get-keyword-value ':ping args 16)) cargs) (push (list ':i (get-keyword-value ':i args 64)) cargs) (setf cargs (append (flatten cargs) args)) (apply #'sos:cym cargs))) ;; @doc function sos:cow ;; (sos:cow [:step][:decay][:vel][:r][:i][:nse]) ;; A cowbell. ;; ;; :step - MIDI STEP. Default C5 ;; :decay - MIDI CTRL. Decay time. Default 3 ;; :vel - MIDI VEL. Default 64. ;; :r - MIDI CTRL. FM modulation ratio. Default 56 ;; :i - MIDI CTRL. FM modulation index. Default 13 ;; :nse - MIDI CTRL. Relative mix noise/tone. Default 64 ;; return - Sound. ;; (defun sos:cow (&rest args) (let (step r decay i nse vel) (setf step (get-keyword-value ':step args c5)) (setf r (get-keyword-value ':r args 56)) (setf decay (get-keyword-value ':decay args 3)) (setf i (get-keyword-value ':i args 13)) (setf vel (get-keyword-value ':vel args 64)) (setf nse (get-keyword-value ':nse args 64)) (let (chz mr modindex decay1 decay2 brkpnt cfrq q) (setf chz (step-to-hz step)) (setf mr (map:ctrl 2 r 1)) (setf modindex (map:ctrl 10 i 0)) (setf decay1 0.005) (setf decay2 (map:ctrl 16 decay 0.01)) (setf brkpnt 0.50) (setf cfrq 2600) (setf q 0.75) (scale-db (send map:*vel6* :get vel) (bandpass2 (mult (sum (mult (pink decay2) (scale (/ nse 128.0) (percussion (* decay2 0.5)))) (fmosc (hz-to-step chz) (scale (* chz modindex) (osc (hz-to-step (* chz mr)) decay2)))) (pwl 0 1 decay1 brkpnt decay2)) cfrq q))))) ;; @doc function sos:clave ;; (sos:clave [:step][:decay][:filter][:vel][:tab]) ;; (defun sos:clave (&rest args) (let (step decay filter q) (setf step (get-keyword-value ':step args 90)) (setf decay (get-keyword-value ':decay args 1)) (setf filter (get-keyword-value ':filter args 0)) (setf vel (get-keyword-value ':vel args 64)) (setf tab (get-keyword-value ':tab args *tri-table*)) (setf decay (map:ctrl 16 decay 0.01)) (setf filter (map:ctrl 10000 filter 1000)) (setf q 0.75) (scale-db (send map:*vel6* :get vel) (mult (bandpass2 (osc step decay tab 90) filter q) (pwl 0 1 0.001 0.75 decay))))) ;; @doc function sos:woodblock ;; (sos:woodblock [:step][:decay][:filter][:vel][:tab]) ;; (defun sos:woodblock (&rest args) (apply #'sos:clave (append args (list ':step 80 ':decay 0.4 ':tab *sine-table*)))) ;; @doc function sos:shaker1 ;; (sos:shaker1 [:step][:decay][:vel][:skew][:hp][:lp][c1][:c2][:c3][:m1][:m2][:m3][:i][:mod][:ctab][:mtab][:modsig][:dur]) ;; (defun sos:shaker1 (&rest args) (let (step decay vel hz skew hp lp) (setf decay (map:ctrl 4 (get-keyword-value ':decay args 12) 0.1)) (setf skew (map:ctrl 1 (get-keyword-value ':skew args 8) 0 't)) (setf hp (map:ctrl 5000 (get-keyword-value ':hp args 64) 0)) (setf lp (map:ctrl 5000 (get-keyword-value ':lp args 64) 1000)) (setf vel (get-keyword-value ':vel args 64)) (mult (highpass2 (lowpass2 (sum (noise decay) (apply #'sos:kluster (append (list ':dur decay args)))) lp) hp) (scale-db (send map:*vel6* :get vel) (ad decay skew))) ))