[Kevin] over at Simple DIY ElectroMusic Projects has released a complete DIY modular design for simulating the classic 80s Yamaha TX816 DX/FM modular digital synthesizer. This beast of a synth was used by the cool bands of the 80s as well as TV studios, and ownership of the original machine is an expensive investment. But with the power of modern hackable electronics, and the MiniDexed firmware running bare-metal on a Raspberry Pi getting access to a compatible synth doesn’t have to break the bank.
[Kevin] wanted to emulate the look and feel of the original TX816 aesthetic, developing a custom PCB handling the user interface for four of the eight channels, and a second acting as an interface to the Raspberry Pi using a Pico. Also sitting on this PCB is the GY-PCM5102 I2S DAC, and the MIDI connectors needed to connect to the system controller. Both PCBs, including a PCB-based front panel, were developed with KiCAD. The firmware for the Pico part of the system can be found on the firmware GitHub. The video demo (embedded below) shows off the system running a very 80s-sounding rendition of Holst’s famous ‘Jupiter’ from the planet series, and we all agree it sounds pretty sweet. For a complete rundown of the build, here are the links for the blog series for ease of access: Intro, PCBs, Panel, Build Guide, Mechanical, Pico/TX816 IO code, and finally usage. Phew! Uv Small Printers
If MiniDexed sounds familiar, that is because we featured another of [Kevin’s] earlier MiniDexed projects a little while ago.
In high shcool we used to have similiar setup for controlling our little weed operation, temperature, water etc.
Just when I thought we were free of FM synthesis…
But really, I’m intrigued by developing software for the RPi (or any Cortex-A) without an OS. I rather like using microcontrollers, but the difference between kilobytes and gigabytes is .. significant.
MiniDexed uses the Circle environment from the excellent Rene Stange: https://github.com/rsta2/circle
It’s not too difficult to get up and running. I detailed my own “first attempts” here if you wanted some pointers: https://diyelectromusic.wordpress.com/2021/10/08/bare-metal-raspberry-pi-synth/
The PCM5102 is an I2S DAC. I2S is diferent from I2C, with I2C not having the bandwidth for audio.
How is the tone generation done? I looked at the project and all about the UI. There’s a I2S DAC so I’m assuming this is playing samples of the real Yamaha? There’s enought computing power to make and add some sine+cos waves…
It is all synthesized using the same synth engine code used by the Dexed VST/app itself. MiniDexed uses Synth_Dexed which is a microcontroller port of Dexed, based originally I think on an Android synthesis library, but generally designed for use with a Teensy.
https://codeberg.org/dcoredump/Synth_Dexed
It’ll be using FM synthesis. Why does an I2S DAC imply samples?
The tone generation is done on the RPi 4. FM synthesis is a pretty basic mathematical operation these days, so producing eight instances of seven operator synthesis in real time is well within its capacity. You then just send the resulting waveforms to the DAC to produce the audio.
Dexed is a software implementation of the DX7 FM synthesizer, and MiniDexed makes use of Synth_Dexed which is an embeddable fork of that. There’s no samples involved as far as I’m aware.
Does RPI DX7 do actual FM synthesis? The DX7 did 6 OP FM with 32 different algorithms. Each OP requires multple table lookups and multiplies. Each systhesized voice or note requires 6 times this computation. The DX7 or DX7II could play 16 notes (using the same sound algorithm or polyphony) simultaneously. (This is how a chord is played.) All of this computation creates a single audio sample. CD sound quality requires 44,100 samples per second. This is a LOT of real time computation for a RPI.
Raspberry Pis are faster than you think and from a cursory glance of the code, it looks like synth_dexed (the underlying synthesis engine) starts out by computing a bunch of fairly small lookup tables to make the heavyweight functions a lot faster. Most of what the Pi has to do is multiplication and addition from small LUTs, and that’s what ARM is pretty good at.
It helps that in MiniDexed there’s no OS running, it’s just the synth engine running directly on the CPU with no task switching overhead.
Remember that the Pi 4 runs at 1.5GHz, so each 16-bit audio sample has around 34 cycles to work with – not incredibly luxurious, but plenty fast for the kinds of operations that need to happen. Also I suspect that with DX7-style FM you can get away with a much lower sampling rate.
Er, I had a major brainfart and was off by a few orders of magnitude in my computation.It has 34*000* cycles per sample. That’s plenty. :P
Don’t forget the DX7 was an early 80’s electronic, and you are overstating its complexity. The chips have been decapped and fully reverse engineered. For instance each operator basically amounts to a lookup table which is just a quarter of a sine wave. And the 32 algorithms are just different orders and combinations of routing the operators together, not 32 different discrete compute units. There’s also no analog filtering that needs audio DSP to replicate. It’s maybe a dozen multiplies per sample. It’s not really a lot of computation at all.
You can read the code for it here. https://codeberg.org/dcoredump/MicroDexed You can see even that there’s more code for MIDI handling and external effects (reverb, etc) than for the FM emulation itself. The code was made for a teensy, so it’s no sweat for a whole RPi.
I2S DAC, not I2C.
Yes, a slip of the old fingers. Corrected, thanks.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Lenticular Printer By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more