math in a jitter matrix with jit.expr

Mar 2, 2012 at 4:57am

math in a jitter matrix with jit.expr

hi forum!

i have been hitting my head against a wall trying to get a simple math example working with jit.expr. as you can see on the left i have the expr object working on a single number. the idea is to run this expression in a matrix, but in setting up a simple example (on the right) i am having a fundamental issue, i would like to eventually get this into gen, but this is just my first step. what am i doing wrong? i would think the example on the right would take the cell value and add 2 but as you can see it is not working that way. any help would be much appreciated.

– Pasted Max Patch, click to expand. –
#62092
Mar 2, 2012 at 7:38am

I think you just need to send the float value in once the matrix has been through the left-inlet once:

– Pasted Max Patch, click to expand. –
#224282
Mar 2, 2012 at 5:26pm

Wesley,

first thank you for the help. i still have a fundamental issue, i thought that maybe the jit.expr only works with matrix so i tried to add a second matrix. so essentially what i am trying to do is start with a clean matrix (tester) add the data in tester_2 and take that data and repopulate tester and a bang will repeat this process. so cell 0 0 would produce the output on each bang 1 2 3 4 5 ect… not sure what i am doing wrong though…

– Pasted Max Patch, click to expand. –
#224283
Mar 2, 2012 at 6:33pm

Try this. The issue here is that the jit.expr object doesn’t know the input matrix size until it gets something in the left inlet. As a result, any inputs in other inlets will be adapted to the left-inlet size. If they are adapted, the original data will be lost.

– Pasted Max Patch, click to expand. –
#224284
Mar 2, 2012 at 8:58pm

ok so i think i have a solve with gen. but this could be a bug, notice in this patch the message box in the top right. if i have it set as is with 1 it will populate the entire matrix with 1 and on each bang increment as expected i.e. 1 2 3 4 in each cell. now if i add 1. to the first int in the message, it will recognize the float and then populate the rest of the matrix with the numbers that i had initially intended. i’m not sure if this is a bug or just my syntax error but i did think you guys should know. thanks again for all of your help!

– Pasted Max Patch, click to expand. –
#224285

You must be logged in to reply to this topic.