Stochastica - a new suite of UGens for chaos and randomness

Hi all,

here is Stochastica, a vibe coded comprehensive new suite of generative UGens for SuperCollider dedicated entirely to non-linear dynamics, chaos theory, and advanced stochastic processes. The collection spans discrete chaotic maps (Gbman, Rulkov, Coupled Map Lattices), continuous-time ODE solvers (Chua, Izhikevich, Mackey-Glass), advanced probability distributions (Cauchy, Weibull, Truncated Normal), and structural pattern generators like Semi-Markov chains and self-exciting Hawkes processes.

I am planning on expanding this soon. Comments, suggestions, criticisms, bug findings, etc are all welcome!

here is an audio and some plot from the examples:


best,
fmm

4 Likes

Are you providing the maths for these and the UGens are being vibe coded, or is there a different process?

It depends on the type, but mostly I provide the conceptual idea and math general background. Most of these specific libraries came from limits that I saw when using SC vanilla dynamics UGens. At some moment I was using python to solve differential equations and using them at SC, but that was too cumbersome, so I decided to implement them as UGens. In others, I have a crazy idea and I keep asking LLMs to implement and the I go redesigning it and keep iteratively.

I am also checking for DSP papers for implementing new ideas (which are ready but I am working on the docs better before publishing) and also filtering a list of ODEs,PDEs and more to implement.

1 Like

Do you know that is has implement the maths correctly?

I don’t think it really matters for me, because I’d care more about the sound, but for some use cases this would be really important.

Thanks.

I’m glad these exist, as it’s always good to have options. But that helps me evaluate my own comfort level around things like stability for live purposes.

no, not really, I test the results and see if the match the conceptual expected approach. (this word raises so much philosophical, ethical, moral and psychological questions but I won’t address this huge debate here)

Don’t trust them blindly, be safe.

Oi Fellipe, thanks for sharing

On @cian point, I agree: I think real-time robustness matters more here than mere math textbook correctness. If it sounds good, it is good.

Matter of fact, implementing equations like those is always a 'translation": the equation is in continuous time, dsp runs in discrete samples, there is a lot of choosing in the process. Just make sure you document them: things like interpolation, parameter modulation, what reset means, numeric precision, &c.

SC has examples both ways. The Glitch* filters exist because people liked the old “wrong” sound after a correction update. Something “wrong” can also sound good. If you correct the math, also compare the sound output, too, and how you like it.

On the other side of the coin, GVerb’s roomsize argument change used to blow up. It went unfixed from the 2000s until recently. Test it and make sure nothing crashes with things you allow to change over time.

The code seems fine (RTAlloc, finite checks, NRT tests). Most things look fine when skimming them. One observation: MackeyGlass’s raw delay array fills the history with std::fill on every reset trigger, twice in Ctor. That’s O(n) in the audio thread. If I’m not missing anything, I’d suggest something that resets lazily. That would prevent unnecessary spikes when using large buffers.

1 Like

Oi Bernardo!

Thank for the suggestions! Please submit an issue if you find specific improvement or new ideas.

I will check this for sure!

I am planning a set of glitch ugens exploring these radical dsp “strategies”, but for the moment I am focusing on UGens that I always wished to have available or dormant project discussed on the list.