Skip to content

Latest commit

Β 

History

96 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯ PROJECT PHOENIX SOUND SAMPLER

ESP32-S3 Polyphonic Hardware Sampler

4 Sample Slots Β· 12 Voices Β· Multisampling Β· Realtime Sequencer Β· Sample Editor Β· Stereo Reverb Β· MIDI Β· USB Β· Phoenix Librarian

Version 1.1.0 FINAL

ESP32-S3 Arduino Audio Release

RealTimeAudioLab / RTAL


Phoenix is a standalone ESP32-S3 hardware sampler designed as an instrument β€” not just a sample player.
Record, import, sculpt, loop, map, sequence and perform samples directly on the hardware, then manage complete banks comfortably on Windows with Phoenix Librarian.


🎬 Phoenix in action


πŸ“Έ Hero Image and 🎡 Hardware Demo β€” 120 BPM Electronic Track

Eight samples Β· four sequencer tracks Β· 12-voice engine Β· no DAW

RTAL_PHOENIX_SOUND_SAMPLER_SOUNDDEMO.mp4

RTAL PHOENIX SOUND SAMPLER in his 3D printed case.


πŸ“Έ Current Development Prototype

The current ESP32-S3 based hardware platform used for firmware, DSP and hardware development.


πŸ“Έ Draw Waveform

Phoenix waveform editing demonstration


πŸ“Έ Sample Editor

Phoenix sample editor demonstration


What is Phoenix?

Project Phoenix is a complete sample-based musical instrument built around the ESP32-S3.

The sampler combines four directly accessible sample slots with a global 12-voice polyphonic playback engine, onboard recording, waveform editing, loop processing, multisamples, keyzones, MIDI, effects, a four-track pattern sequencer, song chaining, SD-card storage and USB mass-storage access.

Phoenix v1.1.0 FINAL is the current frozen stable release of the platform. It builds on the proven v1.0.x architecture and adds stereo Reverb, BANK16 persistence, a robust SD A/B session journal and further realtime performance optimization.

At a glance

Feature Phoenix v1.1.0
MCU ESP32-S3 @ 240 MHz with PSRAM
Polyphony 12 global sample voices
Audio engine 32 kHz, 128-frame blocks
Basic sample slots 4
ADC PCM1808
DAC PCM5102A
Sample import WAV β†’ Phoenix 32 kHz mono format
Sampling Direct recording from ADC
Loop modes OFF / FORWARD / ALTERNATE
Multisampling Keygroups, velocity layers, round robin
Performance modes KEYZONE / MULTI
Sequencer 4 patterns Γ— 4 tracks Γ— up to 16 steps
MIDI clock Internal / External, 24 PPQN
MIDI transport FA Start / FC Stop, continuous F8 supported
Storage SD card + USB Mass Storage
PC companion Phoenix Librarian v1.0.0
Stereo Reverb 4 combs + 2 allpass stages per side
Session persistence SD A/B journal with CRC32
Bank format 16

Highlights

πŸŽ™ Sampling and waveform editing

Phoenix can record directly from the PCM1808 ADC and play back through a PCM5102A DAC.

Each sample can be edited directly on the hardware:

  • Sample Start
  • Loop Start
  • Loop End
  • Sample End
  • Normalize
  • DC correction
  • Root note
  • Pitch tracking
  • ADSR
  • Loop mode
  • Loop crossfade
  • Level and panorama

The four marker positions follow a clear playback model:

S.START ---- L.START ================= L.END ---- S.END
               <---- LOOP AREA ---->

FORWARD loops restart at L.START.
ALTERNATE loops run as bidirectional ping-pong loops.


🎹 12-voice polyphonic sample engine

Phoenix uses one global voice pool for all sample slots and multisample regions.

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
MIDI / Sequencer ──►│  12-Voice Allocator β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β–Ό                β–Ό                β–Ό
       Sample Voices      Multisamples      Keyzones
             β”‚                β”‚                β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                              β–Ό
                       Filter / FX / Mix
                              β”‚
                              β–Ό
                          PCM5102A

The v1.1 voice engine retains ownership protection, sustain handling, duplicate-note handling and guarded voice stealing.


🧩 Multisampling

