Watasoge Building Log #3 — Play Wavetables
2026-02-15
As I wrote a few days ago, one of the first tasks I gave Claude Code was to create a C header file with wavetables. The next step was to have the NUCLEO-G431KB play these wavetables.
At the same time, I wanted to improve the firmware architecture a bit. Instead of having everything happen in main.c, the functionality was to be split into different modules.
So I told Claude Code to look at the wavetable header file and to modify the firmware, which up to that point could only play a 440 Hz sine wave from a hardcoded array.
There was to be a module that synthesizes the signal, a module that outputs the signal, and one that determines what should be output — meaning which sound at which pitch, when, and for how long. The modules were to be called synthesis, output, and player. Main was only supposed to keep the heartbeat LED blinking.
For me, the development was as simple as writing this text. After I described to Claude Code what I wanted, it made a plan and then carried it out (after confirmation).
The first test run didn't sound quite the way I had imagined, so I described to Claude Code what I had heard and what bothered me about it.
After a two- or three-minute pause to think, Claude Code adjusted the firmware, and the result showed, that the changes were already heading in the right direction.
One round of feedback from me and a few changes from Claude Code later, 220 C major scales came out of the powered speakers — one octave per sound.
Still amazing.
