Guitar tuner for macOS and Linux
  • Zig 88.2%
  • C 11.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-13 11:37:26 -08:00
src Initial commit 2026-11-12 22:08:31 -08:00
.clang-format Initial commit 2026-11-12 22:08:31 -08:00
.gitignore Initial commit 2026-11-12 22:08:31 -08:00
build.zig Initial commit 2026-11-12 22:08:31 -08:00
build.zig.zon Initial commit 2026-11-12 22:08:31 -08:00
README.md Update README with screenshot 2026-11-13 11:37:26 -08:00
screenshot.png Add screenshot 2026-11-13 11:34:06 -08:00

t4mt

Terminal guitar tuner in Zig. Shows the closest note, the frequency, and the cents offset.

Audio goes through miniaudio (fetched by build.zig.zon): CoreAudio on macOS, PulseAudio/PipeWire, ALSA or JACK on Linux. Pitch detection uses YIN.

zig build -Doptimize=ReleaseFast     # needs Zig 0.16; on macOS, build natively (needs the SDK)
./zig-out/bin/t4mt                   # auto-picks a Focusrite "Inst" input
./zig-out/bin/t4mt --list            # list capture devices
./zig-out/bin/t4mt -d 3              # pick by index...
./zig-out/bin/t4mt -d "Input 2"      # ...or by name substring
./zig-out/bin/t4mt -c 2              # force input channel 2 (default: loudest)
./zig-out/bin/t4mt -a 432            # different A4 reference
zig build test
zig build clangd                     # write compile_flags.txt so clangd finds miniaudio.h

On macOS the Scarlett shows up as one stereo device. Input 2 (instrument) is channel 2, and the loudest channel is picked automatically.