rsc3/doc/help/ugen/chaos/cusp-n.help.scm

32 lines
820 B
Scheme
Raw Normal View History

2022-08-24 13:53:18 +00:00
;; (cusp-n rate freq a b xi)
;; (cusp-l rate freq a b xi)
;; freq - iteration frequency in Hertz
;; a, b - equation variables
;; xi - initial value of x
;; Cusp map chaotic generator. Non- and linear- interpolating sound
;; generator based on the difference equation:
;; xn+1 = a - b*sqrt(|xn|)
(define cusp_ cusp-l)
;; vary frequency
(let ((x (mouse-x kr 20 sample-rate 0 0.1)))
(audition (out 0 (mul (cusp_ ar x 1.0 1.99 0) 0.3))))
;; mouse-controlled params
(let ((x (mouse-x kr 0.9 1.1 1 0.1))
(y (mouse-y kr 1.8 2 1 0.1)))
(audition (out 0 (mul (cusp_ ar (fdiv sample-rate 4) x y 0) 0.3))))
;; as a frequency control
(let* ((x (mouse-x kr 0.9 1.1 1 0.1))
(y (mouse-y kr 1.8 2 1 0.1))
(f (mul-add (cusp_ ar 40 x y 0) 800 900)))
(audition (out 0 (mul (sin-osc ar f 0.0) 0.4))))