I recently realized how often I am plugging and unplugging my midi cables. What I needed was a midi A/B box which allowed me to select input A, B or none at all to feed my Korg DSS-1 keyboard. After a quick search online I ran across some solutions, but not anything in my budget ($0).
Enter my box of switches and such. I found a cheap plastic project box from Radio Shack that I had, a DPDT (double pole, double throw) switch, a female 5 pin din (midi plug) and an old midi cable that I could re-purpose. All in all it cost me less than $10 in parts, which I already had.
First I split my midi cable and determined which wires fed the three main pins (pins 2, 4 and 5) of the midi cable. The outermost pins are not used and the center pin is the shield pin (ground). I took the 2 wires which corresponded to the remaining pins (pins 4 & 5) and attached them to the DPDT switch. Then I connected the DPDT switch to the female 5 pin din plug. Pin 2 from both cables attaches to pin 2 of the female midi jack. Drill some holes and whammo! Now I can select A, B or no input. This box will also work in reverse. I chose to use the cable in place of more female midi jacks because otherwise I would have needed to buy more midi cables. You can easily substitute jacks for cables or visa versa.
It is easier to explain with pictures, so excuse my drawing, but if you have questions contact me.