Hi all,
I recently acquired a Manta controller. SC sees this as an HID device. I’m able to read sensor data into SC, but am having trouble sending data to it (e.g. to change sensor behavior from momentary to toggle). I communicated with Jeff Snyder, who relayed details on the internal specs, but he’s not a SC user and I can’t quite translate his info into usable code. Some excerpted details from him:
To send data to the manta to control the LEDs and the different
special modes of operation: The 2nd edition manta wants a 16-byte report.
byte 1-6: amber lights for hex pads
byte 7: amber lights for function buttons
byte 8-9: slider LEDs
byte 10: control byte, see below
byte 11-16: red lights for hex pads
byte 10:
bit 0 HEX_EXT // hexagon and function button LEDs computer controlled
bit 1 SLIDER_EXT // slider LEDs computer controlled
bit 2 TURBO // scan only the bottom 16 sensors at a faster, but less accurate, scan rate
bit 3 RAW_MODE // send the actual capacitance measurements the manta is taking
bit 4 HI_RES // scan only sensors 7 and 8 at slow, accurate rate with higher resolution (DEPRECATED IN 2nd ED)
bit 5 BUTTON_CTRL // only the function buttons respond to computer control
My code looks like this:
(
HID.closeAll;
~mantaInfo = HID.findAvailable.select({arg n; n.vendorName == "Snyderphonics"}).asList.at(0);
~manta = HID.open(~mantaInfo.vendorID, ~mantaInfo.productID, ~mantaInfo.path);
e = ~manta.elements;
)
//e is an Identity dictionary of the Manta's 66 HID elements
~manta.postOutputElements; //element 65, the last one, is the only one returned here, so I assume this is the element that "listens" for information from the computer
e[65].value_(1); //I've tried zero and lots of different positive values — they all seem to do nothing
e[65].value_(-1); //lots of different negative values turn all the Manta's LEDs on, and device communication is interrupted (presumably because it's drawing too much power). I need to physically disconnect and reconnect it at this point. I get this in the post window:
/*
device thread interrupted
HID: closing device 0
*/
e[65].value_([1,0]); //Arrays produce the following error:
/*
ERROR: Primitive '_HID_API_SetElementOutput' failed.
Wrong type.
RECEIVER: HID
*/
Right now, I’m just trying to do something super basic, like turn a hex sensor’s amber LED on. I have a feeling I’m just not formatting the data correctly, and maybe should be using Int8Array or something like that. But mostly I’m pretty lost. I’m aware of the Manta quark and briefly looked at it, but I’d like to be able to do this with the vanilla library. Does anyone have any experience here?
Eli