Sunday, 30 November 2014

Midi for the Arduino - Circuit Analysis

The Devil's in the Details


One thing I have discovered during my time on this blog is that you folks love connecting things to other things with Midi.

My original Midi for the Arduino article was written a few years back when I was a mere blogging neophyte so I figured it was time for a refresh.

I've seen a lot of articles on how to build a Midi circuit, but haven't found many on how it works. So let's examine Midi circuitry in excruciating detail.

In the video below we'll get to know the 6n138 Optocoupler, examine a Midi Byte, and try to figure out what that weird resistor on Pin 7 actually does!


Check out the next installment in the MIDI for the Arduino series where we build a MIDI Input Circuit

6 comments:

  1. This is awesome! Im a beginner. I am working on the Auduino Synth project for starters. I saw this and was inspired to research home midi controllers. Can you do a video showing how to connect this when making something like a home made arduino midi controller? Hope that is not to broad of a request....

    Very cool!

    Ben

    ReplyDelete
    Replies
    1. Thanks Ben! I am planning to follow this article with some hardware examples. Stay tuned. I just wish there were more hours in an average day...

      Delete
  2. This was awesome. The excruciating detail makes it seem much easier! I'm thinking about building a small device that will store and play MIDI loops. I've been trying to decide on Arduino vs. Pi, etc.

    I watched several of your other videos as well. I had never considered using the Arduino to program another circuit. With my little MIDI device I would want to be able to add additional loops, so I wonder if it would be easier to just use the Arduino... or I could create a port to reprogram the circuit. Do you think I'd need a crystal oscillator in such a device to give the circuit a reliable clock? This basic article doesn't mention it. http://arduino.cc/en/tutorial/midi

    Thanks again for the inspiration.
    Jesse

    ReplyDelete
    Replies
    1. Hi Jesse. I'm glad you got something out of the video. It's great to get feedback.

      The limited memory size of the Arduino makes it challenging to do serious sampled audio with it. You may want to check out the Adafruit Waveshield to see an example of using a Flash Card to store samples externally.
      You can add an ISP header to the circuit I describe in the Arduino on a breadboard article. Then you can upload programs with an AVR programmer. A crystal is needed for timing on the stand alone circuit. The Arduino board has a crystal built-in, that's why it is not mentioned in the Arduino.cc article.

      The Raspberry Pi has a bit more going for it in this regard since it already has storage and file handling built in.

      Good luck with your project and let me know how it works out.

      Delete
  3. Thanks! awesome tutorials! that´s how to do it!

    ReplyDelete
    Replies
    1. Actually... no, it's not how to do it! It's very close, but compared to the actual MIDI standard, it's missing one 220 ohm resistor on the TX pin on output side. That gives you the correct 660 ohms in series when driven from 5V, and not 440 ohms.

      Delete