When you find the MIDI electrical specification on the Internet, you will find only ugly scanned images thirty years old or so. But it does not harm us when we learn from experts. In one Korg service manual, I found a nice circuit diagram of the electrical circuit that they use in their synthesizers. It is highly likely that the same electrical circuit is used in all musical instruments that can be controlled via MIDI.
If you want to connect Arduino to a musical instrument and use a long MIDI cable, or you will have Arduino and a musical instrument connected on a place where electrical voltage might be induced in the wires, use this connection.