FoxDot.lib.Key

class FoxDot.lib.Key.Accompany(rel=[0, 2, 4])[source]

Bases: object

Like PlayerKey except it returns

find_new_value(playerkey)[source]
keys_last_value = None
this_last_value = 0
class FoxDot.lib.Key.NumberKey(value=0, function=None)[source]

Bases: object

An object that acts like a number but may have dependencies when returing its value. These are used when returing Player object attribute values accessed via getattr e.g. p1.dur or getattr(p1, “dur”). The parent attribute is the Player that contains the key or the referenced key in the case that the value has been maniupulated. e.g. if p1 is using p2.degree then p1.degree.parent == p1 and p1.degree.value.parent == p2.

accompany(rel=[0, 2, 4])[source]

Returns a PlayerKey whose function returns an accompanying note

get_max()[source]
get_min()[source]
get_root()[source]
has_circular_reference()[source]
index(sequence)[source]

Returns a Player Key that returns the element from sequence indexed using int(self)

is_root()[source]
map(mapping, default=0)[source]
now(other=None)[source]

Returns the current value in the Key by calling the parent

parent()[source]
path_to_root()[source]
semitones()[source]

Converts the current value into the semitone value using the parent’s scale

simple_map(mapping)[source]

Creates a new Player key that maps the values in the dictionary (mapping) to new values. Example use case:

` d1 >> play("x-o-", sample=d1.degree.simple_map( { "-" : -1, "o" : var([0,2]) })) `

spawn_child(function)[source]
transform(func)[source]

Returns a child Player Key based on the func. If the value returned is a PGroup, that is also transformed by the function

versus(rule=<function NumberKey.<lambda>>)[source]

p1 >> pads([0, 1, 2, 3]) p2 >> pluck([4, 5, 0]).versus(p1, rule)

class FoxDot.lib.Key.PlayerKey(value, function=None, player=None, attr=None)[source]

Bases: NumberKey

cmp(player, attr)[source]
get_player_attribute()[source]
name()[source]
set(value, time)[source]
update(value, time)[source]

Updates the contents of the PlayerKey if the time value is different to self.last_updated. If they are the same, the the contents become a PGroup of the two values

update_pattern()[source]
class FoxDot.lib.Key.Versus[source]

Bases: Accompany

find_new_value(playerkey)[source]
FoxDot.lib.Key.convert_pattern_args(func)[source]
FoxDot.lib.Key.convert_to_pattern(value)[source]