sunlight

MIDI Chord Recorder

Introduction

The MIDI Chord Recorder was conceived as a device to accompany solo musicians or groups without a keyboard player. It can be used to provide a backing for live music without the restrictions of a conventional sequencer, which does not allow for timing variations within a piece of music.

MIDI (Musical Instrument Digital Interface) is a 31250 baud isolated current loop serial interface with a clearly defined set of commands for controlling electronic instruments. MIDI is a flexible and well-supported interface between electronic instruments that, instead of sending information about the sound of a note, sends the note itself (middle C, etc.). It can also be used to send messages for remote control of instruments (e.g. volume, play/pause/stop). This means, for example, that a keyboard with inferior sound-producing capabilities can use sounds and effects of a dedicated sound module.

A MIDI sequencer is a device for receiving, editing and transmitting MIDI messages. Conventional sequencers transmit with a predetermined timing, and are unable to adjust to the tempo (speed) of a ‘live’ performer. The MIDI Chord Recorder overcomes this problem by allowing the tempo to be varied dynamically by the musician.

The basic concept of the Recorder is simply a device into which chords (groups of notes sounding at once) are recorded from a MIDI instrument. Later, these chords may be played back in their original order. Once a chord is played, it sounds until an attached footswitch is pressed; the device then stops the current chord and changes to the next. This produces an effective sounding backing at the speed of the rest of the group.

There were several features of the device that were planned from the beginning:

  • Full editing facilities – inserting, deleting and playing back single chords and whole songs.
  • Standard MIDI In/Out interfaces to work with MIDI instruments and sequencers.
  • Multiple memory areas ("songs") with a display to indicate the current song.
  • Battery operation, backup, and a DC adapter input.

Block Diagram

MIDI Chord Recorder block diagram

Hardware Development

While designing the board, consideration was given to its user interface. The unit may be used on a darkened stage or in other poor lighting conditions, so a 7-segment LED display was used for the song display. The buttons would not be used during a stage set, as the unit would be pre-programmed. All normal operation would use the footswitch (a standard normally open switch).

The main controller was an Intel 80C31 microcontroller, with an external EPROM and 32Kb of RAM. The processor receives serial MIDI messages via an opto-isolator, and sends them though a buffer/inverter. There were no tools available to examine raw MIDI data from a MIDI link, so for development purposes an RS-232 serial interface was built in. As no facilities were available to produce PCBs, the prototype board was constructed from strip board using wire-wrap techniques.

The unit was designed to operate from four AA batteries. For prolonged operation, it was envisaged that an external power supply would be required, due to the high current drain of the LED display. The power-down feature of the processor was used to implement the battery backup, which freezes the oscillator and turns off the display, while preserving the internal RAM contents. This keeps the current consumption very low during 'standby' mode.

Once tested and debugged, the board then had to be fitted in its chosen box. The project was designed from the beginning with the dimensions of the box in mind, so the board was able to fit in relatively easily; however, some components still had to be moved to make way for mounted components.

Software Development

The software (written in C) was initially developed on a PC with PC development tools. The portability of C meant that much of the same code could be used for the final EPROM. The basic operation of the software could thus be tested using the more advanced debuggers and tools available on the PC.

The software was initially based around two interrupts – a timer interrupt to service the keyboard, and a communications interrupt. The communications interrupt was later found an unnecessary complication, and this simplified and speeded up the code.

The timer interrupt function is executed every 250ms, and tests the state of each of the keys and takes appropriate action. It also flashes the LED to indicate 'record' mode. Many of the button functions are duplicated by MIDI commands, so to reduce the code size, as much as possible of the common code between the communications and timer interrupts was placed in shared functions.

When the code was complete and compiled as 8031 code, several problems became apparent. The most obvious was speed – not necessarily of operation, but the unit would 'miss' MIDI commands in quick succession. A number of optimisation techniques overcame this problem. The serial interface helped a great deal in debugging the code, for example, messages could be transmitted to trace the flow of the program.

Repeated programming of the unit proved to be a little slow and so a small Windows application was developed to download files in a simple text format to the unit. This was only a problem during development, when test data was being downloaded often - the finished unit is quite easy to use.

Conclusion

In use the unit is relatively sturdy and works well. It produces excellent results and it was well worth the time and effort. It has already been used in public performances with success.

In the future, the unit could be expanded as a half-rack unit with backlit LCD. This could have many additional features, including chord entry from the unit (without any separate instruments), better editing facilities and additional footswitch inputs. The software and hardware design is flexible enough to allow for additions such as these.

 

 

Copyright © David McCabe, 1998 - 2001. All rights reserved.

You will need to download and install the m-math control to display any equations on this Web site. Without this control, you will not see most of the equations. Please do not e-mail me asking why the equations do not display!

[an error occurred while processing this directive]