Using Max to see usb controller
I wish to use a biofeedback controller to control MAX. It is USB and has a driver that writes to a file. It also uses an address to listen to: 0.0.0.0:8888 or 0.0.0.0:42420
Here is a link to the device:
Is there a way to get the data in?
Don’t you just use the hi object? and that picks up anything going in the usb port?
It’s a bit more than that, [hi] only picks up certain USB inputs that conform to a specific standard, typically joysticks, keyboards, specialty mice, etc. [serial] should pick up pretty much anything, but being able to parse it and do something with it is a different story.
This is a bit speculative as I only have info from my experiments, so if anyone at C74 can further clarify, that would be great.
I have used the hi object and got data. The data is all over the place so it looks pretty useless. Is there a way to talk to the unit via max using a network protocol and get the data that way?
That all depends on the unit, it will only talk to a network if it’s designed to do so. You’d need to check their docs carefully and see if it does UDP and/or TCP/IP. Both can be used to/from Max (udpsend/udpreceive, and jit.net.send/jit.net.recv), though sometimes there’s some parsing involved.
However, the data coming from the [hi] object may in fact be perfectly good. Try printing some in the Max window or to a [text] and look at it carefully. If it comes in pairs (index/value), then use [route] with the various index numbers and see if the data streams make more sense. Again, their documentation should identify what data streams the indices refer to. (Use a [gate] to the print window so you can start and stop the data, because it may be coming in fairly fast.)
Even if you can connect via a network, it likely wouldn’t be any different—you’d still have to parse the data. The exception would be if they have an application which formats and labels the data for you…? Which is great, but then you still don’t have it in Max. I’d take a longer look at [hi] and see if you can work it out.
Forums > MaxMSP