Skip to content

Commit 595e0f6

Browse files
committed
Update README.md
1 parent 8eec397 commit 595e0f6

File tree

1 file changed

+70
-16
lines changed

1 file changed

+70
-16
lines changed

README.md

Lines changed: 70 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33

44
## 🎹🎶 mt32-pi
55

6-
A work-in-progress baremetal Roland MT-32 and CM-32L emulator for the Raspberry Pi 3 or above, based on [Munt] and [Circle].
7-
Turn your Raspberry Pi into a dedicated emulation of the [famous multi-timbre sound module](https://en.wikipedia.org/wiki/Roland_MT-32) used by countless classic MS-DOS and Sharp X68000 games, that starts up in seconds!
6+
- A work-in-progress baremetal MIDI synthesizer for the Raspberry Pi 3 or above, based on [Munt], [FluidSynth] and [Circle].
7+
- Turn your Raspberry Pi into a dedicated emulation of the [famous multi-timbre sound module](https://en.wikipedia.org/wiki/Roland_MT-32) used by countless classic MS-DOS, PC-98 and Sharp X68000 games!
8+
- 🆕 Add your favorite [SoundFonts][SoundFont] to expand your synthesizer with [General MIDI], [Roland GS], or even [Yamaha XG] support for endless MIDI possibilities.
9+
- 🆕 Includes General MIDI and Roland GS support out of the box thanks to [GeneralUser GS] by S. Christian Collins.
10+
- No operating system, no complex Linux audio configuration; just super-low latency audio.
11+
- Easy to configure and ready to play from cold-boot in a matter of seconds.
12+
- The perfect companion for your vintage PC or [MiSTer] FPGA setup.
813

914
## 🔖 Table of contents
1015

@@ -25,17 +30,20 @@ Turn your Raspberry Pi into a dedicated emulation of the [famous multi-timbre so
2530
+ [Serial ports](#serial-ports)
2631
- [🔊 I2S DAC support](#-i2s-dac-support)
2732
* [Setup](#setup)
28-
* [Compatibility](#compatibility-1)
33+
* [Compatibility](#compatibility)
2934
* [Finding the I2C address of your DAC](#finding-the-i2c-address-of-your-dac)
3035
- [📺 LCD and OLED displays](#-lcd-and-oled-displays)
3136
* [Drivers](#drivers)
3237
+ [Hitachi HD44780 compatible 4-bit driver (`hd44780_4bit`)](#hitachi-hd44780-compatible-4-bit-driver-hd44780_4bit)
3338
+ [Hitachi HD44780 compatible I2C driver (`hd44780_i2c`)](#hitachi-hd44780-compatible-i2c-driver-hd44780_i2c)
3439
+ [SSD1306 I2C driver (`ssd1306_i2c`)](#ssd1306-i2c-driver-ssd1306_i2c)
35-
* [Compatibility](#compatibility-2)
36-
- [🧠 ROM support](#-rom-support)
40+
* [Compatibility](#compatibility-1)
41+
- [🧠 MT-32 ROM support](#-mt-32-rom-support)
3742
* [ROM scanning](#rom-scanning)
3843
* [Switching ROM sets](#switching-rom-sets)
44+
- [🎺 SoundFont support](#-soundfont-support)
45+
* [SoundFont scanning](#soundfont-scanning)
46+
* [Switching SoundFonts](#switching-soundfonts)
3947
- [🔩 Custom hardware](#-custom-hardware)
4048
- [💬 Custom System Exclusive messages](#-custom-system-exclusive-messages)
4149
- [❓ FAQ](#-faq)
@@ -46,7 +54,7 @@ Turn your Raspberry Pi into a dedicated emulation of the [famous multi-timbre so
4654

4755
## ✔️ Project status
4856

49-
- Tested on Raspberry Pi 4 Model B and Raspberry Pi 3 Model B & B+.
57+
- Tested on Raspberry Pi 4 Model B and Raspberry Pi 3 Model A+, B, and B+.
5058
* Pi 2 works, but only with concessions on playback quality.
5159
* Pi 0 and 1 are unfortunately too slow, even with an overclock.
5260
- PWM headphone jack audio.
@@ -58,17 +66,20 @@ Turn your Raspberry Pi into a dedicated emulation of the [famous multi-timbre so
5866
- [Config file](#-configuration-file) for selecting hardware options and fine tuning.
5967
- [LCD status screen support](#-lcd-and-oled-displays) (for MT-32 SysEx messages and status information).
6068
- Control buttons, rotary encoder etc. is _planned_.
61-
- A port of FluidSynth is _planned_.
6269
- Network MIDI and auto-update is _planned_.
6370

6471
## ✨ Quick-start guide
6572

6673
- Download the latest release from the [Releases] section.
6774
- Extract contents to a blank FAT32-formatted SD card.
6875
* If you are updating an old version, you can just replace the `kernel*.img` files. The other boot files will not change often; but keep an eye on the [changelog] just in case.
69-
- Add your MT-32 or CM-32L ROM images to the `roms` directory - you have to provide these for copyright reasons.
70-
* You will need at least one control ROM and one PCM ROM. For information on using multiple ROM sets and switching between them, see the [ROM support](#-rom-support) section.
76+
- For MT-32 support, add your MT-32 or CM-32L ROM images to the `roms` directory - you have to provide these for copyright reasons.
77+
* You will need at least one control ROM and one PCM ROM.
78+
* For information on using multiple ROM sets and switching between them, see the [MT-32 ROM support](#-mt-32-rom-support) section.
7179
* The file names or extensions don't matter; `mt32-pi` will scan and detect their types automatically.
80+
- Optionally add your favorite SoundFonts to the `soundfonts` directory.
81+
* For information on using multiple SoundFonts and switching between them, see the [SoundFont support](#-soundfont-support) section.
82+
* Again, file names/extensions don't matter.
7283
- Connect a [USB MIDI interface](#usb-midi-interfaces) or [GPIO MIDI circuit](#gpio-midi-interface) to the Pi, and connect some speakers to the headphone jack.
7384
- Connect your vintage PC's MIDI OUT to the Pi's MIDI IN and (optionally) vice versa.
7485

@@ -241,7 +252,7 @@ The following displays and configurations have been confirmed as working by our
241252
| Generic | [128x64 OLED] | `type = ssd1306_i2c`, `width = 128`, `height = 64`, `i2c_lcd_address = 3c` | Similar to the 32 pixel high OLED, just with more rows. Tested by @dwhinham. |
242253
| Raystar | [REC002004B] | `type = hd44780_4bit`, `width = 20`, `height = 4` | High-contrast 20x4 OLED display. Tested by @dwhinham. |
243254

244-
## 🧠 ROM support
255+
## 🧠 MT-32 ROM support
245256

246257
`mt32-pi` can make use of all ROMs that [Munt] supports, and allows switching between ROM sets on-the-fly for greater compatibility with various games. For further information about which games work best with each ROM set, consult the [MT-32 game compatibility list].
247258

@@ -250,7 +261,7 @@ A ROM set consists of:
250261
- a **control ROM** (contains the code that runs on the MT-32's CPU).
251262
- a **PCM ROM** (contains the sound samples).
252263

253-
For simplicity, `mt32-pi` categorises the known control ROMs into three types:
264+
For simplicity, `mt32-pi` categorizes the known control ROMs into three types:
254265

255266
1. **MT-32 (old)**: The original version of the MT-32, ROM versions 1.xx.
256267
2. **MT-32 (new)**: The later version of the MT-32, ROM versions 2.xx.
@@ -260,6 +271,8 @@ As for PCM ROMs, there are only two known versions - the MT-32 version (common t
260271

261272
To summarize, to get the most out of `mt32-pi`, you'll need **5 ROM files in total** - old/new/CM-32L control ROMs, and MT-32/CM-32L PCM ROMs.
262273

274+
> ⚠️ **Note:** To use the MT-32 synthesizer, you must either set it as the default synth in the config file, or switch to it at runtime using a [custom SysEx message](#-custom-system-exclusive-messages).
275+
263276
### ROM scanning
264277

265278
On startup, `mt32-pi` will scan the `roms` directory and load the first ROM it encounters that matches each category. In other words, if you have two "old" control ROMs (e.g. version 1.05 and 1.07), only one of them will be used and assigned to the "old" category slot. Therefore, it's recommended that you only place **one ROM per category** in the `roms` directory.
@@ -274,6 +287,34 @@ It may be useful to create scripts (e.g. a DOS batch file) that send `mt32-pi` R
274287

275288
In the future, `mt32-pi` will allow you to switch ROM sets from a menu or button combination.
276289

290+
## 🎺 SoundFont support
291+
292+
[SoundFont] is a file format that allows sound samples, instrument mappings and synthesizer behaviors to be stored in a self-contained package. Any SoundFont-compliant synthesizer software or hardware can then load the SoundFont and, in theory, produce the same audio output. The SoundFont was made popular by the Creative Labs Sound Blaster AWE32 and later family of sound cards, which used it to provide reconfigurable MIDI synthesis for use with games and for music production purposes.
293+
294+
The flexibility of the SoundFont standard means that several MIDI specifications such as [General MIDI], [Roland GS], and [Yamaha XG] can be implemented with the same synthesizer engine, opening up a wide range of possibilities.
295+
296+
`mt32-pi` uses the [FluidSynth] engine to provide SoundFont support, and comes with the [GeneralUser GS] SoundFont so that you have excellent General MIDI and Roland GS compatibility out of the box.
297+
298+
> ⚠️ **Note:** To use the SoundFont synthesizer, you must either set it as the default synth in the config file, or switch to it at runtime using a [custom SysEx message](#-custom-system-exclusive-messages).
299+
300+
### SoundFont scanning
301+
302+
On startup, `mt32-pi` will scan the `soundfonts` directory and perform a quick test on each file to search for valid SoundFonts. SoundFonts are then added to a list, and sorted into lexicographical order (i.e. 0-9, A-Z).
303+
304+
The [configuration file](#-configuration-file) allows you to change which SoundFont should be loaded when multiple SoundFonts are available.
305+
306+
### Switching SoundFonts
307+
308+
Just like with MT-32 ROMs, you can use a [custom SysEx message](#-custom-system-exclusive-messages) to make `mt32-pi` swap SoundFonts at runtime.
309+
310+
The configuration file and custom SysEx messages for SoundFont switching use a **zero-based index** into a sorted list of valid SoundFonts. This means that `0` is the first, `1` is the second, and so on.
311+
312+
When switching, the current SoundFont is unloaded from memory, and the chosen SoundFont is (re)loaded from SD card. This may take some seconds depending on the size of the file, speed of the SD card, and model of Raspberry Pi.
313+
314+
This behavior may be improved in the future - it will be possible to implement a (pre)caching system to keep frequently-used SoundFonts in memory. There are also some caveats with large SoundFonts and Pi models with low RAM - see the [FAQ](#-faq) for notes on this.
315+
316+
In the future, `mt32-pi` will allow you to switch SoundFonts from a menu or button combination.
317+
277318
## 🔩 Custom hardware
278319

279320
[<img width="280rem" align="right" src="https://www.arananet.net/pedidos/wp-content/uploads/2020/08/3.jpg">][PI-MIDI]
@@ -294,17 +335,21 @@ F0 7D { command } { parameters } F7
294335

295336
> ⚠️ **Note:** These commands are subject to change until the project reaches a mature state.
296337
297-
| Command | Description | Parameters |
298-
|-----------|--------------------------|-----------------------------------------------------------------------------|
299-
| `00` | Reboot the Raspberry Pi. | None |
300-
| `01` `xx` | Switch ROM set. | `xx` = `00`: MT-32 (old)<br>`xx` = `01`: MT-32 (new)<br>`xx` = `02`: CM-32L |
338+
| Command | Description | Parameters |
339+
|-----------|--------------------------|---------------------------------------------------------------------------------------------|
340+
| `00` | Reboot the Raspberry Pi. | None |
341+
| `01` `xx` | Switch ROM set. | `xx` = `00`: MT-32 (old)<br>`xx` = `01`: MT-32 (new)<br>`xx` = `02`: CM-32L |
342+
| `02` `xx` | Switch SoundFont. | `xx` = Zero-based index into contents of `soundfonts` directory (lexicographically sorted). |
343+
| `03` `xx` | Switch synthesizer. | `xx` = `00`: MT-32<br>`xx` = `01`: SoundFont |
301344

302345
## ❓ FAQ
303346

304347
- **Q:** I'm trying to play sounds on `mt32-pi` using my MIDI keyboard controller but I'm not hearing anything - what's wrong?
305348
**A:** Your keyboard is probably sending note data on **channel 1**, but by default, on power-up the MT-32 is set to receive on MIDI **channels 2-10**. Check your keyboard's documentation to see if you can change the transmit channel. If this isn't possible, [see this wiki page](https://github.com/dwhinham/mt32-pi/wiki/MIDI-channel-assignment) for more information on how to reassign the emulated MT-32's channels.
306349
- **Q:** I'm getting sound distortion and/or the power LED on my Raspberry Pi is blinking - why?
307350
**A:** It's possible that the Pi is not receiving enough power. Try swapping the USB cable being used to power the Pi, or try another power supply. Check the [Raspberry Pi power supply page] for recommended power supply specifications.
351+
- **Q:** I'm trying to switch between very large (>200MB) SoundFonts and received an error message/crash - what's wrong?
352+
**A:** This is probably due to memory fragmentation. When using a Raspberry Pi with a lower amount of RAM such as the Pi 3A+ (512MB), the memory allocator may struggle to find enough free contiguous space after unloading a large SoundFont and attempting to load another one. This is a difficult problem to solve, but may be improved in the future. For now, stick to smaller SoundFonts, avoid switching between large ones, or choose a Pi with more RAM.
308353
- **Q:** Why don't I see any video output on my HDMI-connected monitor or television? Has the Pi has failed to boot?
309354
**A:** This is completely normal - `mt32-pi` is designed to run headless and therefore there is no video output. For troubleshooting purposes, it's possible to compile `mt32-pi` with HDMI debug logs enabled, but these builds will hang on a Raspberry Pi 4 if **no** HDMI display is attached due to a quirk of the Pi 4 and Circle. Hence, for regular use, video output is disabled.
310355
- **Q:** What happened to the old `mt32-pi` project that was based on a minimal Linux distro built with Buildroot?
@@ -318,24 +363,30 @@ This project, just like [Munt], has no affiliation with Roland Corporation. Use
318363

319364
- Many thanks go out to @rc55 and @nswaldman for their encouragement and testing! ❤️
320365
- The [Munt] team for their incredible work reverse-engineering the Roland MT-32 and producing an excellent emulation and well-structured project.
366+
- The [FluidSynth] team for their excellent and easily-portable SoundFont synthesizer project.
367+
- [S. Christian Collins][GeneralUser GS] for the excellent GeneralUser GS SoundFont and for kindly giving permission to include it in the project.
321368
- The [Circle] and [circle-stdlib] projects for providing the best C++ baremetal framework for the Raspberry Pi.
322369
- The [inih] project for a nice, lightweight config file parser.
323370

324371
[1]: http://www.arvydas.co.uk/2013/07/cheap-usb-midi-cable-some-self-assembly-may-be-required/
325372
[128x32 OLED]: https://www.aliexpress.com/item/32661842518.html
326373
[128x64 OLED]: https://www.aliexpress.com/item/32233334632.html
327374
[2]: https://karusisemus.wordpress.com/2017/01/02/cheap-usb-midi-cable-how-to-modify-it/
328-
[3]: http://www.fm-alive.com/Pages/DXMidi.aspx
329375
[2002-1 Series]: https://www.buydisplay.com/character-lcd-display-module/20x2-character
376+
[3]: http://www.fm-alive.com/Pages/DXMidi.aspx
330377
[Changelog]: https://github.com/dwhinham/mt32-pi/blob/master/CHANGELOG.md
331378
[circle-stdlib]: https://github.com/smuehlst/circle-stdlib
332379
[Circle]: https://github.com/rsta2/circle
333380
[digital-to-analog converter]: https://en.wikipedia.org/wiki/Digital-to-analog_converter
381+
[FluidSynth]: http://www.fluidsynth.org/
382+
[General MIDI]: https://en.wikipedia.org/wiki/General_MIDI
383+
[GeneralUser GS]: http://schristiancollins.com/generaluser.php
334384
[GY-PCM5102]: https://www.aliexpress.com/item/4000049720221.html
335385
[Hairless MIDI]: https://projectgus.github.io/hairless-midiserial/
336386
[HiFi DAC HAT]: https://www.amazon.com/gp/product/B07D13QWV9/
337387
[I2C backpack]: https://www.adafruit.com/product/292
338388
[inih]: https://github.com/benhoyt/inih
389+
[MiSTer]: https://github.com/MiSTer-devel/Main_MiSTer/wiki
339390
[MT-32 game compatibility list]: https://en.wikipedia.org/wiki/List_of_MT-32-compatible_computer_games#IBM_PC_compatibles
340391
[Munt]: https://github.com/munt/munt
341392
[Pi-DAC Pro]: https://web.archive.org/web/20191126140807/http://iqaudio.co.uk/hats/47-pi-dac-pro.html
@@ -344,4 +395,7 @@ This project, just like [Munt], has no affiliation with Roland Corporation. Use
344395
[Raspberry Pi power supply page]: https://www.raspberrypi.org/documentation/hardware/raspberrypi/power/README.md
345396
[REC002004B]: https://www.raystar-optronics.com/oled-character-display-module/REC002004B.html
346397
[Releases]: https://github.com/dwhinham/mt32-pi/releases/latest
398+
[Roland GS]: https://en.wikipedia.org/wiki/Roland_GS
347399
[SoftMPU]: http://bjt42.github.io/softmpu/
400+
[SoundFont]: https://en.wikipedia.org/wiki/SoundFont
401+
[Yamaha XG]: https://en.wikipedia.org/wiki/Yamaha_XG

0 commit comments

Comments
 (0)