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

20 lines
431 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(rand lo hi)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Generates a single random value in uniform distribution from lo to
hi. It generates this when the SynthDef first starts playing, and
remains fixed for the duration of the synth's existence.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((a (line kr 0.2 0 0.1 2))
(p (rand -1 1))
(s (mul (f-sin-osc ar (rand 200 1200) 0) a)))
(audition (out 0 (pan2 s p 1))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00