TUIJam: a groovebox in your terminal
We prototyped a TUI DAW in C++ with four drum voices and one minimal synth, running entirely in the terminal with no external assets. The interface renders as a 16-step sequencer grid, users move a cursor across steps with arrow keys and toggle cells with spacebar. A playhead advances across the grid at a fixed BPM, and a loop counter tracks how many times the pattern has cycled.
All drum sounds are synthesized procedurally at runtime via a callback-based audio engine using miniaudio. The kick is a sine wave with a pitch envelope sweeping from 180 Hz to 40 Hz over ~30ms, decaying over 300ms. The snare layers white noise with a 200 Hz square wave and a short high-pass bias. The hi-hat is band-passed noise with a sharp 50ms decay. The clap is three staggered noise bursts 8ms apart with a transient click at onset. To achieve a lo-fi, 8-bit aesthetic consistent with the PO aesthetic, all voices are quantized to 8-bit resolution before mixing to get a retro sound, each sample is cast through int8_t and back, crunching the waveform to 256 levels.
The system runs three threads: a main thread handling raw terminal input and redrawing the screen at ~30 fps, a timing thread that fires every 125ms to advance the step counter and trigger voices, and miniaudio's own audio callback thread which mixes active voices into the output buffer. The timing and audio threads communicate through a small set of atomic flags to avoid locks on the hot path. Terminal raw mode is installed at startup and restored in an atexit handler so a crash does not leave the shell broken.
A stereo visualization is rendered alongside the grid as a live Lissajous-style stereogram, giving performers a visual read on the current mix.
We anticipate adding a lot more features in the future, such as 16 bars, live audio effects, volume control etc.
C++ terminal app