The perils of cheap MIDI adapters

MIDI

[Arvydas] recently bought a Rock Band 3 Wii keyboard thinking it would be an excellent and very inexpensive (£9.99) MIDI controller. The keyboard has a proper DIN-5 MIDI out port, so theoretically the only thing needed to plug this into a computer is a USB to MIDI adapter. Unlike the keyboard, the MIDI adapter was a cheap piece of Chinese cruft, but given some ingenuity and a handful of components, he was able to get everything working.

The 30-year-old MIDI specification includes a few schematics on how to properly connect MIDI devices together. The most important part of these schematics is an optoisolater on the MIDI in, a valuable addition considering early MIDI keyboards cost thousands of dollars. It seems [Arvydas]‘ MIDI to USB adapter didn’t include this vital component, instead replacing it with a simple resistor. Anything to keep costs down, right?

To get the MIDI adapter working, [Arvydas] headed over to Maplin and bought an optioisolator, With everything wired up on a breadboard, he got it to work and eventually transplanted the circuit to the adapter’s PCB.

It’s a great piece of work to get this MIDI adapter functioning, especially since it’s doubtful the cheap adapter would have worked with any MIDI device.

Comments

  1. java says:

    Hi, I have the same cheapo, this things usually worked “fine” for me if you are using it just as midi to usb “keyboards” only, Sysex protocol seems to overflow the buffer of this thing. I have a Boss GT-5 pedal board, and I cannot dump Sysex messages due this. I will try this at home but I have my doubts if it would work…

  2. tz2026 says:

    I did a MIDI adapter for the Palm Pilot – tx and rx – with sequencer program many years ago (can you tell?). Midi is just opto-isolated TTL 31250 baud UART stuff.

    I could go into my archives and find it, but why? I don’t know if I still have Dave Small’s Atari ST Mac disk reader adapter (I forget the name, red rabbit pixelated), which went with the “Magic Sac” but I had to “borrow” its optoisolator for a project.

  3. echodelta says:

    If they don’t know what a G clef looks like chances are…

  4. qwerty says:

    “especially since it’s doubtful the cheap adapter would have worked with any MIDI device.”

    I have 3 of them and they worked fine until I replaced them with a Prodipe 4×4 interface because I needed more spare USB ports and wanted less cables around. The specification says midi in should be insulated so that the input is protected. Therefore if something goes wrong you won’t kill a multi thousand dollars keyboard but a five bucks crap midi interface.
    But… if the midi out was designed by a neanderthal and outputs too much current, you could fry the input optocoupler at other end ($$$ expander?). Therefore using quality interfaces makes sense anyway.

  5. AussieTech says:

    Had Brian bothered to actually read the information he links to he would have discovered that the opto-isolator has nothing whatsoever to do with the protection of “MIDI keyboards (which) cost thousands of dollars”.

    quote/

    http://www.midi.org/techspecs/electrispec.php

    Ground loops will cause horrendous hum, buzzes, and other noises, especially when connected to computerized gear or lighting equipment.

    In fact, a major design goal of MIDI, as seen in the electrical specification explanation in the MIDI Specification Document, is to prevent any ground loops that might occur with the MIDI cables. This is done by using a balanced current loop through an opto-isolator and only grounding the MIDI outputs.
    /quote

    (and strictly that isn’t fully correct either because the current loop isn’t “balanced”, it’s mono-polar.)

    qwerty> The specification says midi in should be insulated so that the input is protected.

    It says no such thing.

    The opto is there entirely for the functional reason of PREVENTING GROUND LOOPS, and not to “protect the equipment”.

    • Hippy says:

      I’ve got two of these cheapo usb midi adapters, they look identical though inside they are both very different. One causes ground loops and the other does not. But most notably neither will handle input of frequent, high volumes of SysEx messages. I spent quite a while fighting with the winapi to make it work, only to latter realise it was the device. Normal short 2 or 3 byte midi messages were no problem, but one device couldn’t even send a MTC full frame (a short SysEx message) though sent MTC quarter frames with ease! Probably the result of tiny buffers in the device. That was a blob chip, the better of the two devices had a 16 pin surface mount ic, with a Chinese data sheet.

  6. Sickboy says:

    Maplin sells actual components still :O
    I thought they’d given that up years ago and solely moved into the USB power toys and other cheap gimmicks. Such a shame compared to what the shops used to be like 7-10 years ago when the staff actually had experience in electronics.

  7. I’m with AussieTech – I’ve been using these Rock Band keyboards for some time without opto-isolators (to send notes to an Arduino softsynth) and they work fine in this sort of setup…

    http://www.fakebitpolytechnic.com/cheapsynth-external-module/

    (and the end of that official MIDI spec kind of admits that those old-style PC joystick/MIDI cables didn’t have opto-isolators either)

    My hunch is: it’s usually possible to read MIDI voltages between pin 5 and pin 2 (which is what the cheap USB interface was originally trying to do), but the Rock Band keyboard uses the presence of a circuit between pin 5 and pin 4 (which can be achieved using a small resistor) to detect whether it’s being used for MIDI or as a game controller.

    Although… Arvydas does say “The Rock Band keyboard detected a MIDI cable and switched to MIDI mode,” which in my experience it doesn’t do when only connected via pin 2 and 5, so that’s not entirely consistent with this explanation : )

  8. pockpock says:

    Does ist send information how strong the key was pressed? (probabbly not but asking anyway…)

  9. Dave says:

    In my experience, most of these cheap USB/MIDI interfaces do not support sysex messages larger than 17 bytes. This is the size of the MIDI inquiry response. They just seem to ignore larger messages.

  10. java says:

    so…the problem related with sysex is more a Buffer thing than a optoisolator issue…someone knows of a project (arduino, etc) to make a midi2usb with sysex support? my old SoundBlaster AWE32 had a joystick/midi port that worked great with it, but newer PC’s/laptops doesn’t have that at all…and using an old pc just to upload or download my Boss Gt-5 patches looks not like a great solution. Any idea? regards!

    • Hippy says:

      I’ve done extensive testing on the two cheapo devices I have… On the ‘better’ of the two, receiving SysEx seems to be much more of a problem than sending. I gave up, no matter how many calls to stop/reset/addbuffer, the device stopped receiving SysEx after (presumably) it’s buffer overflowed… A decent 2nd hand usb-midi devices on ebay can be had for 50 bucks. There is another cheap usb interface in abundance on ebay is a Chinese 4 port ‘midibox’ which has merging functionality, but I’ve never tried it.

  11. Hans says:

    I don’t get the reasoning in the article at all. Even IF a optocoupler would protect expensive items, there is no point in fiddling with that modification if all you want to connect is such a ass-cheap keyboard. As the article itself points out, he is not “protecting” thousands of euro, but a 9.99 keyboard.

  12. Hans says:

    Oh, and why is it doubtful that it would have worked with any MIDI device? Would be kind of missing the point selling a MIDI interface which does not work, wouldn’t it?

    • Addidis says:

      One of my first projects was a Q&D hack into midi with a 50 cent mcu. So optoisolators are the right way to do it. That said it is a 9$ device. My first proto’s worked fine. None had isolators. Take it a step further and make your own midi converter & device and there really is no reason for it.
      What Im getting at is if you are protecting a trinitron you won’t be using one of these. I really think these cheap 2-3$ adapters were intended to be hacked onto arduino projects. Which they work exceedingly well for. Alternatives are generally expensive. When your goal is to break it in half and make something these are not terrible.

      • Addidis says:

        Expanding on what these do well.
        You could reprogram your arduino usb and make it enumerate as a midi device. You may not feel comfortable doing this and an arduino is like 30$. Proper usb – midi adapters are about 50. You also might need a programmer or another duino to convert your arduino. (30 + the programmer and you just paid allot to diy) You have now tied up a 30 $ device to replace what this can do , hassle free , for 3$.
        Since serial ports and in spec midi is getting harder to find now you use usb. If you want to connect to old proper midi equipment you should do it right. If you are using a duino to make a midi controller these are perfect.

  13. Thomas says:

    Does this have an actual chip or is it just a circuit that kights up an led???

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 97,808 other followers