rsc3/doc/help/ugen/triggers/in-range.help.scrbl

23 lines
414 B
Text
Raw Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(in-range in lo hi)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Tests if a signal is within a given range.
If in is >= lo and <= hi output 1.0, otherwise output 0.0. output
is initially zero.
in - signal to be tested
lo - low threshold
hi - high threshold
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let ((a (in-range (mul (sin-osc kr 1 0) 0.2) -0.15 0.15)))
(audition (out 0 (mul a (mul (brown-noise ar) 0.1)))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00