// HACKER NEWS — CYBERSECURITY
Whistle Synth
It's free, no ads, and open source.
If you have a mac and like to whistle, give it a try? You need an
external mic, headphones (wired, to minimize
latency), or both; I recommend the former.
Living in this age
of genies I've had Claude heavily redo the implementation, and it
is lower latency, no longer stutters, and has more voices to choose
from. Plus, as above, it's now a Mac App.
Latency was the easiest and fastest: I pointed the mic into the
headphones and asked Claude to bring the latency down. This gave it
everything it needed to measure round trip latency, and it tried a few
different things before figuring out that it needed the callback
API and a few other tweaks. This got audio rount trip time
(ignoring pitch detection and synthesis) down from 80ms to 5ms.
Fixing the stutters was a matter of splitting
up the logic into a detector that gave instructions to a synth.
Ironically, this refactor brings us back to how I originally
designed it before throwing that away five years ago for a weird idea
that did sound better but turned out to be very limiting.
With the new system voices were a lot easier to write. Or, at least,
I assume they were, though Claude did all the writing. I had it
brainstorm various kinds of bass, code up prototypes, and then we
iterated together until I was happy. This included an octaveless
bass, where as you go higher it slowly changes the harmonic mix to
keep the perceived octave constant.
I also finally got a treble voice I was happy enough with. This has
been something I've worked at since the beginning, and I've hated
everything I've tried. This was also harder for Claude: while I liked
70% of the bass voices it prototyped, I've still only ended up with
one treble voice that's worth playing. It's a drawbar (Hammond) organ.
Our ears are just so much more discerning at higher pitches. There's
also some factor of bass lines being simpler (harder to screw up) plus
tuning registering more quickly (less time to fully land on the note
before someone notices).
I would like to add more treble voices, but the main blocker has been
figuring out what kinds of voices would (a) sound ok and (b) be
implementable by claude. I spent a long time trying to get it to
write a good flute sound, including giving it examples of a real
flute's sound, but even after it spent a long time on physical
modeling it never got anything I was happy with. I also tried various
synth
leads and a tine piano (Rhodes) without
success.
When I think about why the drawbar sounds ok, I think a lot of it is
that the rotating speaker (Leslie) adds a
lot of life that would normally be missing for a sustained note.
Thinking about what might be similar I've also had Claude make an
accordion sound, which is decent but I'm not yet happy enough with.
I also added a setting where it plays a fifth down from where you're
whistling (D -> G) which means your whistle fills in a multiple of the
third harmonic. This is an idea I got from Ugo
Conti, and it's amazing how quickly your brain gets used to
controlling the sound (as long as you have it loud enough).
This lets you whistle tunes in keys that would otherwise be a poor fit
for your range.
I'd never distributed something through the Mac App Store before,
partly because Apple's review process is famously fussy. I decided to
see if Claude could walk me through the process. Before I could do
that, though, I needed an icon. I asked Gemini to make one, and after
a couple follow-up prompts got: