So @dspk the mem operators absolutely are designed to store values. To use a MEM0D:
ENC1/VAL -> MEM0D/WRITE
SW1/VAL -> THRESH/IN
TRESH/HI -> MEM0D/READ
Then should be able to display the visibility of output MEM0D/VAL on play screen. this patch will store the last value output by encoder1 in MEM0D, and recall it when you bang MEM0D/READ with a button press.
Another use for MEM0D is to always output a particular number (call it n) whenever any number bangs read. Prior to MEM0D the only way I knew how to do this was MUL(0) -> ADD(n).
Here’s a recipe using MEM1D:
- set the range of ENC2 from 0->16 in increments of 1
- ensure MEM1D/TOG is 0
ENC2/VAL -> MEM1D/N
ENC1/VAL -> MEM1D/WRITE
SW1/VAL -> THRESH/IN
TRESH/HI -> MEM1D/READ
- enable play-screen visibility of output MEM1D/VAL & input MEM1D/N to test this patch.
- ENC2 selects the memory index
- twisting ENC1 will write a value to the currently indexed memory location
- pressing SW1 will recall the last value written with ENC1 to the slot indexed by ENC2.
MEM2D is identical to MEM1D, except it’s memory is a 2D array, indexed by the inputs X & Y. You’ll see that the operator GRIDRAW outputs in the following order:
X, Y, BUT
so the functionality of MEM operators is pragmatically designed to play well with GRIDRAW. For example store the Y value of grid button presses in a MEM1D, indexed by the X value:
GRIDRAW/X -> MEM1D/N
GRIDRAW/Y -> MEM0D/WRITE
SW/VAL -> THRESH/IN
THRESH/HI -> MEM0D/READ
MEM0D/READ -> MEM1D/WRITE
Please let me know if any problem or bug when setting up the patches described above. Hope you find this dark magic useful & powerful once mastered!