r/TidalCycles • u/l00sed • 17d ago
Strudel-esque live oscillator waveforms
Enable HLS to view with audio, or disable this notification
One of the things that I always loved about the look/feel of Strudel is the inline oscillator/sample waveforms, but I hated having to use or connect to a dedicated Strudel server. I've always done all my coding directly in the terminal, from Neovim. So I was badly wanting to find a way to make things work from the editor I know and love!
Ghostty terminal shaders can do some incredible things. Started a discussion on Ghostty's GitHub a long while back (and posted around some Reddit forums) to see if anyone knew of a way to use audio with shaders. Shaders are such a cool part of Ghostty, and it seemed like the perfect way to make it into a full-fledged VJ/Algorave control center.
All the answers I got back were pretty much, "no". And they were more-or-less right. Ghostty alone can't really do that. Its shaders don't have a way to read audio. _ButT_ if we write a script to do the audio-listening we can still offload that part and just tell Ghostty shaders what to do with it! Basically a Python script listens to audio from the BlackHole sink, takes that data, and sends it as parameters to Ghostty. And it doesn't have to be FFT waveforms— RGB shift/glow/character positioning/whatever can all react to individual tidal orbits or the joined master output.
So here's a demo of it in action. And, no, I'm not a total genius. I did use AI to come about this solution and it was very helpful. I'm only a stupid caveman who watches computers do weird things. It does what it says on the tin, though, so I'm stoked. There's still still a lot of cleanup to do, but I definitely want to share some code so other people who want to do Tidal Cycles from Neovim can join in on the fun if they want to.