ESP32-S3 Synthesizer Project with AI-Assisted Code (Studio AI)
This post provides an overview of a synthesizer project based on the ESP32-S3 microcontroller. A notable aspect of its development was the use of Google Studio AI for generating a significant portion of the code.
Key Synthesizer Features:
The current iteration of the synthesizer includes the following core features:
- Played via MIDI input with 5pin DIN Midi Connector (standard MIDI messages).
- Audio Output: Sound is output through an external PCM5102 I2S DAC for improved audio quality.
- Display: An OLED (0,96) screen shows key parameters like active waveform, envelope settings, arpeggiator status, etc
- Waveform Generation: Supports basic waveforms (e.g., square, sawtooth, sine). Specifics will be detailed with the code.
- Monophonic Operation: The synthesizer is currently monophonic, producing one note at a time.
- Envelope Control: Includes basic envelope parameters (e.g., Attack, Decay) to shape the sound.
- Pitch Control: Standard control over the fundamental frequency of the generated sound.
- Arpeggiator: Features a built-in arpeggiator. When multiple notes are held via MIDI, the arpeggiator cycles through them sequentially based on selected patterns (e.g., Up, Down, Up/Down, Random) and speed.
- VCF Basic Filter: A simple low-pass filter is implemented.
Important Note on Code Structure:
I must offer an apology regarding the structure of the provided source code: it is not highly modular.
This is largely a consequence of the development process relying on Studio AI. While the AI proved capable of generating functional code blocks, achieving a clean, well-structured, and modular architecture for the entire project was challenging with this approach. AI-generated code, in this instance, tended towards a more monolithic solution without extensive manual refactoring for modularity.
This is acknowledged as a limitation of the current codebase and an area for potential future refinement. It was a trade-off in exploring the capabilities of AI for this type of embedded project.
Project Files & Resources:
The complete source code, any schematics, and sound examples for this project are hosted on GitHub. You can find everything here: esp32_audio