Hi there.
Here is my implementation.
I'm using Ableton Live as my DAW of choice but it should work with any DAW that can send MIDI out.
First go to
http://www.midiox.com/ and download MIDI Yoke, install it and after rebooting, in your preferences/options section of your program you should be able to see "Out To MIDI Yoke: 1" up to the number of devices you selected (I think 8 by default). You have to enable it if you want to be able to use it (in Ableton Live at least).
Create a new MIDI channel and select "Out to MIDI Yoke: 1" as the device and Channel 1.
Now on the Processing side, the following code should to do the job:
- import promidi.*;
- MidiIO midiIO;
- public void setup() {
- size( 800, 800);
- //get an instance of midiIO
- midiIO = MidiIO.getInstance(this);
- // uncomment to print a list of all devices
- //midiIO.printDevices();
- //At my system it tells me that "In From MIDI Yoke: 1" has a device number of 0
- //Use the right device number to select yours. openInput(deviceNum,MIDIChannel);
- //Remeber that MIDI Channel numbering starts from 0 so MIDI Channel 1 is 0 up to MIDI Channel 16 = 15
- midiIO.openInput(0,0); //Device 0 , Channel 1 that is...
- }
- public void draw() {
- //your code
- }
- void noteOn(Note note, int deviceNum, int midiChan){
- int vel = note.getVelocity();
- int pit = note.getPitch();
- println("Device Num: " + deviceNum);
- println("MIDI Channel: " + midiChan);
- println("Note Pitch: " + pit);
- println("Note Velocity: " + vel + "/n");
- background(0);
- ellipseMode(CENTER);
- ellipse(width/2,height/2 , random(width) , random(height));
- }
I hope this will work for you.
I'm using proMIDI as I had some problems with MIDIbus that I can't recall at the moment.
I used an enhanced version of the above code on a project I'm working right now. Have a look at
http://www.youtube.com/watch?v=w_IGofsGgbM.
Take care