Friday, August 04, 2017

MIDI wiring diagrams


This articles is part of my ongoing series on Desktop Electronic Music (DEM). The landing page provides easy access.

This article will explain how MIDI cables are wired, starting with conventional DIN-5 sockets, then looking at TRS connectors. This will help anyone who needs to trouble-shoot wiring or solder their own cables.

DIN-5 connectors are paired as male and female ends. But there are two tricks.

First, the pin-out diagrams are sometimes presented from the point-of-view of wiring the plug. But, commonly, when using the MIDI cables, we might prefer the point-of-view of how the plug looks externally. One is a mirror image of another. (This might be obvious to all but me, since I swear I am topologically impaired.)

Second, the MIDI in and MIDI out sides of the cable are wired opposite each other, so that when they are paired, the current flows correctly. Electrically, that makes sense. But pragmatically this might be counter-intuitive. After all, when we examine a MIDI cable, it isn't labelled as to which end is which (in or out).

Diagrams will help. Note that you can click on these to get large PNG files, which you are free to use.

Pin-out diagrams for MIDI DIN-5
Here is a male plug, seen from both plug and wiring views. Note the symmetry about a vertical bisection. (Now I sound like my high-school math teacher.)





And here is a female plug, seen from both views. Once again, these are reflections of each other. And furthermore are symmetrical with the male plugs.





Now that we know how to number the pins, we must understand how they are used to conduct signals.

MIDI electrical connections
Though MIDI for some reason standardised on DIN 5-pin sockets, pins 1 and 3 are never needed. Pin 2 is used for the shield, in order to ground the cable. That leaves the other two pins to carry an isolated current loop.

For a MIDI out connection:
pin 4 = -ve or sink
pin 5 = +ve or source

For a MIDI in connection:
pin 4 = +ve or source
pin 5 = -ve or sink

The pins are exchanged because the pins on a male plug are flipped relative to the sockets on a female connection. So, when all is said and done, a positive signal will travel continuously through the positive wire.

This is why all devices (instruments, controllers) have female sockets. And all cables (except those explicitly designed as extension cables) have male plugs. This ensures the correct electrical contacts without having to label ends.

If only it were this simple!


Behold, the minijack
With the rise of DEM (Desktop Electronic Music), manufacturers have shunned DIN-5 sockets. They are too large for tiny devices from Korg, Novation, Arturia, and IK Multimedia. Instead, the 3.5mm stereo minijack, commonly used for stereo headphones, has been repurposed. These plugs have a TRS connector, which means Tip, Ring, and Sleeve. These three current paths are exactly what's required for MIDI. So, a good match then.

But of course we have a problem. Because in Audio Land the signals do not need to switch pins, but in MIDI Land they do. So although two 3.5mm stereo cables might look alike, they could have different internal wiring. This is a nightmare.

The way to solve this is to adopt a standard, say a particular colour-coding for cables designed for MIDI. Maybe they should all be purple. But such is not the case.

The problem compounds when we need to connect devices that use both types of cables. Now we must convert between minijack and DIN-5, each carrying the same MIDI signal. And, naturally, this solution depends on whether the MIDI signal is incoming or outgoing.

When you purchase an Arturia Beatstep Pro, you get two white adapters as pictured below. (A black male MIDI connector is included for comparison.)



Both of the white adapters have a female MIDI DIN plug, so it can be coupled with a standard MIDI DIN cable. The other ends are colour-coded because they are meant for entirely different purposes.

The grey cable is designed for MIDI output. DIN pin 4 connects to the Tip and pin 5 connects to the Ring. (I have confirmed this with a multimeter.)

This is the standard adopted by Novation, Arturia, and IK Multimedia. Do not be surprised when I tell you that Korg has done the opposite! So if you were going out of a 3.5mm MIDI socket on a Korg device, you would need a different adapter to MIDI DIN-5. It would look the same, but have different internal connections.

So what the heck is the Arturia adapter with the black 3.5mm termination? Near as I can tell it's for sync output. Tip and Sleeve are wired to pins 1 and 3. This means they don't conflict with MIDI in any way. This is a smart solution. Or would be, if you think that repurposing the same cable adapter a third time is a good idea.

The mind boggles.


Conclusion

All of this is essential information if you have to mix-and-match systems. And also if you make your own adapter cables. Which you will have to do, since none are readily available to purchase. The one set I found on eBay did not indicate the wiring. Which obviously makes it useless. Arturia's own replacement set costs €53 shipped to Europe!

So, yes, the soldering iron is warming as I write.

I wrote this article as I found contradictory and incomplete information elsewhere. Please correct any errors in the comments.


Acknowledgements
This research is part of a larger project funded by an Arts Council bursary.

RELATED POSTS

No comments:

Post a Comment