Determine your MIDI master device. This can be a keyboard with workstation features, but computers have largely adopted this role. Add a MIDI interface to a basic computer, if necessary. Connect 5-pin DIN-style MIDI connectors between your computer and MIDI devices.
Connect the "MIDI Out" jack of your computer or master keyboard to the "MIDI In" jack of the first device in the loop. In some setups, this may be the only connection needed. For example, if you are controlling a drum box from a computer, data is sent to the MIDI input of the drum box and the resulting drum performance audio may be recorded.
Connect the "MIDI Out" jack of a keyboard device to the computer or master keyboard. This allows data to flow in both directions. A keyboard connected to a computer in this manner can be used to enter data in a program with MIDI sequencing. When recorded and edited, the computer can send MIDI data back to the keyboard to use it as a sound module for the performance.
Extend your MIDI loop by either daisy-chaining from the "MIDI Out" jack of the first slave device into the second, or branching out from the slave using its "MIDI Thru" jack, if available. The "MIDI Out" port sends the MIDI data stream after it has been processed by the slave device. This may introduce noticeable time delays in devices later in the chain. The "MIDI Thru" port presents an exact duplicate of the data arriving at the "MIDI In" jack, avoiding downstream delays.