Displacing a group of Jitter cells


    Sep 08 2017 | 6:05 pm
    Hi, all... I am using Jitter for a data visualization for the first time and, though it's a little outside of my normal Max/MSP routine, it's just the right tool but I'm having trouble materializing a particular thing:
    When a certain event happens, I need to push the top row in the matrix to the right by a certain amount of cells and shift the entire matrix down by one row.
    Here is an example of what i'm trying to accomplish. What am I doing wrong? Jitter is the best tool for this kind of data visualtization for me, but I just don't quite have the hang of it, yet.
    thanks, guys, Taylortronic

    • Sep 10 2017 | 8:24 pm
      Hi Taylortronic. I solved your problem in two different ways. The normal (idiomatic) way to do what you are asking is to use the @usedstdim 1 attribute and set the proper dstdimstart and dstdimend values. That works easily when you want to shift down the entire matrix by one row (see patch). Shifting values on a single row while leaving all else unchanged is a bit more complicated. I tried to use the same technique but I was getting a headache and decided to go the JS way. I attached a little JS file that works in combo with the patch (it's all in the folder). The JS object has two arguments: one is the name of the input matrix and the second is the name of the output matrix. The dimensions can be changed by sending a "setprop mat_dim $1 $2" message into the js object. Let me know if you can figure it out
    • Sep 12 2017 | 11:38 pm
      Wow. This is great work. JS, pattr and dictionaries are on a hot list of things I really want to use more effectively. Seeing how capably you handled that in JS makes me want to crack the books. When I first started sliding around the X-axis values it was moving so much more capably than my initial kind of hamfisted approach. Negative values on the x-axis crashed max (I changed the integer box to only allow positive numbers and I was off to the races). I'm gonna mess with this to the end of having a matrix transformation that results in a change to the entered matrix as described. The JS object is really the tool for this, thank you so much, I'll let you know how it goes. In the meantime, if you were brand new to JS, knowing what you know now, what would you do to acquire a functional knowledge of JS?
      thanks again, Michelez Taylortronic
    • Sep 13 2017 | 7:45 am
      Yes I find JS is often the bast way of dealing with matrix manipulations. here is a link to a manual for the JS API in max https://cycling74.s3.amazonaws.com/download/JavascriptInMax.pdf
      this is a good series of tutorial https://www.youtube.com/watch?v=vCvhpgF4Zp0
      I would check out more videos from this guy, I learned a lot from him...
      to get to know JS as a language you can find many videos on youtube (they usually include some HTML code to, which you don't need and can ignore). If you have any knowledge of high-level programming (e.g. Python) JS will be easy to learn, otherwise some more time is required. I would suggest to install node (https://nodejs.org/en/) and do some exercises outside of max, specifically using the terminal, since the js object is a little less intuitive than "pure JS": debugging in max can be a pain while it is fairly easy running scripts in node