rsc3/doc/help/ugen/triggers/timer.help.scrbl

20 lines
364 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(timer trig)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Returns time since last triggered
Using timer to modulate sine frequency: the slower the trigger is
the higher the frequency
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((t (impulse kr (mouse-x kr 0.5 20 1 0.1) 0))
(s (sin-osc ar (mul-add (timer t) 500 500) 0)))
(audition (out 0 (mul s 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00