Roland MT-32 emulation on MiSTer

The original Roland MT-32 MIDI box.

The AO486 FPGA-core for MiSTer provides the user with a hardware-simulated Creative Labs Sound Blaster card, which will play music for just about any PC game published between the late 80’s and at least the late 90’s.

Despite the card’s massive popularity, the Yamaha OPL2 FM-synthesizer is hardly the most impressive contemporary option for in-game music. That honour goes to a handful of dedicated MIDI-modules, beginning with the MT-32 created by Roland in 1987. Now Roland was in the business of providing electronic instruments to serious amateurs and professional musicians (the MT-32 is in the same pedigree as the venerable D-50 synthesizer used by giants like Jean-Michel Jarre, Prince, Michael Jackson and Enya at the time). PC gamers were hardly at the top of their list.

This changed when Sierre Online, a notable publisher of adventure games, took a serious interest in the sound design of their games. Up until that point, PC games had to make do with the PC’s internal speaker which would only produce simple, single beeps. The Roland devices would change this radically, but at a list price of almost $700 at the time it came at a very considerable price. For comparison’s sake, the Amiga 500 computer also came out in 1987 and provided a powerhouse of a gaming computer, including an awesome sound chip, at a price point similar to that of a single Roland MT-32 module.

Following Sierra Online’s lead, many more games developers did follow suit and added support for the Roland devices. Doing so while also supporting the more ubiquitous AdLib and later Sound Blaster cards added very little development burden. Both technologies could be controlled as MIDI-compatible synthesizers. The developer had to either find a middle ground that covered compatibility between the Roland-devices and the Yamaha-chips, or provide two differently tweaked musical scores depending on the device used.

MiSTer and MT-32

The MiSTer provides MidiLink, an interface that wires the Linux-side of the DE10 Nano board to the running FPGA core. The AO486 and Minimig cores support using ALSA-supported USB MIDI adapters. This opens the door to using actual real-life MIDI instruments like a real MT-32 box with your FPGA-simulated PC. Using actual hardware in this manner requires a USB-to-MIDI interface plugged into your MiSTer board on one end, and your MIDI instrument on the other. MidiLink is then used to expose the MIDI port to the FPGA core and you can use your MiSTer as if it were an actual PC, Amiga or other supported core like the Atari ST.

Example of a USB-to-MIDI interface

Getting and actual MT-32 box from the second hand market will easily cost you hundreds of dollars. While nothing will beat the original in compatibility, it’s a pretty steep price to pay. Fortunately, you have other options.

One of these options is the use of MUNT. This feature comes with the now-current MidiLink 2.0 on MiSTer. It works by using the Linux-side of the system and its ARM CPU to emulate the MT-32 device in software, right alongside the FPGA which is simulating your computer core at the same time. MidiLink ties them together, and the result is completely brilliant for the casual gamer who uses MiSTer in combination with an HDMI-connected modern TV. Games supporting both the MT-32 (and General MIDI-instruments through FluidSynth) will play back their music through your TV’s speakers, while any speech and sampled sound effects that come out of a Sound Blaster will get mixed into the output.

All you need to do, is run the /media/fat/Scripts/ and /media/fat/Scripts/ scripts in order to load the proper support files into your MiSTer board. After that, it’s a matter of setting up the Audio hardware on the AO486 core to use MUNT (for MT-32) or FluidSynth (for General MIDI) playback.

A disadvantage of using the DE10 Nano’s ARM CPU to emulate the MIDI instrument, is the fact that the CPU is only just barely capable of pulling this off while also servicing the MiSTer housekeeping tasks. This leads to incidental jitter or stuttering of the audio. Generally fine for casual gaming and it never bothered me, but you have other options other than a real instrument.

Enter mt32-pi, a system you can flash to a micro-SD card which will transform any Raspberry Pi 3 and up into a versatile MIDI-instrument. While the Pi itself is hardly a Hi-Fi device, it can be expanded with custom DAC’s to clean up the sound output right up to the point of 24-bit/96KHz. samples output through professional balanced XLR and still save quite a wad of cash when compared to a second hand MT-32.

The immediate question I had when considering this option, was how to connect a Pi to a MiSTer for MIDI purposes. It wouldn’t make much sense to convert from USB to MIDI, just to go straight back to USB on the Pi’s end. Fortunately, the MiSTer and mt32-pi know how to send MIDI events over the network. As long as your MiSTer and Pi are connected to a TCP/IP-network where they can exchange UDP-packets at any half-decent rate, you won’t need any cables to make mt32-pi work. Set up the mt32-pi as a server, and tell the MiSTer to send its MIDI events to the Pi’s listening UDP port. Note that MIDI does not transmit the actual sound across the network, just the sequence of notes te be played by the instrument. You’ll see around 32Kbits/sec. of network traffic between the devices.

Mixing the output of the mt32-pi or a real MIDI instrument together with the emulated Sound Blaster is left as an exercise for the reader. This used to be a problem back in the day for anyone using multiple sound cards in the same system. Routing the analogue audio outputs through the simplest of mixing panels and from there out to an amplifier is what I used to do.