Skip to content

Commit 726d4f2

Browse files
committed
Update README.md
1 parent 2886162 commit 726d4f2

File tree

1 file changed

+94
-52
lines changed

1 file changed

+94
-52
lines changed

README.md

Lines changed: 94 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,77 @@
66
A work-in-progress baremetal Roland MT-32 emulator for the Raspberry Pi 3 or above, based on [Munt] and [Circle].
77
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!
88

9+
## 🔖 Table of contents
10+
11+
<!-- Generated with jonschlinkert/markdown-toc -->
12+
<!-- Needs manual emoji fixup because of https://github.com/jonschlinkert/markdown-toc/issues/119 -->
13+
14+
<!-- toc -->
15+
16+
- [✔️ Project status](#-project-status)
17+
- [✨ Quick-start guide](#-quick-start-guide)
18+
- [📝 Configuration file](#-configuration-file)
19+
- [🎹 MIDI connectivity](#-midi-connectivity)
20+
* [USB MIDI interfaces](#usb-midi-interfaces)
21+
+ [Compatibility](#compatibility)
22+
* [GPIO MIDI interface](#gpio-midi-interface)
23+
+ [Schematic](#schematic)
24+
+ [Breadboard example](#breadboard-example)
25+
- [🔊 I2S DAC support](#-i2s-dac-support)
26+
* [Setup](#setup)
27+
* [Compatibility](#compatibility-1)
28+
* [Finding the I2C address of your DAC](#finding-the-i2c-address-of-your-dac)
29+
- [📺 LCD and OLED displays](#-lcd-and-oled-displays)
30+
* [Drivers](#drivers)
31+
+ [Hitachi HD44780 compatible 4-bit driver (`hd44780_4bit`)](#hitachi-hd44780-compatible-4-bit-driver-hd44780_4bit)
32+
+ [Hitachi HD44780 compatible I2C driver (`hd44780_i2c`)](#hitachi-hd44780-compatible-i2c-driver-hd44780_i2c)
33+
+ [SSD1306 I2C driver (`ssd1306_i2c`)](#ssd1306-i2c-driver-ssd1306_i2c)
34+
* [Compatibility](#compatibility-2)
35+
- [🔩 Custom hardware](#-custom-hardware)
36+
- [💬 Custom System Exclusive messages](#-custom-system-exclusive-messages)
37+
- [❓ FAQ](#-faq)
38+
- [⚖️ Disclaimer](#-disclaimer)
39+
- [🙌 Acknowledgments](#-acknowledgments)
40+
41+
<!-- tocstop -->
42+
943
## ✔️ Project status
1044

11-
* Tested on Raspberry Pi 4 Model B and Raspberry Pi 3 Model B & B+.
12-
+ Pi 2 works, but only with concessions on playback quality.
13-
+ Pi 0 and 1 are unfortunately too slow, even with an overclock.
14-
* PWM headphone jack audio.
15-
+ Quality is known to be poor (aliasing/distortion on quieter sounds).
16-
+ It is not currently known whether this can be improved or not.
17-
* [I2S Hi-Fi DAC support](#-i2s-dac-support).
18-
+ This is the recommended audio output method for the best quality audio.
19-
* [USB](#-usb-midi-interfaces) or [GPIO](#-gpio-midi-interface) MIDI interface.
20-
* [Config file](#-configuration-file) for selecting hardware options and fine tuning.
21-
* [LCD status screen support](#-lcd-and-oled-displays) (for MT-32 SysEx messages and status information).
22-
* Control buttons, rotary encoder etc. is _planned_.
23-
* A port of FluidSynth is _planned_.
24-
* Network MIDI and auto-update is _planned_.
45+
- Tested on Raspberry Pi 4 Model B and Raspberry Pi 3 Model B & B+.
46+
* Pi 2 works, but only with concessions on playback quality.
47+
* Pi 0 and 1 are unfortunately too slow, even with an overclock.
48+
- PWM headphone jack audio.
49+
* Quality is known to be poor (aliasing/distortion on quieter sounds).
50+
* It is not currently known whether this can be improved or not.
51+
- [I2S Hi-Fi DAC support](#-i2s-dac-support).
52+
* This is the recommended audio output method for the best quality audio.
53+
- [USB](#usb-midi-interfaces) or [GPIO](#gpio-midi-interface) MIDI interface.
54+
- [Config file](#-configuration-file) for selecting hardware options and fine tuning.
55+
- [LCD status screen support](#-lcd-and-oled-displays) (for MT-32 SysEx messages and status information).
56+
- Control buttons, rotary encoder etc. is _planned_.
57+
- A port of FluidSynth is _planned_.
58+
- Network MIDI and auto-update is _planned_.
2559

2660
## ✨ Quick-start guide
2761

28-
* Download the latest release from the [Releases] section.
29-
* Extract contents to a blank FAT32-formatted SD card.
30-
+ 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.
31-
* Add `MT32_CONTROL.ROM` and `MT32_PCM.ROM` to the root of the SD card - you have to provide these for copyright reasons.
32-
* 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.
33-
* Connect your vintage PC's MIDI OUT to the Pi's MIDI IN and (optionally) vice versa.
62+
- Download the latest release from the [Releases] section.
63+
- Extract contents to a blank FAT32-formatted SD card.
64+
* 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.
65+
- Add `MT32_CONTROL.ROM` and `MT32_PCM.ROM` to the root of the SD card - you have to provide these for copyright reasons.
66+
- 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.
67+
- Connect your vintage PC's MIDI OUT to the Pi's MIDI IN and (optionally) vice versa.
68+
69+
## 📝 Configuration file
70+
71+
`mt32-pi` tries to read a configuration file from the root of the SD card named `mt32-pi.cfg`. Please read the file for a description of all the available options.
72+
73+
> **Note:** Don't confuse this file with `config.txt` or `cmdline.txt` - they are for configuring the Raspberry Pi itself, and you should not need to alter these when using `mt32-pi`.
74+
75+
## 🎹 MIDI connectivity
76+
77+
The simplest way to get MIDI data into `mt32-pi` is with a [USB MIDI interface](#usb-midi-interfaces). More advanced users or electronics enthusiasts may wish to build a [GPIO MIDI interface](#gpio-midi-interface).
3478

35-
## 🎹 MIDI connection examples
79+
Here are some typical connection examples:
3680

3781
```
3882
[ Pi ] --> [ USB/GPIO MIDI ] <===> [ USB MIDI ] <-- [ Modern PC ]
@@ -41,19 +85,13 @@ Turn your Raspberry Pi into a dedicated emulation of the [famous multi-timbre so
4185
[ Pi ] --> [ USB/GPIO MIDI ] <===> [ Synthesizer keyboard or controller ]
4286
```
4387

44-
## 📝 Configuration file
45-
46-
`mt32-pi` tries to read a configuration file from the root of the SD card named `mt32-pi.cfg`. Please read the file for a description of all the available options.
47-
48-
> **Note:** Don't confuse this file with `config.txt` or `cmdline.txt` - they are for configuring the Raspberry Pi itself, and you should not need to alter these when using `mt32-pi`.
49-
50-
## 🎹 USB MIDI interfaces
88+
### USB MIDI interfaces
5189

5290
Any class-compliant USB MIDI interface should work fine - if the interface works on Windows or Linux PCs without requiring any drivers, there's a high chance it will work with `mt32-pi`.
5391

5492
> **Beware:** cheap no-name interfaces are not recommended; they have reliability issues not unique to this project [[1], [2]].
5593
56-
### Compatibility
94+
#### Compatibility
5795

5896
If you're shopping for a USB MIDI interface, the following devices have been confirmed as working properly by our testers. Feel free to contribute test results with your own MIDI interfaces and we can list known working ones!
5997

@@ -63,16 +101,16 @@ If you're shopping for a USB MIDI interface, the following devices have been con
63101
| M-Audio | [MIDISport 1x1](https://m-audio.com/products/view/midisport-1x1) | 1 in, 1 out; female DIN sockets. Tested by @nswaldman. |
64102
| Roland | [UM-ONE mk2](https://www.roland.com/global/products/um-one_mk2/) | 1 in, 1 out; male DIN plugs. Tested by @nswaldman. |
65103

66-
## 🎹 GPIO MIDI interface
104+
### GPIO MIDI interface
67105

68106
You can build a simple circuit based on an opto-isolator, a diode, and a few resistors. If `mt32-pi` does not detect any USB MIDI devices present on startup, it will expect to receive input on the UART RX pin (pin 10).
69107

70108
> **Tip:** You can disable detection of USB MIDI interfaces by setting `usb = off` in the config file. This can shave off a couple of seconds of boot time as USB initialization is then skipped on startup.
71109
72-
### Schematic
110+
#### Schematic
73111
![](docs/gpio_midi_schem.svg)
74112

75-
### Breadboard example
113+
#### Breadboard example
76114
![](docs/gpio_midi_bb.svg)
77115

78116
## 🔊 I2S DAC support
@@ -85,8 +123,8 @@ Luckily, a plethora of inexpensive DAC ([digital-to-analog converter]) hardware
85123
86124
### Setup
87125

88-
* `mt32-pi` defaults to PWM (headphone) output. Edit `mt32-pi.cfg` and change `output_device` to `i2s` to enable the I2S DAC driver.
89-
* If your DAC requires software configuration, you may need to edit the `i2c_dac_address` and `i2c_dac_init` options to suit your particular DAC. Continue reading for further details.
126+
- `mt32-pi` defaults to PWM (headphone) output. Edit `mt32-pi.cfg` and change `output_device` to `i2s` to enable the I2S DAC driver.
127+
- If your DAC requires software configuration, you may need to edit the `i2c_dac_address` and `i2c_dac_init` options to suit your particular DAC. Continue reading for further details.
90128

91129
### Compatibility
92130

@@ -114,12 +152,12 @@ The `i2c_dac_address` configuration file option determines what address on the I
114152

115153
If your DAC does not appear in the compatibility table above, you can help by carrying out the following:
116154

117-
* Connect the DAC to your Raspberry Pi.
118-
* Insert an SD card containing the latest version of Raspberry Pi OS (aka. Raspbian) and boot the Pi.
119-
* Run the command `sudo raspi-config`.
120-
* Select "Interfacing Options", followed by "I2C" and "Yes" to enable the I2C kernel modules.
121-
* Exit `raspi-config`, and run the command `sudo apt-get install i2c-tools` to install some I2C utilities.
122-
* Run the command `i2cdetect -y 1`. The output should be like the following:
155+
- Connect the DAC to your Raspberry Pi.
156+
- Insert an SD card containing the latest version of Raspberry Pi OS (aka. Raspbian) and boot the Pi.
157+
- Run the command `sudo raspi-config`.
158+
- Select "Interfacing Options", followed by "I2C" and "Yes" to enable the I2C kernel modules.
159+
- Exit `raspi-config`, and run the command `sudo apt-get install i2c-tools` to install some I2C utilities.
160+
- Run the command `i2cdetect -y 1`. The output should be like the following:
123161
```
124162
0 1 2 3 4 5 6 7 8 9 a b c d e f
125163
00: -- -- -- -- -- -- -- -- -- -- -- -- --
@@ -131,18 +169,22 @@ If your DAC does not appear in the compatibility table above, you can help by ca
131169
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
132170
70: -- -- -- -- -- -- -- --
133171
```
134-
* In this example, the address is **4d**. Make a note of this and set `i2c_dac_address` in `mt32-pi.cfg`.
135-
* If your DAC now works, open an issue to let us know, and we can add it to the table! Otherwise, open an issue anyway, and we can try to work out how to support it.
172+
- In this example, the address is **4d**. Make a note of this and set `i2c_dac_address` in `mt32-pi.cfg`.
173+
- If your DAC now works, open an issue to let us know, and we can add it to the table! Otherwise, open an issue anyway, and we can try to work out how to support it.
136174

137175
## 📺 LCD and OLED displays
138176

139177
`mt32-pi` supports various LCD and OLED displays, both traditional character displays like the original MT-32, and modern graphical displays.
140178

141179
The MT-32 had a single row, 20 column display, but these are hard to find nowadays. 20x2 and 20x4 displays are common however, and `mt32-pi` can use the extra rows to display additional information.
142180

143-
To enable a display, you will need to edit `mt32-pi.cfg` accordingly, and correctly connect your display to the Raspberry Pi. There are currently three different LCD drivers, which are detailed in the following sections.
181+
To enable a display, you will need to edit `mt32-pi.cfg` accordingly, and correctly connect your display to the Raspberry Pi.
182+
183+
### Drivers
184+
185+
There are currently three different LCD drivers, which are detailed in the following sections.
144186

145-
### Hitachi HD44780 compatible 4-bit driver (`hd44780_4bit`)
187+
#### Hitachi HD44780 compatible 4-bit driver (`hd44780_4bit`)
146188

147189
[<img width="280rem" align="right" src="docs/hd44780_20x4.jpg">](docs/hd44780_20x4.jpg)
148190

@@ -165,7 +207,7 @@ You will also need to connect a power source and ground to your display. Consult
165207

166208
> **Note:** The GPIO assignment could change in later versions as more functionality is added, so **BE WARNED** if you are thinking about designing hardware.
167209
168-
### Hitachi HD44780 compatible I2C driver (`hd44780_i2c`)
210+
#### Hitachi HD44780 compatible I2C driver (`hd44780_i2c`)
169211

170212
[<img width="280rem" align="right" src="docs/hd44780_20x2.jpg">](docs/hd44780_20x2.jpg)
171213

@@ -175,7 +217,7 @@ These displays are very convenient as they only need 4 wires to connect to the P
175217

176218
As with all I2C devices, you must know the LCD's I2C address in order for it to work. You should be able to find its address on the datasheet, or the "backpack" may have jumpers to configure the address. In case of doubt, you can connect the display and use Linux to discover your display using the [same procedure described in the DAC section](#-finding-the-i2c-address-of-your-DAC).
177219

178-
### SSD1306 I2C driver (`ssd1306_i2c`)
220+
#### SSD1306 I2C driver (`ssd1306_i2c`)
179221

180222
[<img width="280rem" align="right" src="docs/ssd1306_128x32.jpg">](docs/ssd1306_128x32.jpg)
181223

@@ -222,9 +264,9 @@ Please note that these commands are subject to change until the project reaches
222264

223265
## ❓ FAQ
224266

225-
* **Q:** Why do I only see a rainbow on my HDMI-connected monitor or television? Doesn't this normally mean the Pi has failed to boot?
267+
- **Q:** Why do I only see a rainbow on my HDMI-connected monitor or television? Doesn't this normally mean the Pi has failed to boot?
226268
**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.
227-
* **Q:** What happened to the old `mt32-pi` project that was based on a minimal Linux distro built with Buildroot?
269+
- **Q:** What happened to the old `mt32-pi` project that was based on a minimal Linux distro built with Buildroot?
228270
**A:** That's been archived in the [`old-buildroot`](https://github.com/dwhinham/mt32-pi/tree/old-buildroot) branch.
229271

230272
## ⚖️ Disclaimer
@@ -233,10 +275,10 @@ This project, just like [Munt], has no affiliation with Roland Corporation. Use
233275

234276
## 🙌 Acknowledgments
235277

236-
* Many thanks go out to @rc55 and @nswaldman for their encouragement and testing! ❤️
237-
* The [Munt] team for their incredible work reverse-engineering the Roland MT-32 and producing an excellent emulation and well-structured project.
238-
* The [Circle] and [circle-stdlib] projects for providing the best C++ baremetal framework for the Raspberry Pi.
239-
* The [inih] project for a nice, lightweight config file parser.
278+
- Many thanks go out to @rc55 and @nswaldman for their encouragement and testing! ❤️
279+
- The [Munt] team for their incredible work reverse-engineering the Roland MT-32 and producing an excellent emulation and well-structured project.
280+
- The [Circle] and [circle-stdlib] projects for providing the best C++ baremetal framework for the Raspberry Pi.
281+
- The [inih] project for a nice, lightweight config file parser.
240282

241283
[1]: http://www.arvydas.co.uk/2013/07/cheap-usb-midi-cable-some-self-assembly-may-be-required/
242284
[128x32 OLED]: https://www.aliexpress.com/item/32661842518.html?spm=a2g0s.9042311.0.0.27424c4dSo7J9L

0 commit comments

Comments
 (0)