Homemade SIO MIDI Interface

Year
1991
Type
DIY project
Category
MIDI interface
Manufacturer
Homebrew design by Christopher Terpin (public domain)
Green SIO2MIDI v1.1 circuit board with two MIDI DIN sockets, an optocoupler and a PIC microcontroller

Overview

MIDI is a serial protocol, and the Atari's POKEY chip already contains a serial port. That makes the 8-bit one of the easiest computers to connect to a synthesizer. Commercial interfaces such as Hybrid Arts' MIDIMate (introduced at NAMM in January 1984), 2 Bit Systems' MIDI Master and Wizztronics' MIDIMax plugged into the SIO port. In March 1991 Christopher Terpin of Buffalo, New York posted a "Homemade MIDI interface for the Atari 8-Bit" to comp.sys.atari.8bit. It uses one inverter chip, two resistors and some cable, and comes with public-domain assembly-language driver software.

The hardware

Parts: one 7404 hex inverter (or a 7400 NAND), two 220 Ω resistors, an Atari SIO plug, two 5-pin DIN MIDI plugs, perfboard, a project box, and about 10 feet of three-wire cable. An optoisolator for MIDI IN is optional but recommended to protect the synth.

Only four SIO pins are used: 3 (Data In), 4 (Ground), 5 (Data Out) and 10 (+5 V).

  • MIDI OUT: the computer's Data Out (SIO pin 5) passes through two 7404 inverters, which buffer it without inverting it, and then a 220 Ω resistor to MIDI pin 5. MIDI pin 4 goes through the second 220 Ω resistor to +5 V (SIO pin 10). MIDI pin 2 is ground. This forms the standard MIDI current loop: when the line goes low, current flows through the synth's opto-coupler.
  • MIDI IN: the synth's loop arrives on the input plug and, ideally through an optoisolator, drives the computer's Data In (SIO pin 3).
  • Leave pins 1 and 3 of the OUT cable and pins 1–3 of the IN cable unconnected.

The software

MIDI.OBJ (written in June 1989, revised in March 1991) loads at $9900 (39168). You lower RAMTOP first with POKE 106,154, followed by GR.0. It is called from Atari BASIC with USR:

Call Effect
I=USR(39168,ASC("I")) install a V: device handler; then OPEN #1,8,0,"V:" and send bytes with PUT #1 or PRINT #1;
I=USR(39168,ASC("C")) restore normal serial I/O
I=USR(39168,ASC("R"),ADR(A$)) record incoming MIDI into a string. POKE 204,1 starts, POKE 204,0 stops, and the length is PEEK(205)+256*PEEK(206)
I=USR(39168,ASC("P"),ADR(A$),ADR(A$)+L) play a recording back

You can record a second track while playing back the first, which gives a minimal multitrack sequencer in BASIC. Under the hood the handler links POKEY channels 3 and 4 (AUDF3/AUDF4 with AUDCTL) to make a 16-bit baud-rate divider set for MIDI's ~31.25 kbit/s. It programs SKCTL (and its shadow at $232) for asynchronous serial, and reads incoming bytes from SERIN ($D20D).

Known issue

Normal disk I/O and the MIDI interface can interfere. A note may sound on the synth during a disk save, or the disk may glitch if you play the keyboard during I/O. Terpin suggested replacing the 7404 with a tri-state buffer switched off by the SIO Motor Control line (pin 8). That is the same trick commercial units use, which is why the MIDIMate must be the last device on the SIO chain and only one Motor-Control device can be attached.

Modern descendants

If you want something less improvised, several later open designs remain MIDIMate-compatible, so they work with MIDITrack and the MIDI Music System:

  • MIDIMate-Interface V2 by Christoph Büssow (HardWareDoc/ABBUC, 2011), with IN, OUT and THRU, in end-of-chain and pass-through versions.
  • MIDI Muse by Ivo van Poorten (2018), source on GitHub (ivop/midimuse).
  • SIO2MIDI and SIO2MIDI-S2 by Michael St. Pierre (Mytek/AtariBits, 2019 and 2021). The S2 version can host a DreamBlaster S2 synth module with its own headphone jack.

Always check wiring before connecting to a synthesizer, since a wiring mistake can damage its MIDI port.

Credits