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

50 lines
919 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(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|)
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(define cusp_ cusp-l)
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
vary frequency
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(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))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
mouse-controlled params
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(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))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
as a frequency control
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(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))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00