Phoenix is not limited to four static WAV files.

The multisample system supports:

  • multiple keygroups
  • keyboard ranges
  • velocity layers
  • round robin
  • root-note mapping
  • one-shot regions
  • forward loops
  • alternate loops
  • per-region sample assignment

This makes Phoenix suitable for much more than drums: pianos, strings, pads, percussion sets, sound effects and experimental sample instruments can all be built from the same engine.


🎚 Quattro: KEYZONE and MULTI

The four primary sample slots can operate as a single performance setup.

KEYZONE

Split the keyboard into zones and assign different samples to different ranges.

C1                C3                C5                C7
β”‚------ SLOT 1 -----β”‚
          β”‚------ SLOT 2 ------β”‚
                    β”‚------ SLOT 3 ------β”‚
                              β”‚------ SLOT 4 ------β”‚

MULTI

Several slots can respond simultaneously, each with its own level, panorama, range and processing.

This allows layered instruments, stacked textures and complex live setups.


⚑ Realtime sequencer

One of the central architectural features of Phoenix v1.1.0 is the dedicated realtime sequencer path.

The final engine no longer lets display, SD-card or normal UI work determine musical timing.

CORE 0
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ MIDI Task      P10 β”‚
β”‚ F8 / FA / FC       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚ timestamped clock
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SeqRT Task      P8 β”‚
β”‚ 24 PPQN            β”‚
β”‚ step scheduling    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚ scheduled events
══════════β•ͺ════════════════════════════════════
          β–Ό
CORE 1
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Audio Task      P24β”‚
β”‚ 128-frame blocks   β”‚
β”‚ intra-block events β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β–Ό
        AUDIO

External MIDI clock is designed for systems where F8 continues permanently and transport is controlled separately by FA Start and FC Stop.

Six MIDI clock ticks correspond to one 16th-note sequencer step.

The v1.1.0 validation baseline demonstrated scheduled event placement inside the 128-frame audio block while keeping realtime audio overruns, underruns, MIDI drops, sequencer drops and scheduling misses at zero during the validated stress tests.


πŸ₯ Pattern Sequencer

Phoenix includes a four-track hardware step sequencer:

  • 4 patterns
  • 4 tracks per pattern
  • 1–16 steps per track
  • note
  • velocity
  • gate length
  • individual track lengths
  • internal or external clock
  • pattern management
  • song chaining

A step contains:

ACTIVE | NOTE | VELOCITY | GATE

Different track lengths can be used to create polymetric patterns.


πŸŽ› Sound processing

Phoenix v1.1.0 contains a lightweight realtime processing chain designed specifically for the ESP32-S3 audio budget.

Filter

Sample playback can be shaped using the onboard filter section with realtime cutoff and modulation control.

Echo

The delay engine includes smoothed parameter handling and click-reduced delay-time transitions.

The complete Echo ring remains in PSRAM. During v1.1.0 development, moving the full 128 kB Echo buffer into internal SRAM was tested and rejected because it did not provide a useful performance benefit relative to the internal-memory cost.

Stereo Reverb

Phoenix v1.1.0 adds a compact integer stereo Schroeder/Moorer Reverb designed for the ESP32-S3 realtime budget.

The Reverb provides:

  • four damped feedback comb filters
  • two decorrelating allpass stages per side
  • SIZE
  • DECAY
  • DAMP
  • MIX
  • independent Reverb send for sample slots S1–S4
  • BANK16 persistence

A block-rate Reverb FAST-CACHE precomputes invariant delay lengths, feedback coefficients and damping values once per 128-frame block instead of rebuilding them for every sample.

The complete Reverb delay memory is only 13,860 bytes and is allocated in internal SRAM with a safe fallback path. This reduced the observed high-load latency compared with the previous PSRAM placement.

Vintage Sampler

Phoenix can deliberately move away from clean modern playback through its Vintage Sampler section, including reduced-rate / reduced-resolution style processing and character parameters.


πŸ’Ύ Banks and SD storage

Phoenix stores instruments as banks on the SD card.

Typical structure:

