pushing/popping from a matrix

pmt's icon

Hi

I have a 3 plane matrix where x = 60 and y = 1 (a simple array), and I'm wondering if there is any object/function (or a well established design pattern), for popping or shifting a cell off of a matrix and moving every other cell over by one? conversely, is there an established function or pattern for pushing an item onto a matrix and shifting every cell over by one? many thanks!

Peter

Jeremy's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Probably you want to use jit.split and jit.concat for this. See attached:

Best, Jeremy

dtr's icon

Or do some matrix positioning gymnastics (srcdimxxx & dstdimxxx attributes), see Jitter tutorial 14.

pmt's icon

thanks! i'll check those both out. it also occurred to me that array manipulation with shift/push in JS might be easier (and just send the adjusted array/list into a matrix on each bang).