bases

class BinaryOpUGen(calculation_rate=None, special_index=None, left=None, right=None)

Bases: supriya.synthdefs.bases.PureUGen

A binary operator ugen, created by applying a binary operator to two ugens.

>>> left_operand = supriya.ugens.SinOsc.ar()
>>> right_operand = supriya.ugens.WhiteNoise.kr()
>>> binary_op_ugen = left_operand * right_operand
>>> binary_op_ugen
BinaryOpUGen.ar()
>>> binary_op_ugen.operator
BinaryOperator.MULTIPLICATION
property left

Gets left of BinaryOpUGen.

Returns input.

classmethod new(left=None, right=None)

Constructs a BinaryOpUGen unit generator graph.

Returns unit generator graph.

property operator

Gets operator of BinaryOpUgen.

>>> left = supriya.ugens.SinOsc.ar()
>>> right = supriya.ugens.WhiteNoise.kr()
>>> binary_op_ugen = left / right
>>> binary_op_ugen.operator
BinaryOperator.FLOAT_DIVISION

Returns binary operator.

property right

Gets right of BinaryOpUGen.

Returns input.

class MultiOutUGen(calculation_rate=None, special_index=0, channel_count=1, **kwargs)

Bases: supriya.synthdefs.bases.UGen

Abstract base class for ugens with multiple outputs.

__len__()

Gets number of ugen outputs.

Returns integer.

property channel_count

Gets channel count of multi-output ugen.

Returns integer.

class PseudoUGen

Bases: object

class PureMultiOutUGen(calculation_rate=None, special_index=0, channel_count=1, **kwargs)

Bases: supriya.synthdefs.bases.MultiOutUGen

Abstract base class for multi-output ugens with no side-effects.

These ugens may be optimized out of ugen graphs during SynthDef compilation.

class PureUGen(calculation_rate=None, special_index=0, **kwargs)

Bases: supriya.synthdefs.bases.UGen

Abstract base class for ugens with no side-effects.

These ugens may be optimized out of ugen graphs during SynthDef compilation.

class UGen(calculation_rate=None, special_index=0, **kwargs)

Bases: supriya.synthdefs.mixins.UGenMethodMixin

A UGen.

__getitem__(i)

Gets output proxy at index i.

>>> ugen = supriya.ugens.SinOsc.ar()
>>> ugen[0]
SinOsc.ar()[0]

Returns output proxy.

__len__()

Gets number of ugen outputs.

Returns integer.

property calculation_rate

Gets calculation-rate of ugen.

>>> ugen = supriya.ugens.SinOsc.ar(
...     frequency=supriya.ugens.WhiteNoise.kr(),
...     phase=0.5,
... )
>>> ugen.calculation_rate
CalculationRate.AUDIO

Returns calculation-rate.

property has_done_flag
property inputs

Gets inputs of ugen.

>>> ugen = supriya.ugens.SinOsc.ar(
...     frequency=supriya.ugens.WhiteNoise.kr(),
...     phase=0.5,
... )
>>> for input_ in ugen.inputs:
...     input_
... 
WhiteNoise.kr()[0]
0.5

Returns tuple.

property is_input_ugen
property is_output_ugen
property outputs

Gets outputs of ugen.

>>> ugen = supriya.ugens.SinOsc.ar(
...     frequency=supriya.ugens.WhiteNoise.kr(),
...     phase=0.5,
... )
>>> ugen.outputs
(CalculationRate.AUDIO,)

Returns tuple.

property signal_range

Gets signal range of ugen.

>>> ugen = supriya.ugens.SinOsc.ar()
>>> ugen.signal_range
SignalRange.BIPOLAR

A bipolar signal range indicates that the ugen generates signals above and below zero.

A unipolar signal range indicates that the ugen only generates signals of 0 or greater.

Returns signal range.

property special_index

Gets special index of ugen.

>>> ugen = supriya.ugens.SinOsc.ar(
...     frequency=supriya.ugens.WhiteNoise.kr(),
...     phase=0.5,
... )
>>> ugen.special_index
0

The special index of most ugens will be 0. SuperColliders’s synth definition file format uses the special index to store the operator id for binary and unary operator ugens, and the parameter index of controls.

Returns integer.

class UGenMeta(class_name, bases, namespace)

Bases: abc.ABCMeta

static compile(string, object_name, ugen_name, bases)
static get_channel_count(namespace, bases)
static make_constructor(ugen_name, bases, rate, parameters, default_channel_count=False, has_settable_channel_count=False)
static make_initializer(ugen_name, bases, parameters, has_calculation_rate=True, default_channel_count=False, has_settable_channel_count=False)
static make_property(ugen_name, input_name, unexpanded=False)
class UnaryOpUGen(calculation_rate=None, source=None, special_index=None)

Bases: supriya.synthdefs.bases.PureUGen

A unary operator ugen, created by applying a unary operator to a ugen.

>>> ugen = supriya.ugens.SinOsc.ar()
>>> unary_op_ugen = abs(ugen)
>>> unary_op_ugen
UnaryOpUGen.ar()
>>> unary_op_ugen.operator
UnaryOperator.ABSOLUTE_VALUE
classmethod new(source=None)

Constructs a UnaryOpUGen unit generator graph.

Returns unit generator graph.

property operator

Gets operator of UnaryOpUgen.

>>> source = supriya.ugens.SinOsc.ar()
>>> unary_op_ugen = -source
>>> unary_op_ugen.operator
UnaryOperator.NEGATIVE

Returns unary operator.

property source

Gets source of UnaryOpUGen.

Returns input.

class WidthFirstUGen(calculation_rate=None, special_index=0, **kwargs)

Bases: supriya.synthdefs.bases.UGen

Abstract base class for UGens with a width-first sort order.