/PHOENIX
β”‚
β”œβ”€β”€ CONFIG.TXT
β”œβ”€β”€ SESSION_A.BIN
β”œβ”€β”€ SESSION_B.BIN
β”œβ”€β”€ LASTBANK.CFG
β”œβ”€β”€ INIT_SOUND.CFG        (optional NEW BANK template)
β”œβ”€β”€ WAV/
β”œβ”€β”€ EXPORT/
β”‚
└── BANKS/
    β”œβ”€β”€ BANK01/
    β”‚   β”œβ”€β”€ BANK.CFG
    β”‚   β”œβ”€β”€ BANK.INFO
    β”‚   β”œβ”€β”€ SLOT1.WAV
    β”‚   β”œβ”€β”€ SLOT2.WAV
    β”‚   β”œβ”€β”€ SLOT3.WAV
    β”‚   β”œβ”€β”€ SLOT4.WAV
    β”‚   β”œβ”€β”€ MULTISAMPLE.CFG
    β”‚   β”œβ”€β”€ PATTERNS.CFG
    β”‚   └── SONG.CFG
    β”‚
    β”œβ”€β”€ BANK02/
    └── ...

Current formats:

BANK_VERSION        16
MULTISAMPLE_VERSION 10

Phoenix uses transactional bank storage to reduce the risk of destroying an existing bank during a failed save operation.

SD A/B session persistence

Phoenix v1.1.0 stores the active bank, screen and slot in two alternating fixed-size session records:

/PHOENIX/SESSION_A.BIN
/PHOENIX/SESSION_B.BIN

Each 20-byte record contains a format signature, version, record size, 32-bit sequence number, bank, screen, slot and CRC32.

Phoenix alternates writes between A and B, re-reads every write for verification and selects the newest valid record during boot. If one file is incomplete or corrupt, the other remains available as a rollback source.

/PHOENIX/LASTBANK.CFG remains as a legacy bank-only fallback and migration source.

Phoenix session persistence no longer depends on NVS. Other optional subsystems may still use their own independent preferences.

NEW BANK defaults

NEW BANK can start from:

  • compiled Factory Defaults
  • optional /PHOENIX/INIT_SOUND.CFG format v1

The INIT template contains sound and mapping settings only. It does not store WAV/sample paths, and NEW BANK clears sample plus pattern/song state in RAM until the bank is explicitly saved.


πŸ–₯ Phoenix Librarian

Phoenix Librarian v1.0.0 is the Windows companion application for Project Phoenix.

It works directly with the same Phoenix bank structure used by the hardware.

Phoenix Librarian

Librarian features

  • Bank management
  • Waveform editor
  • Loop editor
  • KEYZONE / MULTI editor
  • Pattern sequencer
  • Song editor
  • Echo / FX editing
  • Bank metadata
  • MIDI monitor
  • On-screen keyboard
  • Polyphonic PC audio preview
  • Factory library
  • Search and filters
  • Backup & Restore
  • Bank validation
  • Self Test and diagnostics

Typical hardware ↔ PC workflow

PHOENIX HARDWARE
      β”‚
      β”‚ USB Mass Storage
      β–Ό
WINDOWS
      β”‚
      β–Ό
PHOENIX LIBRARIAN
      β”‚
      β”œβ”€β”€ Backup bank
      β”œβ”€β”€ Import / edit samples
      β”œβ”€β”€ Set loops
      β”œβ”€β”€ Build keyzones / multis
      β”œβ”€β”€ Edit patterns and songs
      β”œβ”€β”€ Preview audio
      └── Validate
      β”‚
      β–Ό
Save to Phoenix volume
      β”‚
      β–Ό
Safely eject USB volume
      β”‚
      β–Ό
Reload bank on Phoenix

The Librarian can also work directly with the SD card or with a local copy of the complete Phoenix file structure.

Phoenix Librarian complements the hardware.
Phoenix plays the instrument β€” Librarian organizes, edits, previews and validates its data.


πŸ”Œ Hardware

Audio

ESP32-S3                    PCM1808 ADC
────────                    ───────────
GPIO0   MCLK  ─────────────► MCLK / SCKI
GPIO18  BCLK  ─────────────► BCK
GPIO16  LRCK  ─────────────► LRCK / WS
GPIO5   DIN   ◄───────────── DOUT


