PowerMate in .Net
I’m currently working on using the Griffin PowerMate USB device from .Net.
The PowerMate is a beautiful little rotary controller made of brushed steel with a blue “underglow” LED light. You can rotate it and click it, and that’s basically all. It does one thing, and does it well. Steve would have liked it.
I plan on using it to control my favourite Digital Audio Workstation, Ableton Live, through a small self-made program that reads the rotation and click events from the PowerMate and translates it into MIDI, easily digestible by AbletonLive.
By the way, even though Griffin’s website only states compatibility with Windows XP and Vista (and OSX, of-course), the device runs just fine on my Windows 7 x64 laptop. IIRC, I didn’t have to do anything out of the ordinary when I installed it.
Griffin was kind enough to send me some sample source code showing how to talk to the PowerMate using the Windows Driver Kit from C++, together with the USB specification for the device. The sample code uses MFC.
I have written two posts about this, which can be found here:
Some useful links
- Using PowerMate from .Net with C++/CLI and Windows Driver Development Kit (DDK)
- Using PowerMate with AutoHotkey
- Using PowerMate with Processing
- Using PowerMate with Pd
- Using PowerMate with Ableton Live (forum posts, book excerpt)
- The HID page – Excellent USB and HID resource
- Mike O’Brien’s Hid Library for .Net’
- HDIAPI – multiplatform HDI access (Windows, Linux, OSX)
- Busdog for inspecting USB traffic. See this MSDN article for how to enable unsigned drivers on Windows 7 x64. My laptop wasn’t stable with regards to hibernation when running this driver, so I uninstalled it as soon as I’d gotten what I wanted from it.
I have extended the HidLibrary with a small assembly containing three helper classes for the PowerMate, as well as two sample programs. I have created an installer with the two example applications and the PowerMate and HidLibrary assembly, which can be downloaded from here.
Good luck developing software for the PowerMate. Feel free to post your results as comments below if you create something cool.