TrigChoice(input, choice, port=0.00, init=0.00, mul=1, add=0)
Random generator from user's defined values.
TrigChoice chooses randomly a new value in list `choice` each time it receives a trigger in its `input` parameter. The value is kept until the next trigger.
Parent class : PyoObject
Parameters:
input : PyoObject Audio signal sending triggers. choice : list of floats Possible values for the random generation. port : float, optional Portamento. Time to reach a new value. Defaults to 0. init : float, optional Initial value. Available at initialization time only. Defaults to 0.
Methods:
setInput(x, fadetime) : Replace the `input` attribute. setChoice(x) : Replace the `choice` attribute. setPort(x) : Replace the `port` attribute.
Attributes:
input : PyoObject. Audio trigger signal. choice : list of floats. Possible values. port : float. Ramp time.
Examples:
>>> s = Server().boot() >>> s.start() >>> m = Metro(.125).play() >>> tr = TrigChoice(m, [300, 350, 400, 450, 500, 550]) >>> a = Sine(tr, mul=.5).out()
Methods details:
TrigChoice.setInput(x, fadetime=0.05): Replace the `input` attribute. Parameters: x : PyoObject New signal to process. fadetime : float, optional Crossfade time between old and new input. Defaults to 0.05. TrigChoice.setChoice(x): Replace the `choice` attribute. Parameters: x : list of floats new `choice` attribute. TrigChoice.setPort(x): Replace the `port` attribute. Parameters: x : float new `port` attribute.