ESP32 Synthesizer libray on the way…

ESP32 board with I2S DAC

I have been playing around with the ESP32 micro controller. Chances are that this will be my new favorite. Having plenty of horsepower and being cheap as dirt is just the beginning.  What really has gotten me going is the ability to do down-to-the-metal signal processing. With on board ADC and DAC, two 250MHz 32 bit CPU cores, floating point co-processor and (compared to other cheap controllers) tons of memory it is the perfect embedded DSP packet. I envision this controller a great future in areas such as audio processing applications, software defined radio and signal synthesis.

Just for kicks I started generating some arbitrary waveforms using the internal DAC and the awesome built in I2S DMA that automatically copies buffers of samples directly from memory to the e.g. the DAC(s) without even bothering the CPU(s). I quickly realized that writing a music synthesizer library would be pretty straight forward.

This is my first attempt at this.

Here is how i did:

I wrote some software synthesizers for the ESP32 in Arduino and used Ableton Live as a MIDI sequencer. To get the MIDI data from Live I used a Arduino UNO board with the ATMEGA328P processor removed. I re-programmed the ATMEGA16-U processor on the Arduino board (this is the little extra processor that is normally used as a USB to serial converter for the Arduino) with the HIDUINO firmware.  The arduino UNO board now acted as a class-compliant MIDI interface (that could be selected in Ableton Live) and could transmit MIDI data as 31250 BAUD serial data. This serial data could now be sent to one of the extra serial ports on the ESP32.

The Arduino program (on the ESP32) sent the audio directly to the DAC output pin of the ESP32 where it was output as an analog signal.

The synthesizer program internally calculates all sound using 32bit float point data but since the built in DAC of the ESP32 only operates in 8 bit the resulting sound is of a pretty crappy. I knew that if i could get a better DAC I could get a much nicer result. It turn out that the same data can be sent as I2S data to an external DAC so I went and got one of those as a small breakout board from Ebay.

This is the result using a I2S DAC.

Anyway, this is just a post to present some preliminary results the actual release of a full ESP32 synthesizer library will follow shortly as I get everything ready….

Leave a Reply

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