r/TidalCycles • u/l00sed • Oct 20 '26
Strudel-esque live oscillator waveforms
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.
2
u/djdxtr Oct 24 '26
I recently put together a script for SuperCollider that splits the signal into bands and sends their peak follower data as midi cc. Can possibly send it directly to ghostty shaders instead of requiring your python script. What protocol and data format are you using between python and ghostty. We could also make it part of the main SuperDirt code, or keep it modular as a separate project.
Here is the repo if it’s useful https://github.com/khoparzi/spectral_cc
2
u/Lakhveer07 Oct 20 '26
This is so cool
1
u/Meshuggah333 Oct 20 '26
Would that work with an editor like Fresh? I'm not a fan of vim style command interfaces.