Raspberry Pi Pico – DX7 clone

Building the MIDI sequencer with the Raspberry Pi Pico was a great learning experience and a chance to learn the details and features of the Pico microcontroller. 

I thought it would really cool to combine the sequencer with a sound source other than my Reface DX or other MIDI synths, so I embarked on building a Pico based synthesizer.   After searching for different ideas, I found a few open source software emulations of the fabled DX7.  One in particular that caught my eye was a program called DEXED.  It is open source and written in C/C++ which made it an attractive candidate to attempt a port to the Pico.  I had no idea if the Pico would be fast enough to run the software but decided build a prototype and give it a try.

So with a minimal number of parts, the Pico Pi, a 12 bit DAC, a MIDI in circuit, a 2-digit 7segment LED and BCD driver, a active low pass filter, I built the circuit and proceeded to port DEXED to the Pico.  The point of this project was to see if Pico could run DEXED.  I wasn’t too worried about sound quality as long as it was “good enough”.   

Well, to my surprise, I was able to get it to work.  In fact, I ported the original DX7 ROM into the code and am able to confirm that it indeed sounds like the original DX7!   I guess it would be more accurate to call what I created a TF1 clone (one of the modules in the TX816), since the DX7 has a keyboard, touch panel, etc and the TX7 also has and LCD screen with some buttons.  The 7segment LED and BCD driver isn’t necessary to make the prototype function correctly but it made it easier to figure out which patch was selected.

However, the prototype isn’t without problems.  First, it’s really noisy.  It has a low pass filter, but it has a lot of noise and hum.  This has a lot to do with the cheap DAC I chose as well as the fact I used the same power source for both digital and analog power references!  Of course, this can be remedied with a better design and additional parts but my goal was just to see if the Pico could run a port of DEXED.  I figure I can work on cleaning up the audio quality later once I proved that microcontroller could run DEXED.  

But the other limitation and probably the biggest problem with the prototype is that the Pico can only handle 2 voice polyphony and that’s after overclocking the Pico to 290Mhz.    I have a few ideas on how to fix this.

– Optimize DEXED.   I admit I don’t understand the code well enough to try and make it run more efficiently.   It might work great on a modern core i7 but the ARM core M0 processor in the Pico even overclocked at 290Mhz cannot cope.  But DEXED looks like it already has a lot of optimizations by using trigonometric lookup tables but it does have some 64-bit math and a logarithmic math.  However, I am doubtful optimizing those bits would amount to a significant amount of additional polyphony.  

– Try to use the second core of the Pico.  Since the Pico is a dual core processor, it might be possible to double the polyphony by leveraging the second core on the device.  But even so, that would still only amount to 4 voice polyphony.  I know that writing low level multi-core code can be tricky so this might be a lot of effort for not a lot of gain. 

– Try a different microcontroller with more horsepower.   I’ve been looking into the ESP32 whose specs look like it might be sufficient to run DEXED and get 8 voice polyphony or even more.  

Building a Hardware MIDI Sequencer – Update

Raspberry Pico Pi Hardware Sequencer with custom IO board

The IO board is using a MCP23017 16 bit port expander to control a matrix of pushbuttons and LEDS.  The Raspberry Pi Pico has enough GPIO pins to handle a small keypad like this but I wanted to try out the MCP23017 to see what kind of performance I can get out of a I2C interface.   The Yamaha Reface DX is connected via MIDI and as you can see in the video, I can load a midi file from the SD card and play it back on the Reface.  

Now that the initial H/W prototype is complete, most of the remaining effort will be firmware development.

Building a hardware MIDI sequencer

I started to build a hardware MIDI sequencer! Yes you read that correctly, a hardware MIDI sequencer!
You might say, but that is so 1980s!

Why?
Why not use a DAW?
Why not buy a used hardware sequencer from the 80s/90s?
Why not buy the Teenage Engineering OP1 or modern sequencer like the OXI ONE or Synthstrom Deluge or any one of the loop based MPC like pads!
All great questions.

First, I do use a DAW; I use Cubase. But using a mouse on a sequencer is much different than manipulating buttons on a hardware device. I play well enough to record tracks in real-time. I don’t really need the ability manipulate midi data at the microscopic level that a DAW gives you. And the times I do, using a rotary dial and buttons on a hardware sequencer is so much faster and easier than manipulating a mouse and keyboard on those midi event editor tracks.

I could buy a used a sequencer from the 80s. It would be really cool to own a Yamaha QX1 or Roland MC500 as I always dreamed of owning one of those. But there are a few downsides. They’re big and bulky. They can’t run on batteries. And they’re floppy based. I have no idea where to even buy floppies these days.

Okay, so older sequencers are not ideal, but what about some of the newer sequencers? Well, my understanding is that those new sequencers are loop based like Ableton. Honestly, I don’t know how they work. I understand it’s supposed to be really good for live playback. Maybe I’ll check them out someday but for now, I like the linear pattern/track based recording process. Also, I don’t feel like spending $1000+ for a device like the OP1 or Deluge; but they admittedly do look like a lot of fun to play with.

Finally, I really like building these kind of gadgets.

I’ve built some Arduino based audio and MIDI projects in the past but the Arduino products don’t have enough SRAM to be a serious sequencer, adding RAM to an Arduino would just eat up all of the IO pins and the Arduino boards are quite expensive for what they are, a small microcontroller on a nice PCB. So when I saw the Raspberry Pico Pi for only $4 and it’s spec, I had to give it a try. I build the obligatory LED blink and got familiar with the product. It has a C and Circuit Python library API. I developed a MIDI IN/OUT interface, bought a micro SD card interface, added some switches and LEDs for I/O and tried to play back a MIDI file from a micro SD card. But wait, there is no SD card C library for the Pico! What??! There is a circuit python library but since I am not a python guy, I ported the Arduino SD card library for the Pico. Now I can playback a MIDI file off of a micro SD card and play it from the Pico.

Off to a good start. Check back for updates on the progress.