Yamaha DX7 Clone on Teensy 4.0

More Polyphony, slightly better sound.

 

I ported DEXED to both the ESP32 processor and TEENSY4.0 MCU + Audio Shield. Pictured is the Teensy4.0 + audio shield and a 128×32 OLED display to display the patch name.

With the Teensy4.0 I have been able to confirm at least 10 voice polyphony! However, there is a slight “glitchiness” to the sound which is more pronounced depending on the patch.  You can really hear it in the YouTube video, especially the E.Organ1 patch! I think it is mostly software based because it is virtually non-existent on some of the other patches.  

 

What about the ESP32?

I couldn’t get the ESP32 board to quite work but the problems can be overcome.  One issue is that the ESP32 software development environment is built around a RTOS. It does not appear that one can develop an application in a “bare metal” or near “bare metal” mode like the Raspberry Pi Pico. As a side note, the Raspberry Pi Pico supports both a “bare metal” environment as well as a Arduino centric library.  The ESP32 RTOS assumes your process will yield to a watchdog process and this yielding and task switching will take approximately 10 milliseconds. Well, 10 milliseconds in real-time audio is forever and causes big glitches in the sound generation. I was able to get around that by using a suggestion in some forums to set the task priority to the taskIDLE priority

xTaskCreate(someFunction, “HumanReadableNameofTask”, 4096, NULL, tskIDLE_PRIORITY, NULL)

 

The ESP32 restriction of working in the confines of an RTOS was an unexpected hurdle in porting DEXED.  But ultimately I couldn’t get DEXED to run on the ESP32 because the DAC I have doesn’t work well with the DMA of the ESP32. I’ll have to look into a different DAC to fix that.  That will be a separate project.  

As an aside,  the Teensy audio library only works in the Arduino environment.  The Pi Pico can work either in a “bare metal” environment mode or Arduino environment. The ESP32 only works within its RTOS environment.

 

Cost

When I first worked on getting DEXED to run on the Pico Pi, my objective was to try and get a really cheap DX7 clone running.  Since the Pico Pi is only a $5 MCU, just adding a cheap DAC seemed like I could get a DX7 clone for under $10.  But I could ultimately on get 2 voice polyphony out of it.  I pursued the ESP32 MCU as it is only about a $8 MCU but, as I mentioned, I couldn’t quite get it to work.  Which brings me to the TEENSY4.0 board.  This board list for $20 USD but since I don’t live in the US, it ends up costing me more around $25 locally.  But for that amount of money, getting 10 voice polyphony out of the Teensy makes sense. The processor is board is 5 times cost of the Pico Pi which could only generate 2 voice polyphony so getting 5x polyphony would be expected to make sense from a cost perspective.  The Teensy audio daughter board lists for about $14 and is more expensive than my home brew DAC I built for the Pico Pi but given that it just “worked out of the box” and I didn’t have to fiddle with any clocks or software to get the precise sampling rates was well worth the cost.  The Pico Pi prototype had some noise issues and given that I am convinced that the noise issues on the Teensy are likely all software based, I think it’s well worth the cost. 

But given the cost of the Teensy and daughter board, it might make more sense to just run DEXED on a raspberry pi. But then there is no fun in that as it would just likely work. There would be no porting work involved and that’s a lot of the fun! 

0 thoughts on “Yamaha DX7 Clone on Teensy 4.0

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>