Real-Time MIDI Subsystem

The real-time MIDI subsystem (RTMIDI) provides support for handling real-time MIDI operations for applications.

To provide a robust system for real-time MIDI processing, RTMIDI uses an object-oriented paradigm. Nodes are entities that can send or receive MIDI messages, perhaps manipulating the messages before sending them back out again. Nodes that only manipulate messages are called filter nodes. Nodes that can generate messages are called source nodes.

There are node classes and node instances, where the term node implies node instance. In an object-oriented programming language, classes define what variables and operations are available and what they are called. When a class is instantiated, an object that has a physical existence is created. RTMIDI operates the same way.

When a node wants to be "known" by RTMIDI, it must first register a node class. This step is only necessary for user-defined classes, since the pre-defined classes are registered by default. Registration provides two pieces of information for RTMIDI: the name of the class and the addresses of all the requisite functions. For example, RTMIDI will need to know what function to call to send a message to the node.

Once a class is registered, it can be instantiated. And once instantiated, it can be connected to other instances. The collection of instances and links is known as the node network. Each instance of a class also has its own instance data. When an instance is created, RTMIDI allocates a block of memory. Whenever any of the functions for this class are called, the instance data pointer is passed. This allows a particular function to determine which instance is being called and also allows it to store instance-specific data.

Instances are sometimes called nodes, especially if they are qualified by their class. For example, a hardware node is an instance of the hardware class.


[Back: Installation LOG File]
[Next: Node Classes]