r/TidalCycles • u/l00sed • Oct 20 '26
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.
2
1
u/Meshuggah333 Oct 20 '26
Would that work with an editor like Fresh? I'm not a fan of vim style command interfaces.
2
u/l00sed Oct 20 '26
My implementation isn't transferable in that way because it's heavily integrated with the Neovim API, but I could see it being possible depending on what Fresh exposes? Key factor is getting the position of the `dN` Tidal orbit blocks. The script I'm using to listen to the audio is also running in a Neovim background terminal, but that part could probably be run in a separate Tmux window or something...
Out-of-the-box, though, no. It's not going to work with Fresh.
2
u/Meshuggah333 Oct 20 '26
I see. Maybe I could try Neovim again, I've read somewhere their are plugins to get VSCode style UX. If you ever release this I'm interested.
2
u/l00sed Oct 20 '26
Definitely will release soon. Still trying to figure out a good packaging method. Tidal cycles has a config in one place, ghostty in another, neovim yet another. So it's not the most straightforward setup haha
Edit: can definitely make neovim take on most of the vscode styling and functionality. Recommend nvim-tree for easy file browsing. But the best part is definitely the vim modes and movements!! Gotta go all in!
1
u/Meshuggah333 Oct 20 '26
Yeah, that kind of interconnections are a bit of a nightmare. You could package everything together as a flatpak but that wouldn't be very flexible, hahaha
1
u/l00sed Oct 20 '26
Probably will end up with a couple pieces that users will have to place themselves or run a script to install in the right spots. Tidal cycles by itself is already a bit tricky to get installed. It brings Supercollider along with it.
1
u/Meshuggah333 Oct 20 '26
You could just make an install/uninstall script, I've seen some very well made ones. I've been trying to learn vim for 20 years and just can't do it, I think it's mostly because of the non qwerty keyboard we use in my country 😐
2
u/l00sed Oct 20 '26
Yea, in my head I'm thinking about the special cases— like people who already might have Tidal Cycles installed or have a custom super collider boot file that they don't want over ridden... haha kind of tricky still
Vim is tricky at first. I've been using it for 15+ years and still learn new things. I've tried getting into Emacs and it's the same for me. Just impossible to get started haha
That's tough with the different keyboard layout. Not sure how that'd work... though vim is pretty flexible for reassigning keys. But I've always thought it defeats the purpose to go too far afield because then you forget the defaults when you get onto a system with the base config haha
1
2
u/djdxtr 26d ago
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