CHAOS Operators



Sounds villainous.

I’m clearly having trouble understanding it, but look forward to learning from watching others - which I don’t mean to imply is the obligation of the folks that do understand it. It’s on me to learn it. Appreciate everyone’s patience with my mental struggle to keep up. :slight_smile:


Loving this conversation as it hits the bounds between experience and the verbal descriptors of said experience. Simplifying the complex forces us to re-examine what we know and what we take for granted. Hopefully making us all better for the process. I am just happy the possibility exists to use and misuse these tools, to stumble blindly where others see in hopes of finding myself amongst all the glorious chaos.


ohho here’s a list

but well, to dig down a bit on the differences: mainly, seems to me things like a rossler, lorenz, or chua circuit are kinda in a different category because they model continuous-time systems. so if nothing else, a digital version will take an arbitrary time step as a ‘speed’ parameter (which can also affect the numerical results.) they make perfect sense as oscillators.

same applies to the FPUT model i mentioned earlier. (though it is possible to decouple the time step from the update rate; see that source code for an example)

but on the other hand, the models we’ve discussed so far have a very logical and specific meaning for the update “bang.” which would seem to make them more suitable as TT operators (or aleph BEES ops, of which we already have a cubic.) they don’t just run continously. they make more sense as sequence generators.


Thank you, Ezra, for the explanation! Together with the Wolfram link @sliderule posted above I understood now that it probably makes sense to approach the CA algorithm with binarys in mind more then just the numbers to get the most out of it. Also I understood how and why a lot of the combinations of states and rules on the OP do not make much sense, as they instantly go into cycling between two values.

On the other hand it is very nice when they do so after building a short pattern. That and that those pattern tend to repeat or slightly variate gives a useful oscillation between uncertainness and predictability. And it might do interesting little riffs interrupting those more stable states.

I recorded a short example of my excursions into cellular automations to illustrate that there actually is musical use. The CHAOS values are internally quantized and every 20 values another CHAOS value is introduced from a short pattern (77, 79, 73, 81, 71, cycling; rule staying 75; one oscillator into a slowish clocked DLD). The calculated patterns are shorter than the loop in most cases so you hear the “boring” stable states of two values cycling interrupted by short melodic riffs. A friendly tolerance for clangy FM sounds is required though.

It seems to me that the principle and the effect is more easy to grasp looking at a two-dimensional visual pattern, where each cell also has more neighbors. A one-dimensional binary pattern that is then translated in a decimal note value is harder to follow.


Thank you very much for this “elevator pitch” – this was extremely helpful!
To be honest, though, now I wish to have a similar “elevator pitch” for the other Chaos functions – please, would you be so kind?


i don’t know if i can do that, compared to existing resources. but i will give it one more try

the others three algos are what is called “chaotic maps,” “iterated maps,” “discrete maps,” &c.

which just means:

  • take a function (well, family of functions) and an initial value. for example, the logistic function f(x) = a * x * (1-x).
  • the ‘parameter’ is a term in the function that we give a fixed value. for example a=3.5 above.
  • on each update, evaluate the function and store the result as the next input:
    • y = f(x)
    • x = y

pretty simple. saying how this produces chaotic behavior is less simple. first we need to explain what that means. quickly and sloppily:

[edit: first try was too sloppy, sowing misinformation on other threads.]

  • in chaos theory we talk about orbits. put simply, an orbit is a group of paths through the system (technically a “partition of the phase space”), where once our state enters that set of paths you will never leave it. an orbit doesn’t need to be periodic. a lot of orbits are boring things like “decay to such-and-such a value and never leave it again” or “blow up to infinity” or “zero.”
  • an attractor is when a number widely-spread parameters values (“points in phase space”) converge to the same orbit.
  • a “strange attractor” is when multiple attractors are “interwoven” - for a given starting point you can predict that it will go towards one or another, but hard to say which.

generally, chaotic systems are called that when they have dense periodic orbits, meaning any given point in the state space is is *arbitrarily close to some orbit that has a period." these simple recursive maps meet that definition when we restrain the parameter ranges appropriately.

sometimes i help my mom run math+music workshops for students of various ages, in which we usually introduce chaotic maps at some point. we’ve found it most useful for students to draw up their own cobweb plots for different parameter values of a simple iterated function (like the logistic.)

that link is to wikipedia. the article is very short and mostly consists of two animations; conveniently, they illustrate the logistic map. 1) shows the cobweb plot for the logistic map at a given param vale, and 2) shows cobweb plots for different parameter values as they increase from 2.8 to 4 or something. this is a really direct way of visualizing the orbits, easier i think to follow than a bifurcation plot. (but do read the description of how they are constructed, and i recommend trying it yourself as well - the calculations are simple enough to do by hand.)

