|
From: paul b. <sni...@fa...> - 2010-01-19 10:41:28
|
I have a messy program to do square root of sums of squares, similar to
vector distance. It seems that (float i) has to be used to make it run.
It's rather bloated:
(hzosc (sim (mult (sqrt (+ (* (float i) (float i)) (* (float j)
(float j)) ) ) (float p) ) (s-rest))))))))
Can the variables be "typed" globally, or some other fix?
;nyquist plug-in
;version 1
;type generate
;name "Heartbeat ver 2 ..."
;action "Overtones..."
;control p "Fundamental" real "Frequency" 100 0.01 100
;control n "number" int "overtones" 4 1 50
;control q "Quality" int "resonance" 2 1 50
;control bp "Bandpass Filter" int "center" 130 50 500
(setq newsound (s-rest)) ; initialise newsound
(setq newsound
(dotimes (i n newsound) ; return newsound
(dotimes (j n)
(setq newsound (sim newsound
(hzosc (sim (mult (sqrt (+ (* (float i) (float i)) (* (float
j) (float j)) )) (float p) ) (s-rest))))))))
;(setq newsound (bandpass2 newsound bp q)) ; filter
(seq (s-rest 0.25) (mult (/ 0.5 (peak newsound (truncate
*sound-srate*)))
newsound) (s-rest 0.25))
--
paul beach
sni...@fa...
|