Forums > MaxMSP

Serial object and custom controllers

January 8, 2007 | 6:42 am

Hello all,

I’m wondering what experience people have with the serial object. I have a midi/USB control board (home-made) that will eventually have a number of potentiometers, rotary encoders, and buttons. The chip programming is in C and everything (so far, two pots, two rotaries) works fine in Hyperterminal on XP.

I send all controller data with two indices preceding: board number (as there will eventually be multiple ones in a USB hub) and controller number. Then comes the 8-bit value. Like I said, seems to work fine in Hyperterminal. However, the Max patch I have for reading the data has serious latency issues. Output comes only once per second, even though I’m banging the serial object much more often than that. Also it essentially locks up the patch (not entirely but it’s beyond sluggish).

Anyone have any ideas where the problem might be? I would post the patch but without the control board it’s not so useful.

Also wondering if anyone has tips on how to deal with the incoming data—that is, to make sure they are received in the correct list size / chunk. I sent serial a "chunk 3" but it’s very inconsistent. I thought maybe zl group 3, however the incoming data is so sluggish that this doesn’t work either. The serial *characters received* value indicates that it’s getting a ton of data, but all I see are the once-per-second updates. Perhaps a termination character other than a new line / line feed?

The data in is ASCII—so I thought I’d use atoi to convert to the correct integer value. However, atoi converts *each character* in the ASCII value to its corresponding integer value, which was a bit unexpected…

If this doesn’t work out I’ll use the MIDI port on the board instead, which I imagine Max is better-equipped for. However, using USB has many advantages like speed and using cheap hubs instead of MIDI merges.

4.6.2, XP, baud rate 115200

Thanks!
–CJ


January 8, 2007 | 9:36 am

There’s an incremental update available for serial on Windows which
should solve your sluggishness problems.

http://cycling74.com/twiki/bin/view/IncrementalDownloads

jb

Am 08.01.2007 um 07:42 schrieb Seejay James:

> 4.6.2, XP, baud rate 115200


January 8, 2007 | 9:41 am

Thanks for that! I’ll try it out.

A record response time on that one!
–CJ


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