You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+94-52Lines changed: 94 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -6,33 +6,77 @@
6
6
A work-in-progress baremetal Roland MT-32 emulator for the Raspberry Pi 3 or above, based on [Munt] and [Circle].
7
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!
8
8
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)
-[💬 Custom System Exclusive messages](#-custom-system-exclusive-messages)
37
+
-[❓ FAQ](#-faq)
38
+
-[⚖️ Disclaimer](#-disclaimer)
39
+
-[🙌 Acknowledgments](#-acknowledgments)
40
+
41
+
<!-- tocstop -->
42
+
9
43
## ✔️ Project status
10
44
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_.
25
59
26
60
## ✨ Quick-start guide
27
61
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).
34
78
35
-
## 🎹 MIDI connection examples
79
+
Here are some typical connection examples:
36
80
37
81
```
38
82
[ 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
41
85
[ Pi ] --> [ USB/GPIO MIDI ] <===> [ Synthesizer keyboard or controller ]
42
86
```
43
87
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
51
89
52
90
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`.
53
91
54
92
> **Beware:** cheap no-name interfaces are not recommended; they have reliability issues not unique to this project [[1], [2]].
55
93
56
-
### Compatibility
94
+
####Compatibility
57
95
58
96
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!
59
97
@@ -63,16 +101,16 @@ If you're shopping for a USB MIDI interface, the following devices have been con
63
101
| M-Audio |[MIDISport 1x1](https://m-audio.com/products/view/midisport-1x1)| 1 in, 1 out; female DIN sockets. Tested by @nswaldman. |
64
102
| Roland |[UM-ONE mk2](https://www.roland.com/global/products/um-one_mk2/)| 1 in, 1 out; male DIN plugs. Tested by @nswaldman. |
65
103
66
-
##🎹 GPIO MIDI interface
104
+
###GPIO MIDI interface
67
105
68
106
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).
69
107
70
108
> **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.
71
109
72
-
### Schematic
110
+
####Schematic
73
111

74
112
75
-
### Breadboard example
113
+
####Breadboard example
76
114

77
115
78
116
## 🔊 I2S DAC support
@@ -85,8 +123,8 @@ Luckily, a plethora of inexpensive DAC ([digital-to-analog converter]) hardware
85
123
86
124
### Setup
87
125
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.
90
128
91
129
### Compatibility
92
130
@@ -114,12 +152,12 @@ The `i2c_dac_address` configuration file option determines what address on the I
114
152
115
153
If your DAC does not appear in the compatibility table above, you can help by carrying out the following:
116
154
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:
123
161
```
124
162
0 1 2 3 4 5 6 7 8 9 a b c d e f
125
163
00: -- -- -- -- -- -- -- -- -- -- -- -- --
@@ -131,18 +169,22 @@ If your DAC does not appear in the compatibility table above, you can help by ca
* 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.
136
174
137
175
## 📺 LCD and OLED displays
138
176
139
177
`mt32-pi` supports various LCD and OLED displays, both traditional character displays like the original MT-32, and modern graphical displays.
140
178
141
179
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.
142
180
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.
@@ -165,7 +207,7 @@ You will also need to connect a power source and ground to your display. Consult
165
207
166
208
> **Note:** The GPIO assignment could change in later versions as more functionality is added, so **BE WARNED** if you are thinking about designing hardware.
@@ -175,7 +217,7 @@ These displays are very convenient as they only need 4 wires to connect to the P
175
217
176
218
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).
@@ -222,9 +264,9 @@ Please note that these commands are subject to change until the project reaches
222
264
223
265
## ❓ FAQ
224
266
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?
226
268
**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?
228
270
**A:** That's been archived in the [`old-buildroot`](https://github.com/dwhinham/mt32-pi/tree/old-buildroot) branch.
229
271
230
272
## ⚖️ Disclaimer
@@ -233,10 +275,10 @@ This project, just like [Munt], has no affiliation with Roland Corporation. Use
233
275
234
276
## 🙌 Acknowledgments
235
277
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.
0 commit comments