tangent: bifurcation plots

in the bifurcation plots above, each position on the x axis represents a value for the fixed parameter. the vertical slice above that position shows all the values that the iterated function produces for that param number (after some large number of iterations.)

often, for a given vertical slice, we also vary the starting positions. thus, the vertical slices represent attractors of the system.

the slick thing for me to do here would be to make a video, where the soundtrack is that dumb sinewave arpeggiator posted above, and for each note we draw a new segment of the cobweb plot in the second animation. so perhaps just imagine that and i think it will give a reasonably useful intuition of what is going on.

the cubic map is a minor tweak on the logistic that causes it to oscillate in sign.

(for both of these, the param range is currently [3, 4] and the orbits will always be at least length=2. we could take the param value down to 1 or something if you want the output to include lots of steady states. the downside of doing that is that it will only seem very “chaotic” in the top 10-15% of the parameter range.)

the henon map is a little more complicated because it uses multiple past values to compute each new value. it basically offers a richer and less predictable territory of different orbits as you sweep the param.

i’ve been thinking about other iterated maps, but not really sure they really extend the palette much compared to henon. maybe gingerbreadman. there are probably others if you’re inteterested in specific patterns of growth/decay.

the other general family of chaotic systems that we could / have considered are systems of differential equations (like lorenz, rossler, chua &c.) i didn’t implement these here because:

  1. they are more expensive to compute. (wheras analog versions are often very simple, which is why i can say “that has 2 big caps, a quad opamp and a diode, it’s probably chua’s circuit.”)
  2. if you’re gonna bother computing them, you want at least two parameters (one for the simulation speed) and probably more.

re: elementary CA

i should point out that this implementation is kind of weird and tiny because its only 8 states and they are wrapped. if elementary CA is its own op with different creation arguments, it might be good to increase the number of states, and to have the option of fixing the endpoints.

(i happen to like weird, tiny, circular CA like you see on seashells and stuff, but it’s not very canonical.)

(the most interesting behaviors (i should say, most studied from pure math standpoint) come up when the field is infinite. we can’t do that, but we could use one or more uint32s to store state under the hood. and then arbitrarily restrict the range to give different behaviors. hope that makes sense.)


In teletype world we work in 16 bits, so I could see that being the “window”, with a parameter for an offset into a larger data set.


A basic CHAOS script:

CHAOS.R 9500
Y 10000
X 0
M BPM 240

Z SCALE Y X 12 24 A
CV 1 N Z
TR.P 1

Y 10000
X 0


  • X is the maximum value
  • Y is the minimum
  • Z automatically scales to 1 octave
  • 1 script advances R slightly
  • CV 1 is pitch


I just noticed that changing CHAOS.ALG might let CHAOS crash until reboot.

I did not experience this with the test built from the CHAOS thread.


Could you be more specific? Maybe a list of commands required to reproduce the behaviour, and what the behaviour actually is? What do you mean by crash?


This is the script:


When I change CHAOS.ALG between 0 and 3 on live screen at some point CHAOS does not output any values anymore. Changing to different algorithms has no effect then either.

EDIT: I just found that while altering CHAOS.R then has no effect either, manually inserting a new CHAOS value brings it back to life. Maybe it is somehow settling at zero and then just stays there?


What do you mean by this? Note that 0 is a value.

It’s reasonable in many cases that if the current CHAOS value is 0, then the next one will also be 0.


Yes, it might be outputting zero but how will I know if it is zero or nil?


What do you mean, ‘nil’?

Maybe we should take this conversation to the CHAOS thread.


I picked this up somewhere and thought it was something in computer language:

nil is the object that means “there is no object”


If you see a 0, it’s a 0. CHAOS always returns a value.

If you want to know why CHAOS(0) = 0 for some values of ALG and R, check the CHAOS thread.

Put another way, Teletype commands that reduce to numbers produce numbers. Commands that do not do not, e.g.: TR.P 1.

CHAOS reduces to a value.


think i see the problem in the alg setter and will do a PR for it


Don’t bother. That might not be the right repo. A bug has already been fixed, unless the problem is in chaos.c.

Won’t be able to fix this until tonight, out for the day.


it is in chaos.c. algo setter should call scale_values, otherwise the new algo runs with inappropriate value/param ranges. i made a PR.

out for the day.

of course, no rush. its stormy here and the power went out for a couple hours. nature break!


@Leverkusen Thanks for alerting us to the CHAOS.ALG bug, it’s fixed in Alpha 3.

Cool-ass rhythm generator:

M 125


(Teletype) 2.2 Release
How do you all use random, chance, and accident?