Ok, I've fixed the problem, and the best way to describe it is to examine the difference between the problem code and this code. Not a lot of differences but hopefully it might help someone in the same problem that I was.
Couple of notes.
1. I referred back to getting promidi_plug working with my setup, rather than a simple copy of the code imported into eclipse.
2. Instead of cutting and pasting the code, importing and exported version of the code from within the PDE was crucial as it included all the references to the included libraries as processing appears to wrap up all it needs when you export a sketch. This is useful as a starting point when working in eclipse.
3. For some reason although MIDI mon says channel 1 coming in, the code needs channel 0 specified in the code (RWMidi here I come?).
4. You are recommended to specify an arbitrary package name in eclipse (I called mine prom).
5. I cut some code out for program Change and controller functions which I've left in this example for copy/paste completeness.
Code:
package prom;
import processing.core.*;
import processing.xml.*;
import promidi.*;
import java.applet.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import java.util.zip.*;
import java.util.regex.*;
public class promidi_plug extends PApplet {
MidiIO midiIO;
public void setup(){
size(128*5,128*5);
smooth();
background(0);
// get an instance of midiIO
midiIO = MidiIO.getInstance(this);
// print a list of all devices
midiIO.printDevices();
// plug all methods to handle midievents
// note last 2 arguments are 0, 0 even though midi mon says ch1!
midiIO.plug(this,"noteOn",0,0);
midiIO.plug(this,"noteOff",0,0);
midiIO.plug(this,"controllerIn",0,0);
midiIO.plug(this,"programChange",0,0);
}
public void draw(){
}
public void noteOn(Note note){
int vel = note.getVelocity();
int pit = note.getPitch();
fill(255,vel*2,pit*2,vel*2);
stroke(255,vel);
ellipse(vel*5,pit*5,30,30);
}
public void noteOff(Note note){
int pit = note.getPitch();
fill(255,pit*2,pit*2,pit*2);
stroke(255,pit);
ellipse(pit*5,pit*5,30,30);
}
public void controllerIn(Controller controller){
int num = controller.getNumber();
int val = controller.getValue();
fill(255,num*2,val*2,num*2);
stroke(255,num);
ellipse(num*5,val*5,30,30);
}
public void programChange(ProgramChange programChange){
int num = programChange.getNumber();
fill(255,num*2,num*2,num*2);
stroke(255,num);
ellipse(num*5,num*5,30,30);
}
static public void main(String args[]) {
PApplet.main(new String[] { "promidi_plug" });
}
}
s.