MidiOutPort class public functions

MidiOutPort
~MidiOutPort
close
closeAll
getName
getNumPorts
getPort
getPortStatus
getTrace
open
rawsend
setPort
setTrace
toggleTrace

MidiOutPort(void);
Sets the output port to 0 but does not open the port.
MidiOutPort(int aPort, int openAuto = 1);
Sets the port on which MIDI output will occur for this object. If openAutoQ == 1, then the specified port will automatically be opened. If openQ == 0, then the user must call the open function to open the port before actually using MIDI output (unless some other MidiOutPort object has already opened the port).

~MidiOutPort();
If there are no more instances of MidiOutPort left, then close all open MIDI ports.

void close(void);
Closes the MIDI port to which the MidiOutPort object belongs. Closing an unopened port will not cause an error, but will be ignored. All other objects connected to the same port will not be able so send any MIDI output once the port is closed.

void closeAll(void);
Closes all open MIDI output ports.

const char* getName(void);
Returns the name of the MIDI port device. Pointer is not guarenteed to be valid after the function is called again (by another object on another port).

int getNumPorts(void);
Returns the total number of MIDI output ports that are on the system.

int getPort(void);
Returns the MIDI output port to which the object directs output.

int getPortStatus(void);
Returns 1 if the port is currently open, otherwise returns 0.

int getTrace(void);
Returns true if the midi input is being printed to the terminal.

void open(void);
Opens the MIDI port to which the object belongs. If port is already opened, then ignore the open request.

int rawsend(int command, int p1, int p2);
int rawsend(int command, int p1);
int rawsend(int command);
Sends the three midi bytes. command is the MIDI command being send. p1 is the first parameter for that command. p2 is the second paramter for that command
int rawsend(uchar array, int size);
Sends the array of midi data (usually a sysex command) with the specified size in bytes. All bytes are sent exactly as found in the array. No additional bytes are added to the message.

void setPort(int aPort);
Changes the MIDI output port to which the MidiOutPort object belongs. Will not close the old port nor open the new port.

void setTrace(int aState);
Sets whether or not the MIDI data being sent out of the object will be printed on the computer screen as well. 0 = don't print; 1 = print.








Send comments/errors on this page to craig@ccrma.stanford.edu