views:

3337

answers:

4

I want to write C/C++ programs that take input from a MIDI device.

The MIDI device connects to my PC using a USB connector.

I'm looking for a (C/C++ implemented) library that I can use to read the MIDI signals from the MIDI device through the USB port.

I'm happy manipulating the MIDI data once I get it, I just don't want to have to implement the code for its capture.

I'm planning on writing my code using the Bloodshed Dev-C++ IDE on Windows XP.

+1  A: 

Check out the open source project LMMS. It's a music studio for Linux that includes the ability to use MIDI keyboards with software instruments. If you dig around in source files with 'midi' in the name, you'll probably find what you're looking for.

superjoe30
+1  A: 

Maybe the Jack sourcecode may help too. It's a sound driver for Posix compatible systems with a lot of possibilites and supports USB and Firewire audio devices.

bernhardrusch
+5  A: 

PortMidi is another open source cross-platform MIDI I/O library worth checking out. On the other hand, if you are working on a sysex type of app, then direct Win32 works easily enough.

Just came across another open source cross-platform framework that includes MIDI support: Juce.

Also, I should note that there isn't anything special about a USB connected MIDI device. It will still be presented as a MIDI device in Windows and you will use standard MIDI APIs (mmsystem) to communicate with it.

sean e
A: 
#include <windows.h>
#include <winable.h>

int o;

int main()
{

 BlockInput(true);

  While(o != 100)
  {
   o++;
   Beep(500,100);
   Beep(600,100);
   Beep(700,100);
   Beep(800,100);
   Beep(900,100);
   Beep(1000,100);
  }

 BlockInput(false);

 return 0;

}
John Appleseed
What the hell is this? <_<
Matteo Italia