Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   FAQ   Tutorial


RtMidiOut Class Reference

#include <RtMidi.h>

Inheritance diagram for RtMidiOut:

RtMidi List of all members.

Detailed Description

A realtime MIDI output class.

This class provides a common, platform-independent API for MIDI output. It allows one to probe available MIDI output ports, to connect to one such port, and to send MIDI bytes immediately over the connection. Create multiple instances of this class to connect to more than one MIDI device at the same time.

by Gary P. Scavone, 2003-2004.


Public Member Functions

 RtMidiOut ()
 Default constructor.
 ~RtMidiOut ()
 The destructor closes any open MIDI connections.
void openPort (unsigned int portNumber=0)
 Open a MIDI output connection.
void closePort ()
 Close an open MIDI connection (if one exists).
void openVirtualPort (const std::string portName=std::string("RtMidi Output"))
 Create a virtual output port, with optional name, to allow software connections (OS X and ALSA only).
unsigned int getPortCount ()
 Return the number of available MIDI output ports.
std::string getPortName (unsigned int portNumber=0)
 Return a string identifier for the specified MIDI port type and number.
void sendMessage (std::vector< unsigned char > *message)
 Immediately send a single message out an open MIDI output port.


Constructor & Destructor Documentation

RtMidiOut::RtMidiOut  ) 
 

Default constructor.

An exception will be thrown if a MIDI system initialization error occurs.


Member Function Documentation

void RtMidiOut::openPort unsigned int  portNumber = 0  )  [virtual]
 

Open a MIDI output connection.

An optional port number greater than 0 can be specified. Otherwise, the default or first port found is opened. An exception is thrown if an error occurs while attempting to make the port connection.

Implements RtMidi.

void RtMidiOut::openVirtualPort const std::string  portName = std::string("RtMidi Output")  )  [virtual]
 

Create a virtual output port, with optional name, to allow software connections (OS X and ALSA only).

This function creates a virtual MIDI output port to which other software applications can connect. This type of functionality is currently only supported by the Macintosh OS-X and Linux ALSA APIs (the function does nothing with the other APIs). An exception is thrown if an error occurs while attempting to create the virtual port.

Implements RtMidi.

std::string RtMidiOut::getPortName unsigned int  portNumber = 0  )  [virtual]
 

Return a string identifier for the specified MIDI port type and number.

An exception is thrown if an invalid port specifier is provided.

Implements RtMidi.

void RtMidiOut::sendMessage std::vector< unsigned char > *  message  ) 
 

Immediately send a single message out an open MIDI output port.

An exception is thrown if an error occurs during output or an output connection was not previously established.


The documentation for this class was generated from the following file:
The Synthesis ToolKit in C++ (STK)
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved.