MT32-Pi on my EuroRack MiniDexed PCB

This is great. I was asked by Michel (mragutlich) if I knew how to build MT32-Pi to configure it for my MiniDexed EuroRack PCB but I don’t and there isn’t a lot of information apparently on how to build it from source.

So I offered my Rebuilding my Ability to Build MiniDexed post which talks about getting to the point of being able to build MiniDexed and as both synths run on circle, figured that would be a pretty good starting point.

And then Michel came back to me with a complete set of instructions for Ubuntu and I’ve just run through them – and they work great.

So massive thanks to Michel, this is how you could get MT32-Pi running on my MiniDexed EuroRack PCB.

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

Previous posts on MT32-Pi:

If you are new to microcontrollers and single board computers, see the Getting Started pages.

Parts list

  • Raspberry Pi Zero 2.
  • Micro SD card.
  • MiniDexed EuroRack PCB and panel.
  • Power, leads, additional connectors and so on.

Building MT32-Pi on Ubuntu

Here are Michel’s instructions that worked for me.

Setup a Ubuntu 20.4 LTS system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get install gcc-arm-none-eabi
sudo apt-get install git
sudo apt-get install curl
sudo apt-get install dialog
sudo apt-get install cmake
sudo apt-get install pkg-config
sudo apt-get install glib-2.0 Now clone the mt32-pi github repo

git clone –recursive https://github.com/dwhinham/mt32-pi.git

cd mt32-pi

nano src/control/simpleencoder.cpp In nano change the following lines

constexpr u8 GPIOPinButton1 = 5;
constexpr u8 GPIOPinButton2 = 6;

constexpr u8 GPIOPinEncoderButton = 11;
constexpr u8 GPIOPinEncoderCLK = 10;
constexpr u8 GPIOPinEncoderDAT = 9;

ctrl-X and say ‘Y’

make all

If everything goes well you will have a kernel8.img file in your directory.

Now hook up a microSD cardreader to your Linux environment and insert a blank microSD card

Goto the ~/scripts dir and start mt32pi_installer.sh , this will install all the needed bare metal files

sudo ./mt32pi_installer.sh

When ready copy the kernel8.img file to the SD card

Change in the mt32-pi.cfg file the line ‘encoder_reversed = off’ to 'on', now the volume knob will increase when turned clockwise

Copy the MT32 roms to to the rom dir

Copy some Sf2 soundfont files tot the soundfont dir

Thats it…unmount the sd card , put it in your Zero 2 W…and boot it.. the MT32pi logo should appear on the oled screen and the buttons and rotary encoder should work properly

The first button switches between m32 and soundfont mode.

The second button will switch to the next rom or soundfont file

The rotary encoder will change the master volume.

The encoder switch only displays a message that the button is pressed

There were a couple of tweaks I needed. First of, the mt32_inistaller.sh script has to be run as root. This will go through and ask you to choose the SD card to format and install and so on.

At some point you will need some MT32 ROMs. There are details of how to do that on the original MT32-Pi project here: https://github.com/dwhinham/mt32-pi?tab=readme-ov-file#-quick-start-guide

In addition to the aforementioned “encoder_reversed” setting in the mt32-pi.cfg file there are a couple of other options I find used (many of these were already set up by the installer):

[system]
default_synth = mt32 or soundfount


output_device = i2s

[control]
scheme = simple_encoder
encoder_reversed = on
mister = off

[mt32emu]
midi_channels = alternate

[lcd]
type = ssd1306_i2c
width = 128
height = 32
i2c_lcd_address = 3c

I think those were the major changes.

I installed a single “new” ROM and a PCM ROM. The default soundfont is already installed. And that was essentially that.

The first time I tried it, I’d forgotten to copy over the kernel8.img file, so that took a moment to figure out! But apart from that it was all pretty straight forward for me. Many of the packages to install at the start were already there and up to date, so that didn’t take too long and the build itself was again fairly straight forward.

Closing Thoughts

A big thanks to Michel for asking the question, then figuring out the answer, and most importantly sending me the instructions and permission to post them here.

This is a great additional option for my PCB 🙂

The video shows the MT32-Pi in Soundfont mode playing a MIDI file of Khachaturian’s Masquerade Waltz.

It is great to have a full General MIDI Soundfont device in EuroRack format.

Kevin

4 thoughts on “MT32-Pi on my EuroRack MiniDexed PCB

    1. Thanks to Sterr1 the serial midi is now working !!

      I more or less finished the Eurorack miniJV880

      I placed a cooling block in between the PCB and the Zero 2 W

      Now looking into optimising the assignments of the buttons so you can get as many functions out of 2 buttons and a clickable rotary encoder.

      https://github.com/Sterr1/Mini-JV880pi/releases
      https://github.com/giulioz/mini-jv880/issues/2

      P.s. make sure you walk through the ini file to set the right pins and dimensions for the buttons and the OLED

      Liked by 1 person

  1. Hello, Kevin. I’m trying to modify my old MIDI controller (Behringer UMX490) mounting inside it a Rasbperry to build a standalone synth. I’ve tried to build MT32-Pi because it includes MT32 emulation, but also Fluidsynth, and I would like to modify it to use a better LCD display, perhaps with a prettier interface (nowadays you can find cheap spi color displays) ; sadly, Dave Whinham has abandoned the project. I tried to follow your instructions, but there’s a couple of things that don’t work:

    “git clone –recursive …..” should be “git clone –recursive….”

    When building with “make all”, it exits with “Error: Invalid toolchain prefix, exiting; TOOLPREFIX is “aarch64-none-elf-“. “

    This is because in config.mk, the line “BOARD?=pi3-64” makes the PREFIX var to be set to “aarch64-none-elf-” (64 bit), and we have installed gcc-arm-none-eabi (32 bit). If I change it to “BOARD?=pi3”, it compiles and creates the image file without errors.

    I have written the image to an SD card with the included script, but I’ve not tried to boot the Pi with it yet, i’ll try tomorrow if I can.

    Thanks for the guide and excuse my english, it’s not my first nor my second language.

    Liked by 1 person

Leave a comment