name
PApplet
import promidi.*;

MidiIO midiIO;

void setup(){
  size(128*5,128*5);
  smooth();
  background(0);
  
  midiIO = MidiIO.getInstance(this);
  println("printPorts of midiIO");
  midiIO.printDevices();
  midiIO.openInput(0,0);
}

void draw(){

}

void noteOn(
  Note note,
  int deviceNumber,
  int midiChannel
){
  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);
}

void noteOff(
  Note note,
  int deviceNumber,
  int midiChannel
){
  int pit = note.getPitch();
  
  fill(255,pit*2,pit*2,pit*2);
  stroke(255,pit);
  ellipse(pit*5,pit*5,30,30);
}

void controllerIn(
  Controller controller,
  int deviceNumber,
  int midiChannel
){
  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);
}

void programChange(
  ProgramChange programChange,
  int deviceNumber,
  int midiChannel
){
  int num = programChange.getNumber();
  
  fill(255,num*2,num*2,num*2);
  stroke(255,num);
  ellipse(num*5,num*5,30,30);
}
description
PApplet is your processing application. You can implement different methods to react on incoming midi messages. proMIDI is calling these methods on incoming midi data.
You also use the plug function to forward midiInformation of your choice to the desired object and method.
constructors
PApplet();
methods
The controllerIn() function is called everytime a control change command comes through one of your opened midi inputs.
The noteOff() function is called everytime a note off command comes through one of your opened midi inputs.
The noteOn() function is called everytime a note on command comes through one of your opened midi inputs.
The programChange() function is called everytime a program change command comes through one of your opened midi inputs.
usage
Web & Application
related