ESP32-S3                    PCM5102A DAC
────────                    ────────────
GPIO18  BCLK  ─────────────► BCK
GPIO16  LRCK  ─────────────► LCK / LRCK
GPIO17  DOUT  ─────────────► DIN

The PCM1808 and PCM5102A share BCLK and LRCK/WS.
The ADC master clock is supplied from GPIO0.


Complete ESP32-S3 pinout

Function GPIO
PCM1808 MCLK / SCKI 0
I2S BCLK 18
I2S LRCK / WS 16
I2S DOUT β†’ PCM5102A 17
I2S DIN ← PCM1808 5
OLED SCK 12
OLED MOSI 11
OLED CS 10
OLED DC 6
OLED RESET 7
SD SCK 12
SD MOSI 11
SD MISO 13
SD CS 9
MIDI RX 40
MIDI TX 39
F1 21
F2 47
F3 45
F4 38
F5 4
F6 15
F7 3
F8 14
Encoder A 1
Encoder B 2
Encoder Switch 42
Native USB Dβˆ’ 19
Native USB D+ 20

OLED and SD share SPI SCK GPIO12 and MOSI GPIO11, while using independent chip-select signals.

All GPIO signals are 3.3 V logic.


🧠 Task architecture

Phoenix deliberately separates realtime audio from MIDI, sequencing and user-interface work.

ESP32-S3 @ 240 MHz

CORE 1
└── AudioTask      Priority 24
    β”œβ”€β”€ I2S input
    β”œβ”€β”€ voice rendering
    β”œβ”€β”€ sample-accurate scheduled events
    β”œβ”€β”€ filter / effects
    └── I2S output

CORE 0
β”œβ”€β”€ MidiTask       Priority 10
β”œβ”€β”€ SeqRT          Priority 8
└── ControlTask    Priority 3
    β”œβ”€β”€ UI
    β”œβ”€β”€ encoder / buttons
    β”œβ”€β”€ SD / bank management
    └── system control

Audio block:

Sample rate : 32,000 Hz
Block size  : 128 frames
Deadline    : 4.0 ms
Voices      : 12

🎹 MIDI

Phoenix supports standard DIN MIDI through the ESP32-S3 hardware serial interface.

MIDI IN  β†’ GPIO40
MIDI OUT β†’ GPIO39
Baud     β†’ 31250

The MIDI system supports, among other functions:

  • Note On / Note Off
  • Velocity
  • Sustain pedal
  • Pitch Bend
  • Control Change
  • MIDI Learn
  • external MIDI clock
  • Start / Stop transport

For external-clock operation:

F8 = MIDI CLOCK (24 PPQN)
FA = START
FC = STOP

Continuous F8 while stopped is explicitly supported.


πŸ•Ή Controls

Phoenix uses eight front-panel buttons and one rotary encoder with push switch.

F1  GPIO21
F2  GPIO47
F3  GPIO45
F4  GPIO38
F5  GPIO4
F6  GPIO15
F7  GPIO3
F8  GPIO14

Encoder A   GPIO1
Encoder B   GPIO2
Encoder SW  GPIO42

The switches are active-low and are normally wired from GPIO to GND using the ESP32-S3 internal pull-ups.


🧰 Development environment

The v1.1.0 FINAL firmware was developed and validated for:

Arduino IDE          1.8.19
Arduino-ESP32 Core   2.0.16
MCU                  ESP32-S3
CPU                  240 MHz
PSRAM                8 MB
Flash                16 MB
Audio                32 kHz / 128 frames

The realtime audio translation unit uses targeted -O3 + fast-math optimization. The v1.1.0 FINAL build also compiles the temporary per-frame Reverb cycle timing out by default.


πŸ“Š v1.1.0 performance reference

The v1.1.0 FINAL source is promoted directly from the hardware-validated DEV3b_REVERB_TIMING_LIGHT baseline. The release promotion changes version strings, log prefixes and documentation only; no new DSP algorithm was added after the validated DEV3b build.

Reference stress case:

ESP32-S3       240 MHz
Audio          32 kHz / 128 frames
Deadline       4000 us
Voices         12
Echo           45
Reverb         49
Size           90
Decay          91
Damp           45

