For the communication of two Midi programs on the same computer, Mac OS X provides the IAC Driver (Inter Application Communications Driver).
You can find the IAC Driver by typing Audio MIDI setup in Spotlight, or start Audio MIDI Setup from /Applications/Utilities. At the top select MIDI Devices. Perhaps you have go the menu and select Window/Show MIDI window.
You will now see an icon for the IAC Driver. If you have never used the IAC Driver before, the icon will appear grayed out. Double-click the IAC Driver icon to bring up its properties dialog. In the properties dialog, click the “Device is online” checkbox to make the driver active. In the Audio MIDI setup window, the icon will no longer appear grayed out.
The bottom part of the dialog (you may have to click the arrow next to “More information” to get to see this), you find an overview with driver ports. Each such port can act as a kind of virtual cable to make a Midi connection between two different applications. By default a port called “Bus 1” already exists. If this port is already in use by other applications on your computer, you can create an additional port by clicking the + button. The default name for a second port is “IAC bus 2”. If you want, you can change port names after double-clicking on the name.
These ports are very useful. But that is another story, which today will not yet be revealed.
Update: During a sleepless night I found a interesting experiment with Ableton and the IAC ports. Check out the video.