FoxDot.lib.TimeVar

Time-Dependent Variables (TimeVar)

TODO: using __call__ -> go through getattribute and check instead of already having a __call__

class FoxDot.lib.TimeVar.ChildPvar(values, dur=None, **kwargs)[source]

Bases: Pvar

now(time=None)[source]

Returns the value currently represented by this TimeVar

class FoxDot.lib.TimeVar.ChildTimeVar(values, dur=None, start=0, **kwargs)[source]

Bases: TimeVar

When a new TimeVar is created using a function such as addition, e.g. var([0,2]) + 2, then a ChildTimeVar is created that contains a single value but also creates a new ChildTimeVar when operated upon and behaves just as a TimeVar does.

now(time=None)[source]

Returns the value currently represented by this TimeVar

class FoxDot.lib.TimeVar.Pvar(values, dur=None, **kwargs)[source]

Bases: TimeVar

A TimeVar that represents Patterns that change over time e.g.

>>> a = Pvar([ [0,1,2,3], [4,5] ], 4)
>>> print a # time is 0
P[0, 1, 2, 3]
>>> print a # time is 4
P[4, 5]
getitem(index, *args, **kwargs)[source]

Returns a TimeVar based on getting the index of this Pattern

new(other)[source]

Returns a new TimeVar object

set_eval(func)[source]
stream

alias of PatternContainer

transform(func)[source]

Returns a Pvar based on a transformation function, as opposed to a mathematical operation

class FoxDot.lib.TimeVar.PvarGenerator(func, *args, **kwargs)[source]

Bases: Pvar

If a TimeVar is used in a Pattern function e.g. PDur(var([3,5]), 8) then a PvarGenerator is returned. Each argument is stored as a TimeVar and the function is called whenever the arguments are changed

info()[source]
new(other)[source]

Returns a new TimeVar object

now()[source]

Returns the value currently represented by this TimeVar

set_eval(func)[source]
class FoxDot.lib.TimeVar.PvarGeneratorEx(func, *args)[source]

Bases: PvarGenerator

Un-Documented

class FoxDot.lib.TimeVar.TimeVar(values, dur=None, start=0, **kwargs)[source]

Bases: object

Var(values [,durs=[4]])

static CreatePvarGenerator(func, *args, **kwargs)[source]
all_values()[source]

Displays the values and the dependency value - useful for debugging

calculate(val)[source]

Returns val as modified by its dependencies

check_for_inf(duration)[source]
copy()[source]
depth = 128
extend(values, dur=None)[source]
flag_accessed()[source]
get_current_index(time=None)[source]

Returns the index of the value currently represented

get_current_time(beat=None)[source]

Returns the current beat value

get_durs()[source]
get_inf_index()[source]
get_values()[source]
classmethod help()[source]
i_invert()[source]
info()[source]
invert()[source]
json_value()[source]

Returns data about this TimeVar that can be sent over a network as JSON

lshift(duration)[source]
math_op(other, op)[source]

Performs the mathematical operation between self and other. “op” should be the string name of a dunder method e.g. __mul__

metro = <FoxDot.lib.TempoClock.TempoClock object>
new(other)[source]

Returns a new TimeVar object

now(time=None)[source]

Returns the value currently represented by this TimeVar

rshift(duration)[source]
classmethod set_clock(tempo_clock)[source]
set_eval(func)[source]
set_inf_index(value)[source]
shuf()[source]
static stream(values)[source]
transform(func)[source]

Returns a new TimeVar based on a func

update(values, dur=None, **kwargs)[source]

Updates the TimeVar with new values.

class FoxDot.lib.TimeVar.expvar(values, dur=None, start=0, **kwargs)[source]

Bases: linvar

get_timevar_value()[source]
FoxDot.lib.TimeVar.fetch(func)[source]

Function to wrap basic lambda operators for TimeVars

class FoxDot.lib.TimeVar.linvar(values, dur=None, start=0, **kwargs)[source]

Bases: TimeVar

get_timevar_value()[source]
now(time=None)[source]

Returns the value currently represented by this TimeVar

class FoxDot.lib.TimeVar.mapvar(key, mapping, default=0)[source]

Bases: Pvar

Like a Pvar, the mapvar returns a whole Pattern as opposed to a single value, but instead of using the global clock to find the current value it uses the value in an instance of the PlayerKey class or another TimeVar.

get_current_index(time=None)[source]

Returns the index of the value currently represented

now(time=None)[source]

Returns the value currently represented by this TimeVar

class FoxDot.lib.TimeVar.sinvar(values, dur=None, start=0, **kwargs)[source]

Bases: linvar

get_timevar_value()[source]
FoxDot.lib.TimeVar.PATTERN_METHODS = ['__abs__', '__add__', '__and__', '__bool__', '__class__', '__delattr__', '__dir__', '__eq__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getstate__', '__gt__', '__init__', '__init_subclass__', '__invert__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__nonzero__', '__or__', '__pow__', '__radd__', '__rand__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rmod__', '__rmul__', '__ror__', '__rpow__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__xor__', 'abs', 'accum', 'add', 'all', 'alt', 'amen', 'append', 'arp', 'asGroup', 'bubble', 'choose', 'compress', 'concat', 'convert_data', 'copy', 'count', 'deep_shuffle', 'deeprzip', 'deepzip', 'duplicate', 'eq', 'every', 'extend', 'float', 'fromString', 'get_behaviour', 'get_data', 'get_methods', 'getitem', 'getslice', 'group', 'help', 'i_reverse', 'i_rotate', 'i_shuf', 'i_sort', 'int', 'invert', 'items', 'iter', 'layer', 'limit', 'loop', 'ltrim', 'make', 'map', 'mirror', 'ne', 'new', 'norm', 'offadd', 'offlayer', 'offmul', 'palindrome', 'pivot', 'replace', 'reverse', 'rotate', 'sample', 'select', 'set', 'setitem', 'shuffle', 'shufflets', 'sort', 'splice', 'startswith', 'str', 'stretch', 'string', 'stutter', 'submap', 'swap', 'transform', 'trim', 'true_copy', 'true_shuffle', 'undup', 'zip', 'zipx']

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.