Observed on the validated hardware baseline:

Peak block time       3744 us  (93.6%)
Remaining headroom     256 us
Typical 12-voice load  ~2750–2810 us
Audio overruns         0
Audio underruns        0
MIDI drops             0
Sequencer drops        0
Scheduling misses      0

These are measured reference values from the validated test configuration, not guaranteed worst-case limits for every bank, SD card or workload.


πŸš€ Quick start

  1. Build the Phoenix hardware according to the pinout above.
  2. Install the required Arduino libraries.
  3. Open the Phoenix_v1_1_0_FINAL sketch in Arduino IDE 1.8.19.
  4. Select the correct ESP32-S3 board configuration.
  5. Compile and upload.
  6. Insert a prepared Phoenix SD card.
  7. Connect audio input/output.
  8. Connect MIDI.
  9. Power up Phoenix.
  10. Load a bank and play.

For detailed operation, see the Phoenix Bedienungshandbuch in the repository documentation. The existing v1.0 manual remains applicable to the established sampler, sequencer and hardware workflow; v1.1.0-specific changes are documented in the release notes.


πŸ§ͺ Service mode & diagnostics

Hold the encoder switch while powering on Phoenix to enter the service/self-test area.

Available tests include:

  • Audio Output Test
  • Audio Input Test
  • Button Test
  • System Diagnostics
  • Start Sampler

Runtime diagnostics expose audio, MIDI, sequencer and storage health counters, making realtime problems measurable instead of relying only on subjective testing.


βœ… Release status

Phoenix v1.1.0 FINAL

Phoenix v1.1.0 FINAL is promoted directly from the hardware-validated Phoenix_v1_1_0_DEV3b_REVERB_TIMING_LIGHT baseline.

The v1.1.0 release architecture includes everything established by the v1.0.x platform plus:

  • 12-voice realtime sample engine
  • guarded MIDI / voice ownership
  • transactional bank storage
  • sample and loop boundary hardening
  • robust MIDI Start / Stop handling
  • continuous external F8 clock support
  • dedicated realtime sequencer task
  • intra-block event scheduling
  • cooperative SD / bank I/O
  • multisample validation
  • stabilized Echo delay-time changes
  • stereo integer Schroeder/Moorer Reverb
  • Reverb FAST-CACHE
  • 13,860-byte Reverb delay memory in internal SRAM
  • Echo delay ring retained in PSRAM
  • BANK16 with backward-compatible BANK15 loading
  • SD A/B session journal with CRC32 and sequence recovery
  • session persistence independent from NVS
  • Factory Defaults + optional INIT_SOUND.CFG for NEW BANK
  • USB Mass Storage workflow
  • Phoenix Librarian integration
  • targeted -O3 + fast-math audio optimization
  • high-water PHX PEAKTRACE retained for realtime diagnostics

The final v1.1.0 package intentionally stops at the validated DEV3b baseline. The experimental DEV3c full-Echo-internal-RAM branch was tested, showed no useful benefit and is not part of the release.

v1.1.0 is intended to remain a frozen stable baseline. Future development should branch from this release rather than modify the archived FINAL source.


πŸ“– Documentation

docs/ β”œβ”€β”€ Phoenix_v1_0_0_Handbuch_DE.pdf

Release documentation:

RELEASE_NOTES_v1_1_0.md
CHANGELOG.md

πŸ”₯ Why Phoenix?

Phoenix started as a sampler experiment and grew into a complete embedded musical instrument.

The project explores how far an ESP32-S3 can be pushed when audio processing, MIDI, sequencing, storage and UI are treated as one coherent realtime system.

It is built around a simple idea:

Samples should not just be played back. They should become instruments.


PROJECT PHOENIX

Sample Β· Sculpt Β· Map Β· Sequence Β· Perform

ESP32-S3 Hardware Sampler
Phoenix v1.1.0 FINAL

RealTimeAudioLab / RTAL


About

Project Phoenix is a 12-voice ESP32-S3 hardware sampler with multisampling, keyzones, filters, vintage sample processing, echo, MIDI, a real-time 4-track step sequencer and the Phoenix Librarian desktop editor.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages