PatchEdit.MidiOut.writeShortMessage (port, (byte) (0xC0 + ((channel - 1) & 0xf)), (byte) patchNum);
ShortMessage msg = new ShortMessage(); msg.setMessage(ShortMessage.PROGRAM_CHANGE, channel - 1, patchNum, 0); PatchEdit.MidiOut.send(port, msg);
    protected void setPatchNum(int patchNum) {        try {	    PatchEdit.MidiOut.writeShortMessage		(port,		 (byte) (0xC0 + ((channel - 1) & 0xf)),	// Program Change		 (byte) patchNum); // Program Number	} catch (Exception e) {	}    }