FoxDot.lib.Repeat¶
- class FoxDot.lib.Repeat.MethodCall(parent, method, n, cycle=None, args=(), kwargs={})[source]¶
Bases:
objectClass to represent an object’s method call that, when called, schedules itself in the future
- class FoxDot.lib.Repeat.MethodList(root)[source]¶
Bases:
objectClass for holding information about the order of which methods have been called on Player attributes. root is the original Pattern.
- class FoxDot.lib.Repeat.Repeatable[source]¶
Bases:
object- after(n, cmd, *args, **kwargs)[source]¶
Schedule self.cmd(args, kwargs) in ‘n’ beats time
` # Stop the player looping after 16 beats p1 >> pads().after(16, "stop") `
- after_update_methods = []¶
- static convert_cycles(args, kwargs, occurence)[source]¶
Converts any values that are instances of Cycle to a var with the same duration as the frequency of the every call (occurrence)
- every(occurence, cmd, *args, **kwargs)[source]¶
Every n beats, call a method (defined as a string) on the object and use the args and kwargs. To call the method every n-th beat of a timeframe, use the cycle keyword argument to specify that timeframe.
- ::
# Call the shuffle method every 4 beats
p1.every(4, ‘shuffle’)
# Call the stutter method on the 5th beat of every 8 beat cycle
p1.every(5, ‘stutter’, 4, cycle=8)
# If the method is not valid but is a valid Pattern method, that is called and reverted
p1.every(4, ‘palindrome’)
- get_attr_and_method_name(cmd)[source]¶
Returns the attribute and method name from a string in the form “attr.method” would return “attr” and “method”. If attr is not present, it returns “degree” in place.
- get_method_by_name(cmd)[source]¶
Returns the attribute name and method based on cmd which is a string. Should be in form “attr.method”.
- is_pattern_method(method_name, attr='degree')[source]¶
Returns True if the method is a valid method of Pattern
- is_player_method(method_name, attr='degree')[source]¶
Returns True if the method is a valid method of Player
- method_synonyms = {'!': 'stutter', '->': 'rshift', '<-': 'lshift'}¶