A MemoRoutine behaves like a Routine, though it is not defined as a subclass of it. It stores last values, the maximum buffer size can be defined. MemoRoutine is internally used by PSx and related Pattern classes, which therefore also remember their last value(s).
Creates a MemoRoutine instance with the given Function.
func |
Function to instantiate the Routine with. |
stackSize |
Call stack depth, defaults to 512. |
bufSize |
Number of last values to store, defaults to 1. |
copyItems |
Determines if and how to copy items, which are returned by method next (run, value, resume) and which are either non-Sets or member of Sets, into the buffer. Takes Integer 0 (or false or Symbol \false), 1 (or true or Symbol \true) or 2 (or Symbol \deep). Other values are interpreted as 0. Defaults to 0. 0: storage of original item 1: storage of copied item 2: storage of deepCopied item |
copySets |
Determines if to copy Sets (and hence Events), which are returned by method next (run, value, resume), into the buffer. Takes Integer 0 (or false or Symbol \false), 1 (or true or Symbol \true). Other values are interpreted as 0. Defaults to 1. 0: storage of original Set 1: storage of copied Set NOTE: The distinction of copying items and sets makes sense in the case of event streams. Per default Events are copied (copySets == 1), not their values (copyItems == 0). By playing Events those are used to store additional data (synth ids, msgFuncs …) which is mostly not of interest when refering to the event stream, e.g. with PSx patterns which use MemoRoutine - copied Events will not contain this additional data. If values of Events or values returned directly by the stream (being no kind of Sets) are unstructured then copying makes no sense, this is the normal case, so copyItems defaults to 0. When going to alter the ouput, you might want to set copyItems to 1 for a MemoRoutine returning simple arrays or 2 for nested arrays (deepCopy). For deepCopying Events you'd have to set copySets to 1 and copyItems to 2 (an option copySets == 2 doesn't exist as it would be contradictory in combination with copyItems < 2). |
inval |
Same conventions with method yield as with aRoutine.next. |
Same as next.
Same as next.
Same as next.
Last value.
Instance variable getter method for array of stored last values.
Returns ith item of array of last values (keep in mind reversed order: last value first).
Size of array of last values.
Resets the MemoRoutine by resetting its Routine.
Stops the MemoRoutine by stopping its Routine.
Instance variable getter and setter methods. Counts each call of next / value / resume / run.
Instance variable getter and setter methods. If used directly the Integer copy code must be passed (see above).
Instance variable getter and setter methods. If used directly the Integer copy code must be passed (see above).
Instance variable getter and setter methods.