Forums > MaxMSP

break data into bytes and bits in max?

June 20, 2013 | 3: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.

June 20, 2013 | 5:26 pm

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

June 20, 2013 | 6:18 pm

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?

June 20, 2013 | 6:50 pm

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

June 20, 2013 | 7:31 pm

this is one way you can convert decimal ints into binary bits


— Pasted Max Patch, click to expand. —


June 21, 2013 | 5:05 am

This is how I isolate bits within a byte, similar to Floating Point’s method.

— Pasted Max Patch, click to expand. —
Viewing 6 posts - 1 through 6 (of 6 total)

Forums > MaxMSP