The ESP32Synth library turns the ESP32 into a real-time audio synthesizer with 80 voices by default and a public demo that reaches as high as 350 voices before the hardware runs out of headroom.

Danilo Gabriel’s project runs on ESP-IDF, outputs audio over I2S, and can work with a cheap external DAC such as the UDA1334A or PCM5102. If you want to lean on the built-in DAC instead, that is also on the table, though external audio hardware is the less painful option. Modern microcontrollers keep absorbing tasks that once needed a dedicated board, and this is a neat example of that drift.

What ESP32Synth can play

The library is not limited to one basic tone generator. It can stream multiple WAV files from an SD card for samples, alongside sine, triangle, sawtooth, and pulse oscillators, plus noise, wavetables, and other sound sources. That mix is enough to build a surprisingly capable instrument rather than a one-note beep machine.

  • 80 voices by default
  • Up to 350 voices demonstrated before the chip runs out of headroom
  • I2S audio output with optional external DAC support
  • Sample playback from SD card

How the code stays real-time

The trick is ruthless pruning. Slow floating-point operations and division were removed from the audio path so the MCU can keep up with real-time rendering, and the audio task is pinned to one core while the other is left for application code. That split is smart enough to be boring, which is exactly what you want from timing-sensitive audio software.

The project is shipped as an Arduino-style codebase, but it is built on ESP-IDF, so ESP-IDF users should be able to adapt it without a heroic rewrite. That flexibility is useful because the best embedded projects rarely stay neatly inside one ecosystem for long.

What this means for ESP32 audio projects

For builders, the attraction is obvious: you can get a multi-voice synth running on inexpensive hardware that is already easy to source. The catch is also obvious: once you start stacking voices, samples, and effects, the chip’s limits arrive fast, and the demo’s 350-voice ceiling is a reminder that physics still gets a vote.

Even so, this is the sort of library that tends to spawn better things than its original author probably planned. Expect hobby synths, sound generators, and odd little music boxes to show up, and expect a few of them to be far more ambitious than a microcontroller has any right to be.

Leave a comment

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