jit.matrix

Output matrix values to a number box

To output matrix values to a number box, use metro 1000 to bang a counter object, and use that output as the matrix coordinate for the getcell message. Please note that the third outlet of counter does not send out a bang unless you tell it to (with a carrybang message). It sends out a 1 when the counter reaches its maximum, and a 0 on the next output. This causes a double trigger.

Calculating the mean of each cell of a series of matrices

To calculate the mean value of each cell of a series of Jitter matrices, you can keep the running sums in a matrix, and then divide by the number of instances received. That is, use jit.+ to keep the sum of all matrices received, use a counter to keep track of how many matrices you’ve received, and use jit./ to divide by that number (or jit.* to multiply by one over that number). In this example, a subpatch generates fake input data, and the rest of the patch shows the procedure for calculating the mean.