Forums > MaxMSP

Serial data being chopped short.

Jul 08 2013 | 9:32 am


I’ve been getting some help in my other post, about unpacking a packet of data, and sorry if its confusing starting a new topic, but I have the serial data unpacking now, however somewhere along the line in my patch, the serial data is being chopped short, i.e if you look at screen shot one, with the print object placed right after the serial in, each number of the serial packet is placed on a new line in the max window. Screen shot two, with the print object further down the patch, a limit of 12 characters will be placed on a line of the max window.

The serial data is coming from an arduino, which is using and external library to collect data from a brain reader (eeg device), the external declares the values as unsigned long variables… so some of the numbers coming through are in the millions, but mostly in the hundreds of thousands. So and example packet coming through will be:


however the numbers within the patch are being chopped up where they aren’t supposed to be, rather than being split at the commas, it will cut at 12 characters whether its in the middle of a number or not. So something is stopping the [unpack] working neatly, it all gets out of synch because the numbers are being split up ad-hoc.

I’m not sure if its a timing thing, or if one of the objects is imposing a limit or something???

I’m new to max, this is the first project I’ve attempted, and I’m sure its some beginners fundamental error I’m making, but I’ve spent the good part of the past week trying to fix the bugs, and this part has me stumped…

Thank you very much for any help!

  1. maxscreen22


  2. maxscreen11


  1. brainloopfinaltest1.maxpat
Jul 08 2013 | 9:33 am

The screenshots and max patch attached above…

  1. maxscreen2


  1. brainloopfinaltest.maxpat
Jul 08 2013 | 9:38 am

And this is the original topic, where SeejayJames and Karrrlo have been amazing with their help:

  1. maxscreen21


Jul 08 2013 | 9:50 am

I added a second zl group a few days ago, as with one group object, the [unpack] wasn’t working for some reason, I dont know why but a second one at least got the unpack to work.

  1. maxscreen1


Jul 09 2013 | 8:48 am

Hi I had this problem it think,

you haven’t got arduinos serial monitor open have you?

if so close that and try it,

i think the both fight for the serial data so they steal some from the other!

give it a go worked for me.


Viewing 5 posts - 1 through 5 (of 5 total)

Forums > MaxMSP