MIDI compatible devices usually include both MIDI in and MIDI out jacks. These terminate in 5-pin DIN connectors. The MIDI out jack transmits MIDI data to another MIDI device. As you play a MIDI controller such as a keyboard, data corresponding to what you play comes out the MIDI out jack. For example, if you play middle C, the MIDI out jack transmits a piece of data that says middle C is down. If you let go of the middle C key, the MIDI out transmits a message that says middle C has been released. If the keyboard responds to dynamics, the note data will include dynamics information as well. Moving the modulation wheels and pedals attached to many synthesizers will also generate data that is unique to the wheel or pedal being used.
The MIDI in jack receives MIDI data from another device. In addition
to the type of performance data described above, rhythmically oriented
MIDI devices (e.g., drum machines) can often transmit and/or receive additional
MIDI timing messages that keep other rhythmically-oriented units in a
system synchronized with each other.
An optional MIDI thru jack provides a duplicate of the signal at the MIDI in jack. This is handy if you want to send data to more than one device.
For example, suppose a MIDI keyboard's MIDI out feeds the MIDI in of a second tone module (called MIDI device 1). Patching Device 1's MIDI thru to Device 2's MIDI in sends the keyboard signal through to MIDI device 2. Thus, playing on the master keyboard can trigger both MIDI device 1 and MIDI device 2.