This project was just a fun little thing to try to combine my interests in music with my interests in electronics. The project uses a 40×2 character LCD, some pushbuttons, and a MIDI connector to create a four track step sequencer to generate drum beats on a MIDI instrument. The sequences are a fixed 32 steps, and consist of tracks for bass, snare, hi-hat, and crash notes on MIDI channel 10. The tempo is also selectable.
In honesty, there’s not much going on in this project. The unit does not actually generate any of the sounds itself. Instead, it simply sends the correct signals to a MIDI instrument for the instrument to create the appropriate drum sounds at the right time. A Microchip PIC18F4450 coordinates the MIDI activity, the timing for the notes, the display driving for the HD44780-compatible LCD display, and the user input from the pushbuttons. A timer peripheral on the microcontroller keeps everything running in sync.
The MIDI protocol is actually extremely easy to work with from a microcontroller because it can be driven directly from the 5V microcontroller UART pins (although technically MIDI inputs should be optically isolated, per the MIDI 1.0 Detailed Specification). The protocol utilizes a 31250 baud 8N1 asynchronous interface to communicate between MIDI devices. The various types of events, such as triggering a note or specifying a MIDI channel must be sent in realtime as they are supposed to occur. The MIDI specification outlines numerous types of “messages” that can be sent over the MIDI protocol to control everything. An extensive list of these messages may be found from the MIDI Manufacturer’s Association here: http://www.midi.org/techspecs/midimessages.php.
It is clear from the video that this device was not built with user experience in mind. The physical “design” itself is pretty disgusting, with wires going every which way and the LCD and MIDI connector just dangling off the sides. Although the device has plenty of potential that can be realized in software, this was just a rough build to learn a little bit about MIDI, and I did not make the effort to add such niceties (or necessities). For example, some easy improvements would be the ability to pause, reset, and play the sequence (at present it starts playing immediately upon applying power and loops until power is removed) and the ability to add or remove tracks, and select which note (drum sound) each track will represent. Again, these would be easy software improvements, but this was just a quick project to satisfy my curiosity about MIDI, and wasn’t really intended to be practical.