You can create your own polyphonic audio synthesizer on a microcontroller board using CircuitPython. The synthio
module makes it sound great and it's easy to use.
This guide covers the fundamentals of audio synthesis using synthio
, including practical examples. You'll be building your own small-but-powerful synths in no time.
synthio History
The synthio
library was originally created as single-voice, monophonic square wave player for MIDI files.
As of CircuitPython 8.1, synthio
received significant development effort from Jeff Epler to turn it into a 12-voice, polyphonic synthesizer that uses a wide variety of waveforms, while adding filters, envelopes, modulation control, and a ring-modulation effect.
Check out the full synthio
documentation here.
Hardware Requirements
While synthio
is built into CircuitPython, this doesn't mean that every CircuitPython-capable board can run synthio effectively. Some chips to use for the best results are:
- RP2040 -- e.g., Raspberry Pi Pico, QT Py RP2040
- EPS32-S2
- EPS32-S3
- iMX RT1011 -- e.g., Metro M7
- SAMD51 "M4" (N.B., a bit hard to find these days)
- nRF52 -- e.g., Feather nRF52840, CLUE
Your chosen board will also need to to support one of the three audio output methods:
-
audioio.AudioOut
-- output to a built-in Digital to Analog Converter (DAC) -
audiobusio.I2SOut
-- output to I2S DAC amplifier board -
audiopwmio.PWMAudioOut
-- output of pulse-width modulated square waves that will go through an external resistor-capacitor (RC) circuit to convert to audio
We'll cover these in more depth later in the guide.
Board Check
You can check to see which modules are supported on any given board by checking the CircuitPython.org download page for that board.
In this example, the Feather RP2040 has synthio
listed, as well as two different audio output modules that will work: audiobusio
and audiopwmio
.
Parts
You can run synthio
on a wide variety of boards, as noted above.
The simplest hardware to get up and running quickly is the PropMaker Feather RP2040, thanks to its on-board I2S amplifier and terminal blocks to screw in your speaker wires.
For the example videos in this guide we used the parts listed below. Note: any QT Py ESP32-S2, QT Py ESP32-S3, or QT Py RP2040 will work the same for the examples in this guide.
or
Also:
Text editor powered by tinymce.