Home -> Magazines -> Issues -> Articles in this issue -> View
Practically MIDI (Part 1) | |
Article from Sound On Sound, September 1987 |
One for the DIY fans. In this new series, Martin Russ penetrates deep into the heart of MIDI equipment and explores how they work, what chips they use and more...
Martin Russ begins a new series on the practical aspects of the Musical Instrument Digital Interface with a look at the technical aspects of MIDI.
Once upon a time (OK - the late 70s), synthesizers were young and expensive, and were controlled by control voltages patched together by jack-to-jack cables. If you could find two polyphonic synthesizers (they were even newer and a lot more expensive) and wanted to connect them together then, assuming it was possible at all, you needed lots of wires carrying both pitch information (control voltages, where 1 volt change = 1 octave change) and gating information (where notes started and stopped). Dave Smith's 1977 designed, 5-note polyphonic, Prophet 5 synthesizer used a mere 10 jack sockets for the CV and gates, for example. Touch sensitivity threatened to add even more sockets. Even worse, most manufacturers seemed determined to make their equipment incompatible with everyone else's and you usually needed interface boxes to connect things together. Intel, by the way, had just designed the first microprocessor chip for a cash register, almost certainly without realising what they were starting. All this sounds very strange and alien, eh? - but the sort of interfacing problems you suffered by using analogue polysynths with far too many interconnections were to last until 1983...
Things began to change when two Sequential wizards designed a digital interface for their Prophet 10 synthesizer. Although it was clumsy for general purpose use, its subsequent redesign led to the Universal Synthesizer Interface (USD, which appeared at the Autumn '81 Audio Engineering Society Convention. The USI replaced all those analogue CV and gate connections with a serial digital system, transmitting bytes of information representing note pitches and on/off (gate) information as digital data - remember, by now (the early '80s) the microprocessor was taking over everything.
From this beginning, a second meeting collected together interested parties from the US and Japan, resulting in a modified proposal by the Japanese which was integrated into a draft combined specification by Smith and Wood of Sequential. No further response came from the US but Sequential persevered, continuing discussions with Roland, Yamaha, Korg and Kawai. The resulting Musical Instrument Digital Interface (MIDI) discussion document was then fine tuned by Sequential and Roland, resulting in the first MIDI Specification issued by Sequential (then known as Sequential Circuits Inc, by the way) entitled 'The Complete SCI MIDI' - I got my draft copy early in 1983. For the Trivial Pursuiters amongst you, Bob Moog first announced MIDI in his column in America's Keyboard magazine in October 1982. MIDI had arrived! On the subject of Moog, it is interesting to note that the coming of the MIDI/Digital era marked the beginning of the decline of the Moog company, which produced the first commercial synthesizers in the '60s.
This series will not explain what MIDI is in software and computing terms, because there are already lots of articles covering this subject in great detail. The definitive work is, of course, Jay Chapman's 'Talking MIDI' series published in this very magazine from December 1985 to August 1986. Suffice it to say that MIDI appears on an instrument as two or three 5-pin 180 degree DIN sockets (or, exceptionally, as 5-pin XLR connectors) and employs two distinct types of byte. Status bytes have the most significant bit set to 1, whilst data bytes have the most significant bit set to 0. The format of status and data bytes is defined at a common minimal level so that note pitch and note on/off information can always be transferred between instruments.
For more advanced applications, MIDI provides 16 separate channels for transmitting and receiving data, configurable in several different operating modes, as well as some real-time controls.
Manufacturer-specific information is contained within a special system exclusive category and is used for things like voice dumps and remote editing.
This concludes the software overview. The rest of this series will discuss some of the practicalities of MIDI, and should be of particular interest to experimenters, customisers, engineers and MIDI buffs in general.
And so to the main event. Let's compare MIDI with some conventional interfaces.
MIDI is an asynchronous serial protocol running at 31.25Kbaud, using a 5mA current loop. For comparison, most computer to printer/modem connections utilise an RS232 interface, which uses TTL level signals at anything from 75 baud up to 9.6 Kbaud, and current loops in the realm of telex and telegraph systems. MIDI is serial, as is RS232, although the Centronics interface to printers uses a parallel format. In general, serial interfaces on computers are used for convenient connections between equipment where only relatively low data transfer rates are needed. Serial interfaces tend to be slow because of the time taken to squash parallel data bytes/words into a serial stream. For high rates parallel interfaces are used, although the cabling is more unwieldy and expensive. MIDI is unusual in respect of the high speed with which it pushes data down cables and this means that care is needed in designing the driver and receiver stages, as we shall see. The high speed was chosen because of the need to avoid the delays becoming objectionable. The serial format was chosen to simplify the cabling and connectors.
To avoid audio ground loops the input interface in MIDI is opto-coupled, a refinement which has removed many of the hum problems which used to bedevil pre-MIDI synthesizer set-ups. To the best of my knowledge, opto-coupling is not used in any computer interfaces except those used in medical applications (where you don't want to dump large currents through patients!). So MIDI is fast and uses a current loop rather than voltages - the speed serves to restrict the maximum length of MIDI cables to about 15 metres or less.
The current loop works in the opposite way to what you might expect: a 0 is indicated by current flowing, whilst a 1 is indicated by no current. Also, the current loop means that interfacing is on a strictly one-to-one basis - no DIN Y connectors allowed! Unlike RS232, MIDI is unidirectional in socket terms - there are separate input and output sockets. One MIDI In is the norm: this has the opto-coupler and no connection to the ground on the piece of equipment. One or more MIDI Outs send note and other information to other peripherals, and MIDI Thrus echo the information arriving at the In, thus enabling daisy-chaining of equipment.
Interestingly, the Thru does not produce any output originating within the piece of equipment on which it is fixed, so you do not get any note information from a synthesizer Thru. Since star connections are usually preferred when interconnecting devices, it is possible to buy so-called Thru boxes which take the MIDI data from an Out and produce several Outs in parallel. The reason these Outs are called Thrus is because relative to the In socket on the Thru box they are Thrus, whereas if you consider the actual overall effect of the equipment's MIDI Out and Thru box, it is the equivalent of a piece of equipment with multiple Outs.
The MIDI 1.0 Specification recommends the use of open collector 'LS TTL gates as MIDI Outs (and Thrus). Contrary to what you might expect, most 'LS open collector gates have conventional transistors as their output sinks, rather than Schottky transistors - so there are none of the speed or low saturation voltage characteristics you might expect. For a transmitted zero or low state, the output stage is biased into saturation, sinking current to ground through the output transistor. The current is sourced by the same power rail as the 'LS gate, passing through the cable to the MIDI In opto-isolator LED at the far end, back through the cable and so to the output transistor. Using the voltage rail in the transmitting equipment means that you need two wires and the shield/earth to transmit the signals, but has the advantage that you keep your loading symmetrical when driving the current.
Careful! Remember that with no earth connection between the two pieces of equipment, a double-insulated synthesizer with no ground connection will 'float', and could be at a few hundred volts relative to ground. Unless you have the audio leads connected between your two pieces of MIDI equipment and one is grounded, you can find some very strange things happening if you try to source current from a different power supply rail which is floating at a few hundred volts. Luckily, most equipment tends to float at only a few volts, but be careful when connecting an isolated synth used for headphone practice to something else - if you connect into the synth, the audio cable 'ground' is actually floating! Returning to the current loop, you can now see that the signals through the cable are the same, only travelling in opposite directions. The diode across the LED in the opto-isolator serves two purposes: it not only protects you from accidentally reverse-biasing the LED, but is also useful for terminating reflections from the cable and thus helps the system to work at high speed. The arrangement of current loop and protection diode means that incorrectly wired cables won't work and shouldn't damage anything.
The MIDI In connection is the part of the MIDI loop where a lot of the problems arise. The one fixed point of reference is that the MIDI ground/shield wire from the cable is not connected to Pin 2 of the DIN plug, as mentioned before, in order to avoid hum loops. Everything else can be variable.
The opto-isolator is the major source of problems. Fast opto-isolators cost more than sluggish ones and, often, marginal devices are used to save money in some designs. Some LEDs are more thirsty for current than others and this can cause problems. Some MIDI current loops can be running on about 3mA and some on about 12mA! - some designs leave out the series resistors, some double or halve their value. Theoretically, there should be three 220 ohm resistors, plus the diode, connected between the 5 volt rail and the MIDI Out current sink transistor.
As if components being missed out wasn't enough, the characteristics of the components can cause trouble too! Turning the LED on is generally faster than turning it off, and it is here that the active pull-up mentioned earlier pays dividends. LEDs in opto-couplers can also vary in their light output and, although opto-couplers guarantee a minimum current transfer ratio for a given input, in our case we can't be sure what the loop current will be!
1. Read and follow the MIDI Specification. (Distributed by the International MIDI Association, (Contact Details).)
2. Use 220 ohm resistors and the correct number in the right places.
3. Make sure you end up with a 5mA loop current (ie. measure it! - don't trust your calculations).
4. Use fast enough opto-isolators with Darlington outputs (design for about 3mA minimum current).
5. Buffer your MIDI Thrus directly from the In socket (minimise Thru delay).
6. Use the correct socket configurations (Atari ST computers combine the Thru and the Out into a single 5-pin DIN - don't do this!).
There is lots more to MIDI than this. The next article in this series will discuss how to add extra MIDI In, Outs and Thrus to your equipment. In the meantime, further more detailed technical information on MIDI can be found in Alan Robinson's excellent article in the January 1987 issue of Electronics Today International (ETI) magazine.
Read the next part in this series:
Practically MIDI (Part 2)
(SOS Oct 87)
All parts in this series:
Part 1 (Viewing) | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7 | Part 8
Voltage Controlled Clock |
MIDI Product Guide |
Fairlight Goes MIDI |
Interface the Music |
The Strange Case of the Singular Digit |
The Ultimate Blinky Light - LED Wall Art - Visual Environment Machine |
Dumping Grounds (Part 1) |
The String Damper |
Gnome Instrument Interface - Using the 2720-11 Envelope Follower |
Software Support - Hints, Tips & News From The World Of Music Software |
Hexadrum |
Browse by Topic:
Topic:
Series:
Part 1 (Viewing) | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7 | Part 8
Feature by Martin Russ
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!
New issues that have been donated or scanned for us this month.
All donations and support are gratefully appreciated - thank you.
Do you have any of these magazine issues?
If so, and you can donate, lend or scan them to help complete our archive, please get in touch via the Contribute page - thanks!