31 lines
763 B
Common Lisp
31 lines
763 B
Common Lisp
;nyquist plug-in
|
|
;version 4
|
|
;type process
|
|
;preview linear
|
|
;name "Convolve Tracks"
|
|
;action "Convolving..."
|
|
;author "dm"
|
|
|
|
(defun get-storage ()
|
|
(get '*SCRATCH* 'DM-CONVOLVE-STORAGE))
|
|
|
|
(defun clear-storage ()
|
|
(remprop '*SCRATCH* 'DM-CONVOLVE-STORAGE))
|
|
|
|
(defun store (signal)
|
|
(putprop '*SCRATCH* signal 'DM-CONVOLVE-STORAGE)
|
|
(sum (s-rest 0) signal))
|
|
|
|
(defun conv-stored (signal)
|
|
(convolve signal (get-storage)))
|
|
|
|
(setq index (get '*TRACK* 'INDEX))
|
|
(setq tracks (length (get '*SELECTION* 'TRACKS)))
|
|
;(print (symbol-plist '*SCRATCH*))
|
|
(if (= index 1)
|
|
(if (< tracks 2)
|
|
(print "Select two or more tracks")
|
|
(store *TRACK*))
|
|
(if (= index tracks)
|
|
(prog1 (conv-stored *TRACK*) (clear-storage))
|
|
(store (conv-stored *TRACK*)))) |