Skip to content
MCU Atlas

ESP32 Tube Sound Processor: tube warmth, no tubes

A stereo line-in box where an ESP32 models tube saturation in DSP: three encoders set drive, tone and output while the screen draws the transfer curve live.

Difficulty:IntermediateSource available

What it is

A stereo line-in tube-warmth effects unit by mircemk (Mirko Pavleski): audio crosses a Waveshare WM8960 codec to an ESP32 over I2S, runs through an asymmetric dual-knee tube-saturation model in DSP, and comes back out at 48 kHz/16-bit stereo — with a live transfer-curve display and three encoders. No tubes, no high voltage. MCU Atlas is not affiliated with the maker or Tektronix.

What you need

How hard

Intermediate: basic soldering, a complete step-by-step guide (~3 hours) — but budget a detour through the maker's WM8960 stereo LINE IN mod (his Parametric EQ project) before this build starts.

Photos

The finished device — the ILI9341 shows DRIVE/TONE/OUTPUT values and the live transfer curve (maker's photo).
On the oscilloscope: drive rounding a sine's tops — the asymmetric soft-knee clipping at work (maker's photo).
The real tube amplifier the sound is modeled on (maker's photo).

Photos: mircemk (Mirko Pavleski) via Hackster.io

Key Facts

  • Stereo line-in tube-warmth effects unit: WM8960 codec in, ESP32 DSP, WM8960 out — 48 kHz / 16-bit stereo, no tubes, no high voltage
  • Tube model = asymmetric dual-knee soft clipper (dualKneeClip()); asymmetric halves generate a dominant 2nd harmonic plus smaller 3rd
  • Three encoders: DRIVE 0–24 dB, TONE −100…+100 (linear shaping only), OUTPUT −12…+18 dB; ±2 dB MID boost/cut on a click
  • ILI9341 320×240 display renders the transfer curve live alongside all three values
  • True bypass (click DRIVE), 5 preset slots, last-state auto-save/restore at boot
  • Audio on a dedicated FreeRTOS task, 240-frame DMA buffers, no transcendental math in the sample loop
  • V1.2 has no oversampling: expect aliasing at high drive (a commenter proposes 2×/4× around the clipper); Hackaday couldn't find the claimed slow-dynamics tube behavior in the code
  • Maker's listening note: subtle on recordings, clearly felt live; his sweet spot ~14–16 dB drive
  • Intermediate, full instructions provided, ~3 hours; requires the maker's WM8960 stereo LINE IN mod from his Parametric EQ project
  • GPL3+ (Hackster page mark); by mircemk (Mirko Pavleski), September 2026

About This Project

Tube warmth on your desk, minus the tubes: an ESP32 and an audio codec in a Tektronix-inspired case, modeling vacuum-tube saturation in software while a little display draws the distortion curve as you turn the knobs.

The ESP32 Tube Sound Processor is a stereo line-level effects unit by Mirko Pavleski — Hackster's mircemk. Audio flows in one side of a Waveshare WM8960 codec, crosses to the ESP32 over I2S, runs through a tube-saturation model in DSP, and comes back out the codec's DAC to your headphones or line out at 48 kHz, 16-bit stereo. An ILI9341 320×240 display shows the transfer curve live, and three rotary encoders — DRIVE, TONE, OUTPUT — shape it in real time. A true-bypass click on the DRIVE encoder passes the input straight through so you can compare original and processed sound instantly.

It ends up in what Hackaday called a "Tektronix-inspired case that would be at home on the workbench or in the living room" — a desk showpiece that happens to be a signal-processing exercise you can hear.

Why it's in the MCU Atlas library

A guide you can actually follow. The Hackster article is a complete step-by-step build — full schematic, wiring, a modified TFT_eSPI User_setup.h, and the entire sketch — badged "Full instructions provided" with an intermediate difficulty and a ~3-hour estimate. A reader with basic soldering skills can reproduce it exactly.

Catalog parts, not unicorns. An ESP32 dev board, a WM8960 module, an ILI9341 display, three encoders and a handful of 10k resistors. The maker calls the build "relatively simple and inexpensive" (he publishes no prices, and neither do we — see the Parts list).

Audio variety. Most ESP32 projects end in a display or a sensor reading. This one is real-time audio DSP: harmonics, transfer curves, clipping detection — a different muscle, and a gateway to effects building. Readers who enjoyed our squeezelite multi-room audio player will recognize the neighborhood.

The DSP: how the tube is modeled

The audio path runs: DC block → gentle mid-band pre-emphasis (~180 Hz–3.2 kHz, max ~2.6 dB) → DRIVE gain → the clipper → de-emphasis → MID boost/cut → bass/treble contour → output trim → DC block.

The tube character lives in one function, dualKneeClip(): two soft knees per half-cycle, with deliberately asymmetric halves — the positive saturates earlier and firmer (knees 0.35/0.56), the negative later and softer (0.95/1.20). As Hackaday put it, "tubes round off the tops more than the bottoms. [mircemk] lets you tweak this transfer function, and displays it nicely on the screen". Pushing the top differently from the bottom generates a dominant second harmonic plus a smaller third: the classic warm recipe.

The encoders tune it live: DRIVE runs 0.0 to +24.0 dB (0 dB is essentially clean), TONE sweeps −100 to +100 from warm to bright — explicitly linear tone shaping with, in the maker's words, "no direct impact on the so-called 'tube sound'" — and OUTPUT sets −12.0 to +18.0 dB. A short click on OUTPUT gives ±2 dB MID boost/cut; a long click opens five preset slots (P1–P5) that store DRIVE/TONE/OUTPUT/MID, and your current settings auto-save to flash after 2 seconds idle and restore at boot.

Under the hood it's engineered like an effects pedal, not a science demo: the sample loop runs in a dedicated FreeRTOS task on core 0 with 240-frame DMA buffers, and the code notes "No powf()/log/tanh inside the sample loop".

Two honest caveats, both from the sources. V1.2 intentionally skips oversampling, so at high drive the generated harmonics run past Nyquist and alias back down — a Hackster commenter suggests that "If you 2x or 4x oversample just around the clipper… the live 'warmth' should match the plots more closely". And Hackaday notes that tubes "respond slowly to rapidly changing signals — and [mircemk] says he implemented that as well. We couldn't find that part of the distortion accounted for in the code, but maybe you can?" Consider that an open invitation.

On how it sounds: the maker says the effect is subtle on recordings except at full 24 dB drive, but "when listening live; you can really feel the difference" — his sweet spot is around 14–16 dB, where his spectral analysis shows the strongest second harmonic.

The build, condensed

Read the WM8960 caveat first. The guide assumes your WM8960 board already carries the maker's "existing stereo LINE IN modification" from his earlier 5-band Parametric EQ project — the hardware is "100% IDENTICAL to the completed 5-band Parametric EQ", not to a stock board. Budget a detour through that project's instructions for the codec mod.

Wire it per the schematic: I2S to the codec on GPIO 14 (BCLK), 13 (WS), 17 (data out) and 19 (data in); I2C control on SDA 21 / SCL 22; the display on VSPI (MOSI 23, SCK 18, CS 5, DC 2, backlight 0); encoders on 34/35/32 (DRIVE), 36/39/33 (TONE) and 25/26/27 (OUTPUT), with the six 10k resistors per the guide.

Set up Arduino IDE with TFT_eSPI using the maker's supplied modified User_setup.h, and the SparkFun WM8960 library v1.0.6.

Mind the startup order: configure the WM8960 completely first, and start the ESP32's I2S clocks last — the code is emphatic about it.

Flash, feed it a line-level source (input gain at 0 dB; the maker's tests ran peaks around −2 to −10 dBFS), and turn knobs. Input and output clipping indicators turn red if you push too hard.

Make it yours

These are MCU Atlas suggestions, not the maker's — the GPL3+ sketch invites them:

Different tube curves. The whole character sits in four knee constants inside dualKneeClip(). Shift the asymmetry toward or away from the even harmonic and the on-screen curve shows your edit immediately — a genuinely playable way to learn distortion synthesis.

Tame the aliasing. The commenter's 2× or 4× oversampling around the clipper is a well-scoped firmware exercise with an audible payoff at high drive.

MIDI control. The three encoders are ordinary GPIO; routing DRIVE/TONE/OUTPUT to incoming MIDI CC over a spare UART would make the box remote-controllable from any controller. Not in V1.2 — that's your mod.

Presets as voices. Five slots are already there; a dual-footswitch preset stepper would turn a desk toy into a performance piece.

Credits, license and links

Built and documented by mircemk (Mirko Pavleski); the sketch header reads "by mircemk, September 2026" (V1.2). The design borrows concepts the author credits to Elektor (the output-trim and mid concepts). Covered by GPL3+ per the Hackster page's license mark — no separate license file ships with it, so if you reuse or modify the sketch, GPL-3.0's attribution and same-license terms apply. MCU Atlas summarizes the project here; the code stays with its author. Not affiliated with Tektronix; the case styling is homage.

Thanks to Elliot Williams, whose Hackaday write-up, "Warm Analog DSP, On The ESP" (November 14, 2026), sent this one our way. Nothing here is hardware-tested by MCU Atlas — every behavioral claim on this page is the maker's Hackster guide, the Hackaday write-up, or the V1.2 sketch itself, cited.

Source & Attribution

Source:
License: GPL-3.0-or-later (per the Hackster page license mark; no separate LICENSE file — the sketch ships as Hackster page attachments and the hackaday.io .txt)
Last verified: 11/29/2026
ESP32 Tube Sound Processor: tube warmth, no tubes

How to Build It

From the maker's Hackster build guide (not hardware-tested by MCU Atlas): do the WM8960 stereo LINE IN mod first, wire codec + display + three encoders, install Arduino IDE with TFT_eSPI and the SparkFun WM8960 library, flash the V1.2 sketch, and listen.

Parts Needed

  • 1x ESP32 dev board (WROOM-32 DevKit-style)
  • 1x Waveshare WM8960 stereo codec module (with the maker's stereo LINE IN modification done first)
  • 1x ILI9341 TFT display, 320×240
  • 3x push-button rotary encoders
  • 6x 10k ohm resistors

Steps

  1. 1

    Read the WM8960 caveat

    The build needs the maker's stereo LINE IN modification to the Waveshare WM8960 board, documented in his 5-band Parametric EQ project (link above). Do that mod first.

  2. 2

    Gather the parts

    See the Parts list — ESP32 dev board, WM8960 module, ILI9341 320×240 display, three push-button rotary encoders, six 10k resistors.

  3. 3

    Wire the audio path

    I2S BCLK → GPIO 14, WS → 13, ESP32 data out → 17, data in → 19; codec I2C on SDA 21 / SCL 22.

  4. 4

    Wire the display and encoders

    Display on VSPI: MOSI 23, SCK 18, CS 5, DC 2, backlight on 0 (active HIGH). Encoders: DRIVE 34/35/32, TONE 36/39/33, OUTPUT 25/26/27.

    Wiring topology: ESP32-WROOM-32 to WM8960 codec (I2S BCLK 14, WS 13, DOUT 17, DIN 19; I2C SDA 21 / SCL 22), ILI9341 TFT (MOSI 23, SCK 18, CS 5, DC 2, BL 0) and three rotary encoders (DRIVE 34/35/32, TONE 36/39/33, OUTPUT 25/26/27)
    Full wiring topology — ESP32-WROOM-32, WM8960 codec, ILI9341 TFT, three rotary encoders. Pin map from mircemk's V1.2 sketch (GPL3+). Tap for the full-size SVG.
  5. 5

    Install the toolchain

    Arduino IDE, TFT_eSPI (with the maker's supplied modified User_setup.h) and SparkFun's WM8960 library v1.0.6.

  6. 6

    Flash the sketch

    Flash the V1.2 sketch from the guide's Code section.

  7. 7

    Respect the startup order

    WM8960 configured fully first, ESP32 I2S clocks started last — and the sketch handles it for you.

  8. 8

    Listen

    Feed it a line-level source (start around −2 to −10 dBFS peaks), click DRIVE to true bypass for A/B listening, long-click OUTPUT to save your sound into a preset.

Bill of Materials

Parts list

8 parts · 4 linked

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

1× Waveshare WM8960 stereo codec module

No verified link — check the original project

1× Case

No verified link — check the original project

1× Soldering iron + lead-free solder

No verified link — check the original project

1× Arduino IDE; TFT_eSPI; SparkFun WM8960 library v1.0.6

No verified link — check the original project
Download CSV

Related Projects

squeezelite-esp32: multi-room audio player on ESP32
Illustration
ESP32
Get squeezelite-esp32 running: the hardware you need, the one-click web installer for flashing, and LMS connection steps for multi-room audio.
Intermediate·Code
8 parts listed
AirPlay 2 surround (5.1 / 7.1) with one ESP32-S3 per speaker
Illustration
ESP32ESP32-S3
An ESP32-S3 Gateway an Apple TV sees as one AirPlay 2 speaker feeds one ESP32-S3 per satellite — start with a stereo pair, grow to 5.1 or 7.1, no AV receiver.
Intermediate
8 parts listed
sanoTTS: neural text-to-speech on an ESP32-S3
Illustration
ESP32ESP32-S3
Tiny neural text-to-speech: thirty voices in sixteen languages, running offline on an ESP32-S3, in your browser, or from Python.
Intermediate·Code
5 parts listed