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.

Up to 12 simultaneous voices are supported, though the exact limits depend on the sample rate, and the complexity of the effects applied.

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.

Video of a white hand pressing a button to briefly turn an LED strip into white lights. Also wired up to the microcontroller are a servo motor and a speaker.
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. By picking a feather and stacking on a FeatherWing you can create...
$19.95
In Stock
Enclosed Speaker with wires
Listen up! This single  2.8" x 1.2" speaker is the perfect addition to any audio project where you need 4 ohm impedance and 3W or less of power. We...
Out of Stock

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.

Angled shot of small square purple dev board.
What has your favorite Espressif WiFi microcontroller, comes with our favorite connector - the STEMMA QT, a chainable I2C port, and has...
$12.50
In Stock
Angled shot of small square audio breakout board.
Our QT Py boards are a great way to make very small microcontroller projects that pack a ton of power - and now we have a way for you to turn many QT Py boards into powerful audio play...
$5.95
In Stock

or

Adafruit I2S Amplifier BFF Add-On for QT Py and Xiao.
Our QT Py boards are a great way to make very small microcontroller projects that pack a ton of power - and now we have a way for you to add an I2S 3 Watt amplifier, for high quality...
$4.95
In Stock
Molex Pico Blade 2-pin Cable pigtail
When 0.1" is too big, and JST PH's too chunky, the ultra-slim "PicoBlade" is a reliable alternative. These are only 1.25mm pitch, but have a nice clicky...
$0.95
In Stock

Also:

Mini Oval Speaker with pico blade connector
Hear the good news! This wee speaker is a great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like...
Out of Stock
Short Male Header Kit for ItsyBitsy
These three Short Male Headers alone are, well, lonely. But pair them with our
$0.75
In Stock
Short Female Header Kit for ItsyBitsy
These three Short Female Headers alone are, well, lonely. But pair them with any of our 
$1.25
In Stock

This guide was first published on Sep 13, 2023. It was last updated on Jul 21, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.