rsc3/doc/help/ugen/controls/k2a.help.scrbl
2022-08-28 12:27:01 +02:00

38 lines
699 B
Racket

#lang scribble/manual
@(require (for-label racket))
@title{(k2a in)}
Control rate to audio rate converter.
To be able to play a control rate UGen into an audio rate UGen,
sometimes the rate must be converted. k2a converts via linear
interpolation.
in - input signal
@racketblock[
(audition
(out 0 (k2a (mul (white-noise kr) 0.3))))
]
@racketblock[
(audition
(out 0 (mce2 (k2a (mul (white-noise kr) 0.3))
(mul (white-noise ar) 0.3))))
]
@racketblock[
(let* ((block-size 64) ;; no ugen for this?
(freq (mul (fdiv (mouse-x kr 0.1 40 1 0.1) block-size) sample-rate)))
(audition
(out 0 (mul (mce2 (k2a (lf-noise0 kr freq))
(lf-noise0 ar freq))
0.3))))
]