"draw" a picture with jitter?

    Nov 19 2009 | 5:14 pm
    is it possible to patch something together where i can add in a picture.. but the screen stays black... then add a soundfile and always when the sound file reaches a certain amp value (bangs)... a few pixels of the picture start to appear? so it looks like a mosaic or a puzzle that gets set togehter piece by piece?
    i know how to patch the max part of this... and i dont want you to explain the whole thing.. just give me a a few hints to get me going..
    thanks for your time

    • Nov 20 2009 | 7:41 am
      You could do it several ways, but a pretty simple one would be to have two jit.matrices of the same dimensions: one is the image, the other is a composite which starts all black, then gradually fills up with the pixels from the image matrix (getcell message). The composite image would be the one shown.
      Doubtless there are much slicker ways to do this with textures in OpenGL too.
    • Nov 20 2009 | 1:32 pm
      hey.. thanks for the reply iam almost there...
      i import a picture into my first matrix.. then i use the getcell msg. when i print this i get three numbers in my max window.. cell ** ** val **
      so as far as i understand this is telling me the position of the matrix and the value for this position..
      so i need to set these three values in the second jit.matrix..
      but here iam stuck.. using [route cell] and [unpack] i will only get the position.. but not the value.. how can i get the val ** into a float?
      (is the value the color information?)
    • Nov 20 2009 | 3:16 pm
      try this, there are three ways to do it in there. like everything else, there's always a simpler answer than one thinks at first...
      also for images be sure you use 4 char for your matrix, so you'd get
      cell 0 0 val 255 0 127 255
      or similar. the values are ARGB, so this cell would be blue with some green, no red, and fully opaque. So you're dealing with 4 color elements per cell, not just one. However if you're doing grayscale you can use just one, if the jit.matrix is 1 char.