Personal tools
You are here: Home members hans's Home HID for Pd
Document Actions

HID for Pd

by Hans-Christoph Steiner last modified 2007-05-06 02:47 PM

I am interested in physical interfaces to computer music. Here are some objects I have written for Pd to enable the use of HIDs like joysticks, mice, tablets, etc.

rawHID(e)

I just finished my first version of some HID objects based on the Linux input events system. They give you the data from the input event system, rather than from the GUI. This means that your mouse/tablet movements are not constrained to the size and resolution of your screen.

There are two similar objects that I know of: [MouseState] from cyclone, and J. Sarlo's [joystick] . These objects differ in key ways:

[MouseState] is a version of the Max/MSP object for compatibility. So it is limited to only one mouse button, just like the Max/MSP object. It also outputs the position data in terms of absolute screen pixels. The [linuxmouse] outputs directly from the event system, so the position data is relative, and not tied to screen location or focus. Also, [linuxmouse] allows you to use the mouse wheel and up to 7 mouse buttons.

[joystick]'s outlets are dynamically created, so that different joysticks will cause different amounts of outlets. [linuxjoystick] has a fixed amount of outlets, so that your patch doesn't need to change with each joystick. The disadvantage of this is that this object doesn't support axes beyond X, Y, twist, throttle, and 1 hat switch. You can make a custom object for your joystick using an abstraction based on [linuxevent]. See the help for an example.

[linuxevent] gives you the raw input event data on four outlets: time, type, code, and value. The time outlet doesn't work yet, but it isn't essential. Christian Klippel has written a similar object for jMax.

Currently they are only for Linux, but I am working on the libSDL port now, which should work on Windows, GNU/Linux, and MacOS X. I have completed [linuxmouse], [linuxjoystick], and [linuxevent]. A [rawtablet] object would be trivial, but I don't have a tablet, so I can't test it. But you can make a tablet abstraction using [linuxevent].

Download linuxhid-2003.11.17.tar.gz

Force-Feedback

Gerard van Dongen-Gilcher's Force-Feedback Externals

I have started working with force-feedback AKA haptic feedback thanks to Gerard van Dongen-Gilcher's force-feedback objects.

iFeel External

I wrote a external for linux for the iFeel mice. It works in conjuction with this linux iFeel driver. In its current form, the ifeel.o kernel module crashes if you input data too quickly, I am looking into this. I suspect it is a bug in the linux kernel module.


Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser