break data into bytes and bits in max?

    Jun 20 2013 | 10:45 pm
    Hey all,
    I've seen the atoi object, but I'm curious if there is an ascii->bytes or something along those lines in MAX.

    • Jun 21 2013 | 12:26 am
      Difficult to say without more details on what you are trying to accomplish.
      But if you have formatted the data as bytes from wherever you are sending the data from then max will receive it in that format.
      For example, the SARCduino firmware ( ) sends all data as bytes which are then parsed in Max.
      All digital ports are read and their state is sent to max as 2 bytes (representing states for 12 inputs) which are then parsed in Max.
      Analog inputs are also sent as 2 bytes (per input) and the values parsed in Max to get the corresponding 0-1023 values.
      hope this helps
      - Miguel
    • Jun 21 2013 | 1:18 am
      Very helpful, thank you! I would like to read a binary file, like a movie, and send it out as bytes. So read in a large file, and a byte at a time break it down and have 8 message boxes, each with a 1 or 0. This would happen once per second, let's say. Very impractical, I know. Thoughts?
    • Jun 21 2013 | 1:50 am
      Haven't done it myself but it sounds like you should have a look at the [filein] object.
      Just tried it with a video file and seems to work although values are not 1 or 0. I'm sure if you try it out and ask in the forum for the specific object you might get better feedback from the community.
      Hope it all works well.
      - Miguel
    • Jun 21 2013 | 2:31 am
      this is one way you can convert decimal ints into binary bits
    • Jun 21 2013 | 12:05 pm
      This is how I isolate bits within a byte, similar to Floating Point's method.