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.

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
- ESP32 dev board (WROOM-32 DevKit-style) per the sketch's code header
- Waveshare WM8960 stereo codec module unlinked — no catalog page; requires the maker's stereo LINE IN mod first
- ILI9341 TFT display, 320×240 touch variant page, touch unused; the maker's User_setup.h governs wiring
- Rotary encoder with push-button ×3 DRIVE, TONE, OUTPUT
- 10k ohm resistor ×6 per the guide's parts list
- Soldering iron + lead-free solder hand tools
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.
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

How to Build It
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
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
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
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
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.

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
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
Flash the sketch
Flash the V1.2 sketch from the guide's Code section.
- 7
Respect the startup order
WM8960 configured fully first, ESP32 I2S clocks started last — and the sketch handles it for you.
- 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
1× Case
1× Soldering iron + lead-free solder
1× Arduino IDE; TFT_eSPI; SparkFun WM8960 library v1.0.6
Learn
Docs & guides
Read these before you buy. These pages explain things; they don't sell anything.
- Build guide (Hackster)mircemk's complete step-by-step guide — full schematic, wiring, the modified TFT_eSPI User_setup.h and the entire V1.2 sketch (GPL3+).Docs
- Hackaday write-upElliot Williams, "Warm Analog DSP, On The ESP" (2026-11-14) — the Tektronix-inspired case line and the slow-dynamics open question.Docs
- Project mirror + full sketch (hackaday.io)The hackaday.io project page, hosting the complete V1.2 sketch as a .txt download.Docs
- Predecessor: WM8960 LINE IN modThe maker's 5-band Parametric EQ project — where the stereo LINE IN modification this build's WM8960 board needs is documented.Docs
Related Projects







