• 0

How can I program a client for my USB device?


Question

I've got a Novation Nocturn and I'd like to program a client for it that's better than the current Automap software. It's a USB device and the software sends out MIDI messages so DAW software like Ableton can use it. It gives you hardware knobs and buttons instead of having to use virtual on-screen ones.

What programming language should I use? And what libraries?

I'll be running this application on Windows 7 32bit. I've mostly got programming experience in C# and C++.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

If it's possible at all then it's possible in C++ (and so you could always write a CLI wrapper and do the UI in C# if you so please), although I have no idea how you would actually be able to talk with the device. I don't suppose the manufacturer makes any low-level APIs publicly available. If so then it'd be at best a grueling reverse-engineering task.

Just my 2 uninformed cents, hopefully some more knowledgeable members will chime in.

Link to comment
Share on other sites

  • 0

although I have no idea how you would actually be able to talk with the device.

That's really what I'm stuck at if I'm honest.

Pretty confident that once I learnt how to communicate with it properly then I could make a really nice piece of software.

I've seen people on youtube use libusb and a python script under Linux to talk to it.

Link to comment
Share on other sites

  • 0

The first day I saw this post I wanted to give a chance for Neowin to answer this but since you didn't really get an answer, I thought I'd point you in the right direction. There's a lot of software device engineers over at www.stackoverflow.com, ask your question and I'm pretty confident you should get an answer :)

Link to comment
Share on other sites

  • 0

The first day I saw this post I wanted to give a chance for Neowin to answer this but since you didn't really get an answer, I thought I'd point you in the right direction. There's a lot of software device engineers over at www.stackoverflow.com, ask your question and I'm pretty confident you should get an answer :)

Yep, I suspect I will eventually head over there at some point for this project. Couldn't have done my degree without stackoverflow for sure.

Okay, so I have downloaded the following files:

libusb-win32-devel-filter-1.2.5.0.exe -> Installs the filter on the device. This was successful.

libusb-win32-bin-1.2.5.0.zip -> Extracts a folder called libusb-win32-bin-1.2.5.0 containing libraries and a header file.

SharpUSBlib20041208 -> Extracts a folder called SharpUSBlib containing.. well I'm not too sure really. There's a bunch of .cs files. There's a .prjx file but I haven't a clue what opens that. I suppose it looks similar to a Visual Studio's project folder.

From what I understand, I can just start a C++ project in Visual Studio and include the lusb0_usb.h header file and off I go. Obviously I'll have to read up on what libusb contains and how to use it and such. This seems ideal as it lets me use the original manufacturer's application, which I'll need to use in the mean time, and simultaneously develop my own application.

Edit: Looks like there's a new version out, coincidentally. We'll see if Novation have managed to get their monkeys to produce something good. You never know, it could be the mutt's nutts.

Link to comment
Share on other sites

  • 0

The SharpUSBLib prjx project is for SharpDevelop, but the newer versions of it just use the VS sln/proj format.

If you look in the bin/Win32 folder you'll find a DLL (ICSharpCode.USBlib.dll). You should be able to add that as a reference to your project in Visual Studio.

Since it's an old library (.NET 1.0) so you may want to rebuild it to match your VS project. I looked at the project file and it doesn't seem to have any weird configuration files so hopefully it would just be a matter of creating an empty class library and dropping the source files in it.

If you can use the C++ version you can cut out the "middleware" :)

Link to comment
Share on other sites

This topic is now closed to further replies.