rsc3/doc/help/ugen/oscillators/select.help.scrbl

35 lines
704 B
Text
Raw Permalink Normal View History

2022-08-24 13:53:18 +00:00
#lang scribble/manual
@(require (for-label racket))
@title{(select which array)}
2022-08-28 10:27:01 +00:00
2022-08-24 13:53:18 +00:00
The output is selected from an array of inputs.
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(audition
(let* ((a (mce3 (sin-osc ar 440 0) (saw ar 440) (pulse ar 440 0.1)))
(cycle 3/2)
(w (mul-add (lf-saw kr 1 0) cycle cycle)))
(out 0 (mul (select w a) 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00
Note: all the ugens are continously running. This may not be the
most efficient way if each input is cpu-expensive.
Here used as a sequencer:
2022-08-28 10:27:01 +00:00
@racketblock[
2022-08-24 13:53:18 +00:00
(audition
(let* ((n 32)
(a (make-mce (map (compose midi-cps u:floor)
(replicate-m n (rand 30 80)))))
(cycle (/ n 2))
(w (mul-add (lf-saw kr 1/2 0) cycle cycle)))
(out 0 (mul (saw ar (select w a)) 0.2))))
2022-08-28 10:27:01 +00:00
]
2022-08-24 13:53:18 +00:00