Field test3 min read
Real-time audio, BLE hacks, and weird Mac side quests
Three small native experiments that never needed to become startups: broadcasting Mac audio over BLE GATT, real-time pitch correction, and an offline camera-confidence gym.
Magicoffset 0..1 · 2 B · ASCII "NC"
Lets the iPhone receiver drop stray or corrupt GATT notifications immediately.
Not everything you build needs a landing page, a roadmap, or a pricing tier. Honestly, some of the most fun I have writing code is picking one oddly specific itch on macOS, building the smallest working thing that proves it out, and leaving it neatly in an experiments folder.
Here are three of those side quests that all ended up orbiting audio, media, and macOS plumbing.
1. N-Col: broadcasting Mac system audio over BLE GATT
The question here was slightly daft: can a Mac broadcast its system audio to one or more nearby iPhones using plain Bluetooth Low Energy?
Normally you’d use Bluetooth Classic A2DP or AirPlay for audio. The catch is that iOS doesn’t let normal apps invent arbitrary Bluetooth Classic audio profiles, and connectionless BLE advertising packets are far too tiny and unreliable for continuous audio.
So N-Col takes a deliberately stripped-down route: the Mac acts as a BLE peripheral with a custom GATT service, captures system audio, and blasts out raw PCM frames as GATT notifications to every subscribed iPhone receiver.
That led to N-Col/1, a tiny 172-byte wire format (you can click through every field in the packet inspector above):
- Bytes 0–1: Magic
4E 43("NC") so the receiver drops garbage immediately. - Bytes 2–3: Protocol version (
1) and flags (0). - Bytes 4–7: Little-endian
uint32sequence number so gaps are obvious. - Bytes 8–9: Sample rate (
8,000 Hz,40 1FLE). - Bytes 10–11: Sample count (
160,A0 00LE) — exactly 20 ms per packet. - Bytes 12–171: 160 signed 8-bit mono PCM samples.
No codec, no retransmission, no handshake ceremony — just 64 kbit/s of raw telephone-grade PCM hopping straight from a MacBook into an iPhone speaker over a BLE characteristic. It sounds gloriously lo-fi, like an intercom from 1994, and building it with XcodeGen across both macOS and iOS was an absolute blast.
2. Pitch Correct: real-time vocal tuning in Electron
Another curiosity: how low can you push real-time pitch detection and correction inside a desktop Web Audio pipeline before the latency makes it impossible to sing through?
Pitch Correct wraps the Web Audio API and Pitchy inside Electron, running on tiny 256-sample buffers at 44.1 / 48 kHz. You pick a musical key and scale, dial in correction speed and formant preservation, and hear the corrected vocal come back live.
The fun engineering bit here isn’t the pitch detection itself — it’s fighting the trade-off between buffer size and low-frequency accuracy. Shrink the buffer too far and you can’t reliably detect low vocal fundamentals; grow it too far and the delay in your headphones turns your brain to mush while you’re talking or singing. Landing right around 256 samples with careful smoothing was the sweet spot where it stopped feeling rubbery.
3. Dictator: an offline camera-confidence gym
A lot of engineers (myself included) are completely fine talking through a gnarly architecture problem on a Slack huddle, and then weirdly stiff the moment a camera turns on to record a Loom or a demo video.
The usual advice is "just record yourself more", except staring at your own face while you speak is basically a guaranteed way to trip over your words.
Dictator is an experimental local-first macOS Electron app built around that exact problem:
- Hidden self-view by default while you record, so you talk to the lens instead of micro-managing your own eyebrows.
- Prediction before playback — you jot down how you think it went before watching, then review via audio-first, transcript-first, small-video, or blurred-video modes.
- 100% local transcription using a pinned
whisper.cppbuild (Whisper Tiny or Base English downloaded explicitly with integrity checks) — zero accounts, zero cloud uploads, zero telemetry. - Narrow, typed IPC with a sandboxed renderer so the web UI can’t wander around the filesystem.
It’s still an MVP foundation rather than a notarised release, which is completely fine. It already answered the question it was built to test: stripping away self-view and cloud upload anxiety makes practicing on camera about ten times less awkward.
None of these three is trying to be the next big thing. They’re small, self-contained sketches — and keeping experiments cleanly isolated means you can try weird ideas on a Saturday without turning your maintained projects into a junk drawer.