Name MidiOut
Examples
import processing.opengl.*;
import promidi.*;

MidiIO midiIO;
MidiOut midiOut;
Bowl[] bowl;

void setup(){
  size(128*5,128*5);
  background(0);

  midiIO = MidiIO.getInstance(this);
  println("printPorts of midiIO");
  midiIO.printPorts();
  midiOut = midiIO.openOutput(2);

  bowl = new Bowl[8];
  for(int i = 0;i < bowl.length;i++){
    bowl[i] = new Bowl(i);
  }
  noStroke();
}

void draw(){
  background(0);
  for(int i = 0;i < bowl.length;i++){
    bowl[i].move();
    bowl[i].paint();
  }

}

class Bowl{
  float xSpeed;
  float ySpeed;
  float xPos;
  float yPos;
  Note note;
  color col;
  int myNumber;

  Bowl(int number){
    xSpeed = random(2,20);
    ySpeed = random(2,20);
    note = new Note(0,0,0);
    col = color(
      random(0,255),
      random(0,255),
      random(0,255),
      100
    );
    myNumber = number;
  }

  void move(){
    xPos += xSpeed;
    yPos += ySpeed;
    midiOut.sendController(
      new Controller(0,myNumber,int(xPos/6)+2)
    );
    
    if(xPos > width || xPos < 0){
      xSpeed = -xSpeed;
      xPos += xSpeed;

      playNote();
    }
    if(yPos > width || yPos < 0){
      ySpeed = -ySpeed;
      yPos += ySpeed;
      playNote();
      midiOut.sendProgramChange(
        new ProgramChange(0,myNumber)
      );
    }
  }

  void playNote(){
    midiOut.sendNoteOff(note);
    note = new Note(0,int(xPos/5),int(yPos/10)+60);
    midiOut.sendNoteOn(note);
  }

  void paint(){
    fill(col);
    ellipse(xPos,yPos,20,20);
  }
}
Description This class has no accessable contructor use MidiIO.openOutput() to get a MidiOut. MidiOut is the direct connection to one of your midi out ports. You can use different methods to send notes, control and program changes through one midi out port.
Constructors
Methods
sendController ( )   Use this method to send a control change to the midioutput.

sendNoteOff ( )   Use this method to send a note off command to your midi output.

sendNoteOn ( )   With this method you can send a note on to your midi output.

sendProgramChange ( )   With this method you can send program changes to your midi output.

Usage Web & Application
Related MidiIO
Note
Controller
ProgramChange