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.  

0 thoughts on “Raspberry Pi Pico – DX7 clone

  • Interesting, I have DEXED running in WINE on a Mac which yields a GUI to program the synth. So, are you running saved presets somehow without the GUI?
    What about just running it on a raspberry pi zero 2?

    • Good questions. I have one of the ROMs hard coded into the port of DEXED. You might be aware that DEXED can accept an DX7 sysex voice dump so I could in theory upload sounds to it via MIDI sysex. The original motivation for the projects were 2 fold. 1) to do something with the Pico Pi that wasn’t already done by hundreds of other people. 2) to see if it was possible to construct a DX7 clone for under $10 USD. But ultimately since I could only get 2 voice polyphony I wasn’t able to achieve the second objective. You are right in that it would probably work on a raspberry pi zero 2 or even some other version of the raspberry pi series but from a tinker/hacker’s perspective, that would not be very fun – LOL 🙂 In the search for additionally polyphony, I ported DEXED to the ESP32 and the Teensy 4.0 microcontroller platform and will be writing up another blog post on that soon.

  • I wanted to try the same. Im a bit disappointed to find your project and see its already done. 😀 But I would really like to see the code. Did you publish it somewhere? Maybe I could help to improve the performance and get more polyphony out of it.

    • You shouldn’t be disappointed. In fact, I encourage you to build one yourself using a better DAC. I used a cheap DAC which was “good enough” for a proof of concept but it had some problems with the tuning as I had to manually tune it based on the overclocking. I couldn’t get dead on and it is slightly out of tune. I didn’t publish the source code as I feel it’s not worthy of publishing. I did get Dexed running on the Teensy 4.0 but it suffers from a lot digital glitch which I still need to debug. If I get the sound quality to a decent state, I’ll consider publishing the code. Thanks for the comment.

    • The ESP32 version never worked well… There was a problem where the Dexed code would hog the CPU causing the watchdog task in the realtime OS to crash.
      I could never figure out how to work around the realtime OS framework and just run it in the “baremetal”.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>