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. Any suggestions, tricks or hacks most welcome. Rob
On Sun, Jan 11, 2009 at 9:39 PM, Robert Carter
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
Steve;
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.
That device is a commercial one, I looked at it (online) some time back. It's a bit of a shame that products like that don't document in what way they implement the standard. I've been eyeing several products, mostly integrated DJ solutions with jog-dials, and they tend to advertise that they come with software and that everything will work magically when you plug it in. I'm sure this brings a lot of joy to many people but it doesn't help us much in figuring out whether it will work with ChucK which only supports keyboard, mouse and joysticks. It would be nice to have a more general implementation for devices like this and tablets, etc but I'm not sure how hard that would be. I don't think ChucK reads USB/HID directly, I think it instead depends on the OS to negotiate with the device about it's nature and functionality but I'm not 100% sure of that, we'll have to ask resident "hid-man" Spencer. This may also depend on the OS; I gather the various OS's deal with this standard in rather different ways, it's really quite convenient how all of that is abstracted away for ChucKist use (except of course when we want something unusual). If it's not a "normal joystick" then I'm quite sure we won't be able to read it right now and the reverse holds true as well; I tried quite a few devices and I've never seen anything that was considered a joystick yet couldn't be read. I don't think there is anything that prevents this device from claiming it's a "HID drumpad", to quote from WikiPedia; Other devices
The USB HID class specifications allow for myriad other devices under the USB HID class. Some examples are automobile simulation controllers, exercise machines, telephony devices, audio controls, medical instrumentation, and even magic carpet simulators. Even uninterruptible power supplies declare themselves under this class, despite the fact they have no human interface at all. Any device can be a USB HID class device as long as a designer meets the USB HID class logical specifications. This is not to say that there is no need to ship drivers for these devices, nor that an operating system will immediately recognize the device. This only means that the device can declare itself under the human interface device class.
Yours, Kas.
To limit the complexity of the internal implementation and external usage, ChucK HID only functions with devices that claim to be a joystick, keyboard, or mouse. It appears that this device does not claim to be any of those device types. But for future development, I like the idea of providing a complementary, more generic HID interface that would function with any USB HID. spencer On Jan 12, 2009, at 3:47 AM, Kassen wrote:
Steve;
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.
That device is a commercial one, I looked at it (online) some time back. It's a bit of a shame that products like that don't document in what way they implement the standard. I've been eyeing several products, mostly integrated DJ solutions with jog-dials, and they tend to advertise that they come with software and that everything will work magically when you plug it in. I'm sure this brings a lot of joy to many people but it doesn't help us much in figuring out whether it will work with ChucK which only supports keyboard, mouse and joysticks.
It would be nice to have a more general implementation for devices like this and tablets, etc but I'm not sure how hard that would be. I don't think ChucK reads USB/HID directly, I think it instead depends on the OS to negotiate with the device about it's nature and functionality but I'm not 100% sure of that, we'll have to ask resident "hid-man" Spencer. This may also depend on the OS; I gather the various OS's deal with this standard in rather different ways, it's really quite convenient how all of that is abstracted away for ChucKist use (except of course when we want something unusual). If it's not a "normal joystick" then I'm quite sure we won't be able to read it right now and the reverse holds true as well; I tried quite a few devices and I've never seen anything that was considered a joystick yet couldn't be read. I don't think there is anything that prevents this device from claiming it's a "HID drumpad", to quote from WikiPedia;
Other devices
The USB HID class specifications allow for myriad other devices under the USB HID class. Some examples are automobile simulation controllers, exercise machines, telephony devices, audio controls, medical instrumentation, and even magic carpet simulators. Even uninterruptible power supplies declare themselves under this class, despite the fact they have no human interface at all. Any device can be a USB HID class device as long as a designer meets the USB HID class logical specifications. This is not to say that there is no need to ship drivers for these devices, nor that an operating system will immediately recognize the device. This only means that the device can declare itself under the human interface device class.
Yours, Kas. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Thanks for your responses. I'll try the lightweight OSC library. OSC seems like a good protocol for real-time interoperability. Rob On 12/01/2009, at 4:13 PM, Stephen Sinclair wrote:
On Sun, Jan 11, 2009 at 9:39 PM, Robert Carter
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 _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (4)
-
Kassen
-
Robert Carter
-
Spencer Salazar
-
Stephen Sinclair