Output to a jit.matrix from jit.cellblock

Phileas Dazeley-Gaist's icon

How might I approach outputting data from a jit.cellblock object to a jit matrix?

I'm using Adam Murray's csv2cellblock patcher to import data from a csv file to a jit.cellblock object, but from there on I'm stuck because I can't figure out a way to get the data from the cellblock object to a jit.matrix to work with it.

I found an old post on this forum about this topic (https://cycling74.com/forums/fitting-jit-cellblock-back-into-a-jit-matrix), but the solution will not work for me because my data is streamed straight from a file to the cellblock object with no jit.matrix in between.

Has anybody encountered this issue before? Any help figuring out how to get the data back out would be super appreciated! The only thing I can think of involves really inelegant brute force querying the jit.cellblock object containing my data, but I would really prefer to avoid that if it isn't. absolutely necessary.

Thanks in advance for your insight!

testcase's icon

never tried these patches and was confused at first because it actually only properly handles tsv files. anyway you could change the javascript this is based on to make a matrix and write the data to but at the moment the easiest way would be to make a matrix that is the correct dimensions for the data you are going to import. for instance if the file had 2 columns and 21 rows you could do something like this.

Max Patch
Copy patch and select New From Clipboard in Max.

Phileas Dazeley-Gaist's icon

Thank you for this! I wasn't familiar with the substitute object, but your patcher helped me get to where I wanted to go! Here's what my final solution looks like:

Max Patch
Copy patch and select New From Clipboard in Max.