28 lines
943 B
Common Lisp
28 lines
943 B
Common Lisp
;nyquist plug-in
|
|
;version 4
|
|
;type generate
|
|
;categories "http://lv2plug.in/ns/lv2core#GeneratorPlugin"
|
|
;preview linear
|
|
;name "Reverse Chirp..."
|
|
;action "Generating Chirp..."
|
|
;author "dm"
|
|
|
|
;control crv-param "Curve" float "" 5 0 10
|
|
;control top-freq "Top Frequency (Hz)" float "" 6000 1 22050
|
|
;control duration "Length (Seconds)" float-text "" 0.05 0 5
|
|
;control tbl-choice "Waveform" choice "Sine,Sawtooth,Triangle,Square" 0
|
|
|
|
;tone which lingers at high frequencies before chirping downward to zero
|
|
;bandpass filter is applied to emphasize frequency halfway down
|
|
(let* ((passq 5.0)
|
|
(epsilon (expt 0.5 crv-param))
|
|
(tbl-form (case tbl-choice
|
|
(0 *sine-table*)
|
|
(1 *saw-table*)
|
|
(2 (maketable (pwlv -1 0.5 -1 0.501 1 1.0 1)))
|
|
(3 *tri-table*))))
|
|
(stretch-abs duration
|
|
(bandpass2
|
|
(hzosc (scale (- top-freq) (diff (pwev epsilon 1 1) 1))
|
|
tbl-form 0.0)
|
|
(/ top-freq 2.0) passq))) |