TWChoose:
Filter:
Classes | UGens > Triggers | UGens > Random

TWChoose : Object

Randomly select one of several inputs
Source: Osc.sc

Description

An output is selected randomly on receiving a trigger from an array of inputs.

the weights of this choice are determined from the weights array.

If normalize is set to 1 the weights are continuously normalized (this is an extra overhead) when using fixed values the normalizeSum method can be used to normalize the values.

TWChoose is a composite of TWindex and Select.

Class Methods

TWChoose.ar(trig, array, weights, normalize: 0)

TWChoose.kr(trig, array, weights, normalize: 0)

Arguments:

trig
array
weights
normalize

Inherited class methods

Instance Methods

Inherited instance methods

Examples

NOTE: all the ugens are continuously running. This may not be the most efficient way if each input is cpu-expensive.