rsc3/doc/help/ugen/noise/ti-rand.help.scrbl

24 lines
466 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(ti-rand lo hi trig)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Generates a random integer value in uniform distribution from lo to
hi each time the trig signal changes from nonpositive to positive
values
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let ((p (ti-rand -1 1 (dust kr 10))))
(audition (out 0 (pan2 (pink-noise ar) p 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let ((f (mul-add (ti-rand 4 12 (dust kr 10)) 150 (mce2 0 1))))
(audition (out 0 (mul (sin-osc ar f 0) 0.1))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00