Back to Trending
RepositoryC++RURussia
copych

copych/ESP32_SF2_Sampler_Synthesizer

ESP32-S3 / ESP32-P4 SF2 based synthesizer. MIDI input, common CCs support. GM compatible. Effects chain.

56stars
7forks
3issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: sf2

#1 Repository of the week

1
TINIX TRENDING·Topic: soundfont

#1 Repository of the week

1
TINIX TRENDING·Topic: midi-device

#1 Repository of the week

The new features

  • Savvy samples loading: loads only the samples for the instruments requested by Program Change MIDI events
  • Loading meter: the gauge indicates SF2 loading progress, so you can be sure that it's working.
  • Custom partitions: the project now includes partitions.csv with the optimal layout for the common 16MB flash boards. If you don't have one, you'd better delete this file from your clonned project

ESP32 SoundFont (SF2) Sampler Synthesizer

An SF2 (SoundFont 2) based wavetable synth designed specifically for the ESP32-S3 / ESP32-P4 microcontrollers. This project leverages the enhanced memory capabilities of the PSRAM equipped MCUs to efficiently load and play SoundFont samples, providing a compact and powerful sampler solution. It's cheap and simple, yet powerful.


Overview

The ESP32 SF2 Sampler is a sampler firmware that runs on the ESP32S3 / ESP32P4 variants due to their improved PSRAM and memory management compared to the original ESP32. It supports external DACs like the PCM5102 for high-quality audio output and uses the built-in USB hardware of the MCUs to function as a USB MIDI device. By default, the BOOT button of the DevBoard is configured to cycle through SF2 files on the current filesystem. Long press on BOOT button will switch between Flash LittleFS and SD filesystems.


Features

  • SF2 playback: Load SoundFont2 banks of MORE than PSRAM size.
  • Filesystem: Runtime switch between LittleFS and SD_MMC (fast 4-bit bus supported).
  • USB MIDI: Plug-and-play MIDI device support.
  • Per-voice filters: Optional biquad LPF (configurable in config.h).
  • Per-channel filters: Optional CC#74/71-controlled LPF/resonance.
  • Effects: Reverb (CC#91), Chorus (CC#93), Delay (CC#95).
  • MIDI control: GM, partially GS/XG-compatible CCs, PC, RPNs, drums on ch.10, GM reset.
  • External DAC: Works with PCM5102 and similar I2S DACs.
  • ESP32-S3 / P4 optimized: Dual-core, PSRAM, minimal wiring.
  • Optional OLED GUI: Use a rotary encoder and a button to navigate.

Hardware Requirements

  • ESP32-S3 or ESP32-P4 microcontroller with PSRAM (OPI PSRAM recommended)
  • External DAC (e.g., PCM5102)
  • USB connection for MIDI and power

I2S DAC (PCM 5102) Pin Connections

SignalGPIO Pin
BCKGPIO5
DTAGPIO6
WCKGPIO7
CSGND

These pins can be changed in config.h if needed


SD CARD Pin Connections:

ESP32-S3: these pins can be changed in config.h if needed

SignalGPIO Pin
CMDGPIO38
CLKGPIO39
D0GPIO10
D1GPIO11
D2GPIO12
D3GPIO13
VCC3V3
GNDGND

ESP32-P4: fixed pins, external 10k pull-up resistors are required

SignalGPIO Pin
CMDGPIO44
CLKGPIO43
D0GPIO39
D1GPIO40
D2GPIO41
D3GPIO42
VCC3V3
GNDGND

Note that ESP32P4's SD_MMC SLOT0 uses predefined GPIOs and won't let you change them. If you realy want another set of pins, modify config.h and sdmmc.ino begin() to use SLOT1


GUI:

GUI requires U8g2 library.

SignalGPIO Pin
button14
encoder pin A15
encoder pin B16
display SDA8
display SCL9

These pins can be changed in config.h if needed


Software Setup

Arduino IDE Configuration

To build and upload this project using Arduino IDE, configure the following settings:


Usage

  1. Connect your MCU board with PSRAM and external DAC according to the pinout above.
  2. Load your preferred SF2 SoundFont files onto the device (refer to project documentation for details on loading SF2 files).
  3. Connect the ESP32 via USB to your computer or MIDI host.
  4. The device will enumerate as a USB MIDI device, allowing you to play samples via MIDI input.

Notes

  • This project is only compatible with the ESP32-S3 / ESP32-P4 due to memory and PSRAM requirements.
  • Using a core debug level above Info may interfere with USB MIDI functionality.
  • Ensure your external DAC is properly powered and connected for optimal audio quality.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue on the GitHub repository.


License

This project is licensed under the MIT License. See the LICENSE file for details.



Enjoy your ESP32-S3 powered sampler!

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
cifertech/ESP32-DIV

ESP32DIV is a multi-purpose wireless offensive and defensive toolkit powered by an ESP32

4.4k
Sep 22, 2026
RepositoryC++
vgmtrans/vgmtrans

VGMTrans - a tool to convert proprietary, sequenced videogame music to industry-standard formats

1.3k
Nov 29, 2026
RepositoryC++
copych/ESP32_SD_Sampler

ESP32-S3 / ESP32-P4 based sampler handles gigabytes of PCM WAV files, up to 19 stereo voices polyphony, CD quality

82
Oct 1, 2026
RepositoryHTML
surikov/webaudiofont

Use full GM set of musical instruments to play MIDI and single sounds or effects. Support for reverberation and equaliser. No plugins, no Flash. Pure HTML5 implementation compatible with desktop and mobile browser. See live examples.

990
Sep 4, 2026
RepositoryC++
espressif/arduino-esp32

Arduino core for the ESP32 family of SoCs

17.8k
Dec 1, 2026
RepositoryC++
MarlinFirmware/Marlin

Marlin is a firmware for RepRap 3D printers optimized for both 8 and 32 bit microcontrollers. Marlin supports all common platforms. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.

17.7k
Nov 30, 2026
RepositoryC++
justcallmekoko/ESP32Marauder

A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32

13.3k
Nov 21, 2026
RepositoryC++
FastLED/FastLED

The FastLED library for colored LED animation on Arduino. Please direct questions/requests for help to the FastLED Reddit community: http://fastled.io/r We'd like to use github "issues" just for tracking library bugs / enhancements.

7.5k
Dec 2, 2026
RepositoryC++
bblanchon/ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.

7.3k
Nov 19, 2026