You can build this adaptor into a case using sockets and a switch, or you can make it as flying leads with plugs on their ends.

Other options are also possible:

  1. Omit R3 and the switch if you are absolutely certain you will only ever tap into a MIDI line (as opposed to going from a MIDI out directly to your audio in).

  2. Make a flying lead with only one MIDI plug for direct recording (omit SW1 and connect R3 across pins 4 and 5).

MIDI adaptor schematic