Issues on creating a dinamically resizable mosaic

    Jan 08 2013 | 6:34 pm
    Hello everybody,
    Taking inspiration from Jitter Recipe #36, I started working on a patch that grabs single frames and sends them to a matrix in a "mosaic" fashion. What I was trying to obtain was that the size of the "tiles" varies according to frames number. Hence, a single frame takes all the screen, two frames split it in a half and so on.
    I'm almost there. I found the way to create a square grid that adapts to the number of frames, and I can use this info to control the mesh and to feed the texture (as in the "TinyVideo" recipe)
    Now I'm stuck in correctly set the vertical position of the frames in the matrix that will become the texture. It seems I can't figure out the correct math.
    Please have a look at this patch. Try clicking a few times. It seems to work somehow for some values, but at the beginning it outputs values too high for the "row" coordinates, while the "columns" are set correctly.
    Any hint would be appreciated.

    • Jan 09 2013 | 2:42 pm
      Still banging my head against the wall.
      Here's the original part of the TinyVideo patch, which works with 100 frames
      And here's my attempt to make it work with a different number of frames.
      I made some modifications and now it works correctly for the first four frames (I decided to start from a 2x2 grid), then the vertical values start to go somewhere I don't understand....
    • Jan 09 2013 | 4:10 pm
      the original part of "TinyVideo" with some tricks....
    • Jan 09 2013 | 6:50 pm
      Thank you, matmat, you solved the issue.
      Now I got my patch to work!
      the only small issue remaining is related to the redrawing of the tiles when the page is filled.
      For example, when 4 tiles are displayed and I grab the 5th frame, the tiles are not resized until the 6th frame is grabbed. This happens also for the 17th frame, and so on.
      Here I limited the matrixset to 64, but I am currently using it with 1024 and seems to work fine.
    • Jan 09 2013 | 7:57 pm
      LSka, it seems your problem for that lies in the power of two math you've got going on, plus the count itself. Try adding a [+ 1] between the counter and the subpatcher and see what happens :)
    • Jan 10 2013 | 7:44 am
      Great, thank you Wetterberg!
    • Jan 10 2013 | 9:32 am
      So, here we are! Let's share it!
      Thanks again