rsc3/doc/help/ugen/oscillators/tw-index.help.scrbl

35 lines
806 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(tw-index in normalize array)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
triggered windex. When triggered, returns a random index value
based on array as a list of probabilities. By default the list of
probabilities should sum to 1.0, when the normalize flag is set to
1, the values get normalized by the ugen (less efficient)
Assuming normalized values
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(audition
(let* ((prob (mce3 1/5 2/5 2/5))
(freq (mce3 400 500 600))
(f (select (tw-index (impulse kr 6 0) 0.0 prob) freq)))
(out 0 (mul (sin-osc ar f 0) 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
Modulating probability values
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(audition
(let* ((t (impulse kr 6 0))
(a (mce3 1/4 1/2 (mul-add (sin-osc kr 0.3 0) 0.5 0.5)))
(f (select (tw-index t 1.0 a) (mce3 400 500 600))))
(out 0 (mul (sin-osc ar f 0) 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00