MiSTer AO486 Core Part 8 – Roland MT-32, Sound Canvas Audio via MidiLink

DOS, FPGA, How To, MIDI, MiSTer, Posts, Retrocomputing, Retrogaming, Single-Board Computing

AdLib is the de facto synth standard for DOS-gaming. Almost all games support AdLib music, and popular cards like the Sound Blaster include the same Yamaha YM3812 (OPL2) chip for AdLib-compatibility.

But true DOS gamers can do better. Games from the late 80s onwards often feature vastly superior MIDI audio – with strong support for the Roland MT-32 synthesiser and (for later games) the General MIDI standard. Give this a listen:

Sounds glorious, no? Especially when compared to the (rather drab) AdLib audio version.

Thanks to fantastic work in the MiSTer community, you can get this working on your own MiSTer. Here’s how.

On real PCs, the Sound Blaster and other audio cards often include a MIDI interface for connecting MIDI devices. MiSTer provides a connectivity solution too via “MidiLink” – a daemon that runs on the ARM CPU, interfacing with running FPGA cores to pipe MIDI traffic downstream for playback. To get MidiLink installed:

  1. Power on your MiSTer and hit F12 to open the System Settings menu

  2. Run Scripts → Yes → midilink_updater. This will install the latest version of MidiLink

  3. After the forced reboot, hit F12 once again to open the System Settings menu

  4. This time, run Scripts → Yes → soundfont_install. This will download the SoundFonts and ROMs necessary for MIDI playback.

For reference, the downloaded ROMs are stored in /media/fat/linux in the following file structure:

/media/fat/linux
│
├── mt32-rom-data
│   ├── CM32L_CONTROL.ROM
│   └── CM32L_PCM.ROM
│
└── soundfonts
    └── SC-55.sf2

These paths can also be adjusted in /media/fat/linux/MidiLink.INI.

Step 2 – Enable MIDI Connection

With MidiLink installed, we’re almost ready to play! But first we need to enable the MIDI connection:

  1. Boot the MiSTer ao486 core (F12 brings up the MiSTer main menu, browse to Computer → ao486)

  2. Hit Windows Key + F12 for ao486 core options. Hit the right arrow key for System options

  3. Scroll to UART mode. Hit Enter

  4. Set Connection to MIDI. Now we’re ready for some MIDI playback!

Exploring the UART Mode menu, MidiLink has several playback options:

Connection: MIDI
│
├── MidiLink: Local
│   ├── Type: MUNT
│   └── Type: FSYNTH
│
├── MidiLink: USB
│
└── MidiLink: UDP
  • Local uses real-time software synthesisers (MUNT and FluidSynth) to play MIDI audio directly on the MiSTer itself
  • USB is for physically connecting a MIDI playback device (the menu option is hidden otherwise)
  • UDP sends MIDI data over the network to another software synthesiser

We’ll explore each of these below.

Whichever option you pick, the MIDI port is always 330 (for use during game setup).

Roland MT-32 Playback via MUNT

Configure MidiLink as follows. Then hit Save:

In this mode, MiSTer runs the Munt software synthesizer to emulate a real Roland MT-32. This is a super neat “ready to go” solution, with sound piped directly to your TV via the HDMI port. Give it a listen:

Unfortunately, MiSTer’s onboard ARM CPU isn’t quite powerful enough to run MUNT at full speed. You might hear some smooshed, delayed or off-pitch notes compared to authentic playback. If this is an issue for you, don’t worry – there are other options.

General MIDI Playback via FluidSynth

Configure MidiLink as follows:

In this mode, MiSTer runs the FluidSynth software synthesizer for General MIDI playback. By default, it uses Roland SC-55 SoundFonts, but any SoundFonts will work. FluidSynth is much lighter on the CPU vs Munt and playback is very authentic. Witness this awesome rendition of the Doom E1M1 theme:

Direct Playback via USB

If you’re lucky enough to own real MT-32 or Sound Canvas hardware, you can hook it up to the MiSTer directly.

You’ll need an ALSA-supported USB MIDI adapter such as the Roland UM-ONE. With an adapter connected, the USB menu option will appear. If you don’t have a real synth, consider the mt32-pi project – a baremetal MIDI/MT-32 synthesizer for Raspberry Pi 3.

Network Playback over UDP

Configure MidiLink as follows:

In this mode, MidiLink will transmit MIDI data onto the network as UDP packets – for playback on a networked MIDI device. To get this working:

  1. Download, install and run a software synthesizer on your home PC. Munt works well for MT-32 emulation and VirtualMIDISynth for General MIDI

  2. Copy the necessary MT-32 ROMS / SoundFonts from your MiSTer. Find them in /media/fat/linux

  3. Download and run UDPMIDI. This small program will receive the UDP MIDI packets and forward them to your selected synth

  4. Edit /media/fat/linux/MidiLink.INI on your MiSTer. Set UDP_SERVER to the IP address of your home PC:

  1. When MIDI playback begins in ao486, UDPMIDI will start receiving packets and playback should start!

UDP Troubleshooting

If you have trouble receiving packets, check your personal firewall. I use Windows Defender Firewall and had to add an incoming rule to allow private network traffic on UDP port 1999:

As an alternative to UDPMIDI, it’s also possible to build MidiLink from source and run in “listen” mode. The command line args are:

  • UDPMUNT – to listen and forward to Munt
  • UDPFSYNTH – to listen and forward to FluidSynth

You can even run MidiLink on mt32-pi for an “appliance-like” solution. More details here.

Wrap Up

That’s it! We’ve explored all facets of MidiLink and MIDI playback options in ao486. Good luck with your own MIDI adventures!

More MIDI articles

Comments