[LAD] [semi-OT] midi snakes using CAT5?

David bouncingcats at gmail.com
Sun Nov 1 23:52:04 UTC 2009

On Mon, Nov 2, 2009 at 4:55 AM, Dan Mills <dmills at exponent.myzen.co.uk> wrote:
> On Sun, 2009-11-01 at 12:56 -0400, Raymond Martin wrote:
>> 15 meters is a recommendation based on typical cables used in a simple system.
>> Data corruption ensues somewhere after 15m, depending on cable quality, EMI,
>> and so forth. I would imagine a CAT5 as having better shielding and IIRC runs
>> for that are advised to somewhere up to 50m. Different frequency ranges though,
>> so signal loss/degradation per meter may vary.
> My recollection is that when MIDI was originally standardised, they
> needed to specify a maximum length, and that 15M was chosen somewhat
> arbitrarily (No tests were done, no eye patterns examined).
> Now midi is actually at heart a 5mA current loop interface running at a
> fairly low baud rate (31.25 Kbaud IIRC), so should be good for far more
> then 15m without any problem, however nobody really knows and it will
> depend a bit on the environment and the receiver.
> Interference is unlikely to be an issue assuming good quality twisted
> pair cable (Cat 5 counts), but bulk capacitance just might ultimately
> limit the length.

My I offer some more information to clarify the notions of cable
"quality" and signal "loss/degradation".

Aside from the EMI issue, what limits performance here is not so much
cable "quality" whatever that means but the unavoidable physical
characteristics of the cable as a transmission line once its length
causes a time delay that is significant relative to the rise/fall
times of the signals it is carrying.

The speed of electromagnetic propagation is fast, but it is not
infinite. It takes time for a signal to travel from one end of the
cable to the other. Plus, if the termination impedance is not matched
to the cable impedance, then reflections will occur at either end of
the cable causing unexpected signal variations. Good old physics
screws up the imaginary fantasy of perfect 1's and 0's.

A good reference on this is www.national.com/an/AN/AN-808.pdf
particularly Figure 7 which is instructive even if you read none of
the text but just look at the picture.

The MIDI 1.0 spec keeps the cable length short to avoid addressing
these issues. It makes no attempt to specify terminating impedances
matched to cable impedance, or deal with any other long cable issues.

Another thing about the that MIDI spec is where it says "optoisolators
... rise and fall times should be less than 2 microseconds" which is
amusing because the total time of one midi bit is 3.2 microseconds. So
don't imagine you have nice square bits driving the system even if
your cable is zero length. So your optoisolators *might* be a limiting
factor depending on their speed (ie age, cost).

The transmitting equipment's ability to adequately drive
current/voltage into the cable impedance *might* be another limiting

This is not intended to put you off. If you get yourself an
oscilloscope and do some eye pattern tests (Fig 13 and Fig 15), you
might discover your equipment and chosen cable works fine at the
lengths you need. But this is the only way to know for sure.

If you do decide to do this, you would need to keep in mind that your
cable is terminated by a nonlinear impedance (the led in the receiver
optocoupler) so that adds an extra complication because voltage is not
proportional to current at that point in the system. You might need to
scope the output (ie not the input) of the receiver optocoupler for

So that is why the MIDI spec says to keep the cables short. It avoids
all these complicated issues, allows simple cheap circuitry and any
cheap cable with unspecified characteristic impedance, and yet was
fast enough for the audible performance latency requirement.

By the way, the reason Cat5 cable gives better performance in *other*
situations is because it has a defined characteristic impedance (100
ohms), and being known it can be matched in the design of the
transmit/receive device impedances to minimise reflections. Cat5 cable
does *not* provide that benefit when used to interconnect MIDI
devices, because they are not designed for 100 ohm cable.

Other relevant references are:

And yes there is no need to run 5V down a MIDI cable. It is a current loop.


More information about the Linux-audio-dev mailing list