sc3.base.functions module

AbstractFunction.sc

value(obj, *args, **kwargs)

Utility function for optional value/function parameters like completion_msg. If obj is a function it gets evaluated with *args and **kwargs and the result is returned, else obj is returned as is. Spare parameters are discarded.

class AbstractFunction

Bases: sc3.base.absobject.AbstractObject

sampled(n=80, from_=0.0, to=1.0)
class UnopFunction(selector, a)

Bases: sc3.base.functions.AbstractFunction

class BinopFunction(selector, a, b)

Bases: sc3.base.functions.AbstractFunction

class NaropFunction(selector, a, *args)

Bases: sc3.base.functions.AbstractFunction

class Function(func)

Bases: sc3.base.functions.AbstractFunction

This class is a wrapper for ordinary function which adds lazy evaluation capabilities (AbstractObject interface) and the interface needed to scheduled functions in clocks.

Note that any user defined function scheduled in clocks are internally wrapped in this class and there is no need to wrap them explicitly for that purpose.

function(func)

Decorator to wrap ordinary function types as AbstractObject.

This function is redundant with the Function class, it returns an instance of that class, but its use is recommended when used as decorator.