Change Matrix dimension and plane count inside [jit.gen]

    Genbeginner

    Jan M
    Nov 01 2015 | 2:37 pm
    Hi genners,
    I just started to get my head around [jit.gen] . Do input and output matrices always have the same dimensions and plane count, or ist it possible to to change/re-arrange a matrix.
    In my case I am working on small matrices performing trigonometric calculations. Can I transform an input matrix with one plane and the dimensions 6 x1 to a matrix with two planes and the dimensions 2x1?
    The first three cells of the input matrix shall be mapped to the first cell of the output matrix (onto three planes) - and the same for the last three cells of the input matrix to the second cell of the output:
    Input: |--------------------------| | a | b | c | d | e | f | -> plane 0 |--------------------------|
    Output: |---------| | a | d | -> plane 0 | b | e | -> plane 1 | c | f | -> plane 2 |---------|
    Thanks, Jan

    • metamax's icon
      metamax
      Nov 01 2015 | 6:52 pm
      Jan, the left input sets the dim, planecount and data type for all inlets and outlets.
      Share
    • Jan M's icon
      Jan M's icon
      Jan M
      Nov 01 2015 | 7:54 pm
      Thanks Metamax,
      I was aware of this - but whatever i set as dimension or planecount attribute (even with adapt set to 0) the output format seems to be always the same as the input format. Is there a way to have different input and output dimensions and planecounts? I am not really a natural in matrices - maybe that's something completely of the idea of matrix calculation ....
    • Jesse's icon
      Jesse's icon
      Jesse
      Nov 01 2015 | 7:58 pm
      jit.repos should do what you're after. I don't think it's possible in jit.gen.
    • metamax's icon
      metamax's icon
      metamax
      Nov 01 2015 | 7:59 pm
      Jan, my understanding is that jit.gen can have n inlets/outlets but they all have to be the same size as the left inlet. Hence, the thinking is a bit backwards. In terms of size, you need to give it what you want.. rather than giving it something else to make what you want. If that makes sense.
    • Jan M's icon
      Jan M's icon
      Jan M
      Nov 01 2015 | 8:06 pm
      it does. And actually right now I realize that this it what is described in the help file : "...generates new Jitter Matrix Operator objects". It is for matrix operators not to transform matrices. So for transforming a matrix i'll have to stick to plain jitter objects.
      Thanks!!
    • Chris Vik's icon
      Chris Vik's icon
      Chris Vik
      Jan 03 2016 | 11:59 am
      Yo Jan. Bit late to the party.
      You can work with different dimension matricies - BUT, the output will always maintain the same attributes of the matrix entering in [jit.gen]'s first inlet.
      Max Patcher
      In Max, select New From Clipboard.
      Show Text
      The great bit about this is that you don't even need to use that matrix in any calculations; you can just bang a blank matrix that matches the format you want your output to be and trigger your calculations.
      Modulo [%] in combination with [/] into [int] will be your bread and butter when you're translating between matrix dimensions.
    • nicolasnuzillard's icon
      nicolasnuzillard's icon
      nicolasnuzillard
      Nov 05 2016 | 3:57 pm
      Here is an elegant way of doing what you want :)
      Max Patcher
      In Max, select New From Clipboard.
      But there is still useless calcuations, I was expecting to find something more powerful
    • Jan M's icon
      Jan M's icon
      Jan M
      Nov 06 2016 | 12:55 pm
      @NICOLASNUZILLARD Nice!!!! Thank you
    • nicolasnuzillard's icon
      nicolasnuzillard's icon
      nicolasnuzillard
      Nov 06 2016 | 2:13 pm
      This technique is usefull when you want an audio signal to set the XYZ position of an array of 3d points. I had the idea by watching the patch 22.CatchNurbs in the JitterRecipes. In the exemple patch I'm mentionning I didn't like the use of messages send to a matrix object so I did it a way so you don't have to send any messages.
    • Gussi's icon
      Gussi's icon
      Gussi
      Jan 12 2018 | 11:44 pm
      Alternatively, you could do the same thing with "jit.coerce" (check example). Combined with "jit.scanwrap" and "jit.dimmap" or "jit.transpose", you can solve most matrix "conversion/re-organization" problems.
      Max Patcher
      In Max, select New From Clipboard.
    • Oni Shogun's icon
      Oni Shogun's icon
      Oni Shogun
      Apr 25 2023 | 5:49 pm
      @Gussi
      Thank you so much for clarifying jit.coerce – I had been attempting to solve dim/plane-remapping using codebox to no avail and this opens up to super-sustainable methods.