Hack/Study: MIDI device

2 years, 2 months ago

MIDI circuit board schematic

Musical Instrument Digital Interface, or MIDI, is an industry-standard electronic communications protocol that defines each musical note in an electronic musical instrument such as a synthesizer, precisely and concisely, allowing electronic musical instruments and computers to exchange data, or “talk”, with each other. MIDI does not transmit audio - it simply transmits digital information about a music performance. (from Wikipedia entry)

Many may know that I’m a keen musician with some sound engineering experience. This project is to combine music and geekery interests and see what comes out of the mix. Yesturday I completed my first MIDI device. It is just a test of concept really; the first step in hopefully some more advanced MIDI/sound manipulation.

My First MIDI device

I use a PIC16F84 chip at 4Mhz to directly talk to whatever MIDI device the circuit is connected to. The homebrewed MIDI transmit code was taken from Ross Bencina’s site on MIDI development with PIC and Basic Stamp which, if you are interested, is a great resource.

Here is some of the technical material to help you get started quickly on your own MIDI project:

Edit: If you are experimenting at all with MIDI output devices, you will probably benifit from a computer based MIDI monitoring program. This lets you examine the raw MIDI data being sent by your device, and helps greatly in troubleshooting. I am currently using the aptly titled MIDI Monitor found at OBD Software as it is free and does a fine job.

Edit: I’ve recently completed a remote automation project that lets you turn 110-240vac devices on and off via the a webpage or WAP on a mobile phone. It’s a very fun project! :) If you’d be interested in a write-up (schematics, code, etc) then leave a comment here, and I’ll get writing!

7 Responses to “Hack/Study: MIDI device”

  1. Axeslinger Says:

    Josh:

    Did the MIDI transmission work at 4MHz?

  2. Josh Says:

    4Mhz refers to the operating timing of the PIC. 4Mhz can be achieved with a resistor/capacitor oscillator.

  3. Axeslinger Says:

    Yes, I’m aware of the timing. The reason I’m interested is that the 16F628 (which I would use for something like this) has an internal 4MHz oscillator and I could save 2 pins by using this.

  4. Josh Says:

    As far as I’m aware the internal 4Mhz osc is about as accurate as the RC osc in my circuit. You’ll have to see how you go with this, as ideally the circuit should use a 4Mhz Crystal osc.

    I’ve not had any problems with the less accurate timing so far.

  5. Morris Fairbetter Says:

    I’d be interseted in a write up on the remote automation.

  6. Rob Says:

    I am very interested in your second edit. I am trying to build a cue light system for a theater.
    In this instance I would need to build a simple box at one location, that has switches for about 10 lights, and a master switch. These switches can then trigger the MIDI to be received up to about 300 feet away, where there will be another box plugged into the wall that has about 10 plugs on it so i can plug different lights into them.
    Ideally I can also have a signal light at the station so the person running the station can be sure that the receiving station will be actually getting the data. I would also like to experiment in having two separate receiving stations(@ 5 Ea.).

    I don’t know much about MIDI, but I can wire electrical, and DMX data fine.

    What are your thoughts on this?

  7. Administrator Says:

    Hi Rob.
    First, I don’t see why it’s necessary to use MIDI for your project. Unless you want to be able to trigger events using MIDI, you might as well just use something more fit-for-purpose.

    The 300′ distance would be a problems for simple RS232 connections, but there are a number of ways you could solve that.

    Also, how much are you looking to spend on this? This will help decide on possible implementations :)

Leave a Reply