Infinity footpedal external for Pd
Last updated: August 24th, 2009
The VEC Electronics Corporation make a nice sturdy USB footcontroller, traditionally used by transcriptionists to reverse/play/pause/forward audio. These pedals generally retail for $50-60USD and are easily found through online shops. When I found the Infinity IN-USB-1 (local link) for $4.99 at the local Goodwill, I instantly thought it could be repurposed as a nice foot/stomp controller for Pd.
I purchased it, brought it home, searched around for ways to read it, experimented and failed to use HCS's HID and then decided to just write my own abstraction. I hate reinventing the wheel, but when the other wheels don't fit it's sometimes a necessity.
The following archive(s) are available for download:
Since this is a software project, there really isn't much to show. The following are images of the pedal itself, the help patch, and a short demo video.
How to build:
If you have difficulty, first make sure the device shows up in lsusb:
Bus 001 Device 005: ID 05f3:00ff PI Engineering, Inc.
If it does, at least the pedal is recognized. You can then try the readpedal program (included) to troubleshoot. Make sure your permissions are correct and that you can read the device. If readpedal works but Pd can't find it, make sure that your Pd path is correct and the binary external has been installed.
How does it work?
The quick and dirty explanation (or the code speaks for itself):
The first instance of [infinity_pedal] causes a thread to be started. This thread performs blocking reads on the device, specified as the first creation argument. Subsequent instances of the [infinity_pedal] are simply registered in the list of objects to be dispatched. When pedal data is available from the reading thread, it sends outputs to the outlets of each of the registered Pd objects. Only those outlets whose state has changed will have data sent to them. A mutex is used in order to protect the list of registered Pd objects from changing while the pedal state is being dispatched. When the final Pd object instance has been deleted, the reading thread is sent a message (via pipe) to terminate.
Like all software projects, this one has its shortcomings:
And credit/mention is required for the following resources/links:
If you'd like to contribute to this project and make it more better, please contact me!