Build a sync to MIDI interface
Chris Read's sync to MIDI interface project.
For the last eighteen months, I have disappeared for several hours each week into the inner sanctum of my "studio". In reality, it used to be the front hall and measures a mere 12' x 4' into which I have crammed a Fostex 250 4-track recorder, Korg Poly 800, Drumatix drum machine, guitars and amplifier. The trouble was, the sequencer on the Poly 800 was virtually redundant as I could not synchronise it with the Drumatix. A survey of music shops and magazines revealed that I would have to spend at least £125 for a readymade interface to achieve compatibility. However luck has it, I am also an electronics design engineer, so I decided to give the old grey matter a shake-up and design an interface to overcome the problem of synchronisation.
There are several drum machines, like the Drumatix, which output a simple clock pulse usually at a rate of 24 or 48 pulses per quarter note. However, this format is not compatible with sequencers or synthesisers which incorporate the MIDI standard of data transfer.
The MIDI system requires 10 bits of serial data at a rate of 31.25 KBaud for each command. Each command consists of a start bit, 8 data bits and a stop bit, making a total of 10 bits for a period of 320 microseconds per serial byte. For "Real Time" operation (ie sequencing) three commands are required. First start byte is received, followed by the timing bytes and finally, to stop the sequencer, a stop byte.
The MIDI "Real Time" codes are as follows:
From the outset, I decided to use readily available low-cost components and that the interface would be battery operated. The circuit can be broken down into block functions as shown in fig. 1.
Upon receiving an input, the Pulse Decoder generates a set pulse which starts the Baud clock. The Decade Counter is incremented by the clock at 32 microsecond intervals until the Reset pulse stops the count. Depending on the type of input (ie Run, Stop or Clock), the Logic Decoder selects the equivalent MIDI code to be outputted.
An alternative method of control, utilising a "Clock-only" input (for drum machines without a Run/Stop signal), can be selected by switch SW2. This is facilitated by the R17, C11 circuit which detects presence of the Clock input.
The Baud clock is formed by a CMOS 555 timer (IC1) and is adjusted to 31.25 KHz by P1.
To accommodate an input rate of 48 pulses per quarter note instead of 24, switch SW3 is closed and the Decade counter (IC2) is forced to generate an additional count sequence during every other timing clock pulse. As this intermediate sequence is not outputted to the MIDI instrument, the tempo rate is halved.
The Pulse Decoder comprises logic Nand gates N3, N4 and outputs the three commands of Start, Timing and Stop, select to the MIDI Code select logic gates N2, N5. Transistor Q1 provides a current source of 5mA minimum compatible with a "MIDI IN" receiver.
Considerable design effort was given to the suppression of spurious or undefined transmissions at power-up, to prevent the MIDI Sequencer bursting into life unexpectedly. Suppression is accomplished by R1, R4, D4, C4 producing a "masking" reset pulse to pin 15 of IC2 via Nand gate N5. Similarly at powerdown, a Stop Code is automatically transmitted, otherwise the synthesiser would sound a continuous note or chord. This was achieved by careful design of the power supply circuitry D1, C1, R1, R2 and Z1.
The electronic components may be assembled on a piece of matrix or Veroboard approximately 4½" x 3½" - layout is not critical. All ICs should be plugged into suitable DIL sockets mounted on the board to facilitate testing and fault-finding. Handling of the CMOS ICs should be kept to a minimum before and during insertion to avoid damage due to static. The CMOS version of the 555 IC was used because of its low current requirement. A suitable metal or plastic box is used to house the circuit board, switches and DIN sockets.
Carefully check all components, solder joints and wiring interconnections with particular attention to the orientation of the ICs in their sockets.
Interconnect the Codebreaker with a drum machine and synthesiser sequencer which have been previously programmed. The synthesiser should be set up to receive MIDI sequence clock information. On the Poly 800 this is simply achieved by setting parameter 88 to value 2. The only adjustment to the interface is to calibrate the 555 timer (IC1) frequency and is accomplished thus: Set the tempo switch to 24 pulses per quarter note and the Run - Clock switch to the Run position, (some drum machines necessitate the clock position being selected instead). Switch on and press the start button on the drum machine. If the sequencer does not respond, gradually adjust potentiometer, P1 with repeated operations of the start button until successful. Finally set P1 to midway of the extreme positions that permit successful operation. Alternatively, an oscilloscope or frequency counter may be used to adjust the output at pin 3 of IC1 to 31,26KHz ± 300Hz. Measurement is readily achieved by temporarily removing N1 so that IC1 free-runs. Refit N1 after test. Check all switch positions for satisfactory operation. If all does not appear to function correctly, switch off and thoroughly check all components and connections.
Battery current consumption is typically 2 to 3mA. If an extra MIDI output is required, to control an additional sequencer, a second output circuit should be connected as per fig 3.
The interface can initiate, clock and stop a sequencer at any point in a song by judicious operation of switch SW2. A change in rhythmic "feel" can be implemented by switch SW3, including, with a little practice, between bars. The Codebreaker is suitable for live work or recording. An additional bonus during multitrack recording is available if a click-track is recorded from a drum machine or sync-pulse generator. The interface can now directly control the sequencer via the click-track to create overdubs of different sounds and sequences. This method allows corrective or retrospective programming of the drum machine or sequencer as the composition progresses.
My home studio was used to record Codebreaker using a Drumatix and Poly 800. A click-track was recorded on one track to synchronise a basic drum and sequence pattern at the initial stages of the composition. It was then used to co-ordinate a further four synth overdubs with the final drum patterns. This feature has the effect of expanding the number of tracks on the recorder during overdubs, without the inherent deterioration encountered during track-bouncing. The melody leadlines were played live on the Poly 800 and my Fender Stratocaster guitar (sampled by the four digits on my left hand).
The Codebreaker interface costs about £20 to construct and must surely interest the many owners of hitherto incompatible sync clock and MIDI instruments. Further benefits are achieved when using a dick-track, to enhance the potential of the Codebreaker as a composition and recording tool.