switch
Arguments: trigger, sig1, sig0 switch
Switch toggles between two signals given a trigger signal. A similar ugen is branch, which uses a gate instead of a trigger.
The example below uses switch to toggle between a random and steady signal to be used as frequency for a sine wave. The switching trigger is generated by metro.
# generate trigger signal with metro
1 metro
# signal 1: random signal
200 800 10 randh
# signal 2: steady signal
200
switch
0.3 sine