rsc3/doc/help/ugen/io/in-trig.help.scrbl

34 lines
663 B
Text
Raw Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(in-trig num-channels bus)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
Generate a trigger anytime a bus is set.
Any time the bus is "touched" ie. has its value set (using "/c_set"
etc.), a single impulse trigger will be generated. Its amplitude
is the value that the bus was set to.
Run an oscillator with the trigger at bus 10.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(let* ((t (in-trig 1 10))
(p (env-perc 0.01 1 1 (list -4 -4)))
(e (env-gen kr t t 0 1 do-nothing p))
(f (mul-add (latch t t) 440 880)))
(audition (out 0 (mul (sin-osc ar f 0) e))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
Set bus 10.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(with-sc3
(lambda (fd)
(send fd (c-set1 10 0.5))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00