Jit matrix allocation question

Apr 18, 2012 at 10:35am

Jit matrix allocation question


I’m writing a jitter external, which receives network data when banged and outputs 4 different jitter matrixes filled with the data.

I’ve followed the jit.noise example – but my output matrixes need to have different dimsizes.

So the question is: how do I correctly initialize/set the matrixes ?

At the moment i’m calling


in the max wrapper new method. (without setting any args in max)

In the jitter init method I call jit_mop_output_nolink for all outputs.

And in the jitter matrix_calc method:
(code reduced to one output matrix)

out_skel_matrix = jit_object_method(outputs,_jit_sym_getindex,0);

if (x && out_skel_matrix) {
out_savelock_skel = (long) jit_object_method(out_skel_matrix,_jit_sym_lock,1);



jit_object_method(out_skel_matrix, _jit_sym_setinfo, &skeleton_minfo);
jit_object_method(out_skel_matrix, _jit_sym_getinfo, &skeleton_minfo); // this is necessary for some reason
[..fill matrixes with data..]

Is this the correct way to do this?
I’m asking because I get random crashes and corrupted patches. Seems like the external is overwriting memory beyond boundaries :(

Thanks for any comment!


You must be logged in to reply to this topic.