rsc3/doc/help/ugen/triggers/last-value.help.scrbl

24 lines
448 B
Text
Raw Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(last-value in diff)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
output the last value before the input changed more than a
threshhold.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let ((f (last-value (mouse-x kr 100 400 0 0.1) 40)))
(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
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((x (mouse-x kr 0.1 4 0 0.1))
(f (mul-add (u:abs (sub x (last-value x 0.5))) 400 200)))
(audition (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