[chuck-users] best way to read from HID device

Stephen Sinclair radarsat1 at gmail.com
Sun Jan 11 22:13:49 EST 2009


On Sun, Jan 11, 2009 at 9:39 PM, Robert Carter
<r.carter at cs.auckland.ac.nz> wrote:
> Hi everyone,
>
> I'm running chuck under linux and I want to play sounds using a plastic drum
> pad USB HID device. Here is an article with the technical details I have
> assembled so far:
>
> http://www.organicdesign.co.nz/USB_human_interface_devices_with_Linux
>
> I can read data from the /dev device and this data seems to be giving
> correct drum hit information. The hardware appears as a HID device but i've
> been unable to get the chuck joystick functions to use it. I thought perhaps
> I could use file IO to read blocks from the device and trigger sounds from
> that, but I can't see how you might achieve this in chuck.
>
> I have found a small C program that reads the usb device and translates this
> into JACK MIDI signals but this does not seem to be a good match for chuck.
> Another idea was to modify this program to send OSC messages instead of JACK
> messages, and feed into chuck that way.

This would be my suggestion.

You could extend the C program to use LibLo's lo_send() function
whenever an event occurs, and just receive these messages in ChucK.

Of course, it's preferable if ChucK can read HID directly, but I have
no experience with that.
I don't know if anyone else has the same device as you, if it's DIY
you might try some generic HID program on Linux to at least make sure
it reads as a normal joystick.

Steve


More information about the chuck-users mailing list