CHAOS Operators

teletype

#137

i dunno, sure - i made these “pattern” commands in the cabash cause i thought they were convenient:


#138

If I enter a value somewhere above 10,000 on CHAOS.R, the CV value will continue for about 4 or 5 triggers after hitting F10, after that the CV stops changing value.

If I then change from say CHAOS.R 12000 back to CHAOS.R 500 the CV remains silent until I go through a INIT and start over. I want to verify that I do indeed press F10 between value changes and that for values under 10k I don’t have any issue with CHAOS.R


#139

Just to confirm, has CA being spun out of CHAOS been put on hold?


#140

caveat: i don’t generally contribute to the TT code, and specifically really have no time right now.

but since i am responsible for the algorithm i double checked with the simulator and it works as expected.

param value is clipped at 10000, setting it higher won’t do anything different.

these are chaotic iterated maps, their behaviors are sensitive to the initial state.

the default map is the logistic. it has degenerate single-value orbits for many initial state values and parameter values. in particular, setting the state to zero will cause it to output zero forever, regardless of the parameter value.

so my current best guess is that you are setting the state somewhere in your script (CHAOS N)

as ever, it is probably most helpful to post more of the script

my test is simply

CHAOS.R 10000   (or 12000 or whatever)
CHAOS
CHAOS
CHAOS
...

that has a very long orbit, as expected, with the default intial state value of… looks like 5000.

if i ever do CHAOS 0 then subsequent outputs will be zero as expected.

i can also get it to go to zero with some other state values and the param maxed. i think technically this shouldn’t happen in an ideal logistic map, but it’s not really surprising given that there is inevitable rounding error even using float32 for the internal state.


i don’t know about the decision re: separating CA and CHAOS. it is purely a matter of taste and usability but seems like a good idea. sounded like it was being pushed to a future point release which is perfectly reasonable.


#141

The extent of the script is this:

I: CHAOS.R 275 // 2.75
M: CV 1 CHAOS
1: TR.P 1

I have a clock in trigger input 1

So here are more details, I set CHAOS.R 10500
Teletype is no longer outputting CV.
I change CHAOS.R back to 275 but the CV will not restart, I wait…nothing
I try another value…nothing
I try INIT which apparently clears everything
I reenter the script and while the trigger is functioning I get nothing from the CV and am forced to power cycle the Teletype and everything else in my rack.
I reenter the script and set CHAOS.R 9500 and everything works as I would expect.
Set to CHAOS.R 9999 everything works
Set to CHAOS.R 10001 and then 10100 and things are fine
Set to CHAOS.R 10500 and again CV “dies”

Now, if I type INIT and go to script 1 and enter:
TR.P 1
CV 1 V 6

The CV changes on my oscillator. Seems like the CV is back to working order.

So I enter my script:

I: CHAOS.R 275 // 2.75
M: CV 1 CHAOS

And CV is non functioning, forced to power cycle.


#142

ok, thanks.

i see the problem. the bounds check on param for logistic is missing. my apologies!

(so param values >10k are not being clipped and are blowing up the algo. somehow i was checking things like 15000 which actually produces reasonable patterns, but 10001 is an exploder.)

if the op does blow up or get stuck in a steady state that you don’t like (which could well happen) the thing to do is to reset the state with something like CHAOS 5000 (anything nonzero will work.) you should not ever have to powercycle because of this, and the CV isn’t “dead” it’s just fallen into a repeating value.


@sliderule, i’m finding it non-trivial to figure out the current state of forks and branches in order to PR. but the fix is pretty trivial so here is a 2-line patch against catfact/chaos:

chaos_param_range_fix.patch (468 Bytes)


#143

I’m trying to help with documentation and would like to understand the various algorithms regarding their x values, such as CHAOS x and CHAOS.R x.

What are the ranges of values per algorithm for CHAOS.R? Such as does the Henon map benefit from different values than the Cubic map?

Same with the CHAOS x values per algorithm?


#144

thanks for the help!

mathematically, the underlying ranges are:

for cubic / logistic, x in [-1, 1] and r in [3.0, 4)
for henon, x in [-1.5, 1.5], r in [1, 1.4]

in teletype code, the parameters are always in [0, 10000] and the state is always in [-10000, +10000]

the “true” param and state ranges are chosen kind of arbitrarily, such that the algos do more “interesting things” (e.g. long periodic orbits) than “boring things” (e.g. converge on a value and stay there), and they stay bounded instead of blowing up to +/- infinity.

for more details i must refer you to the many words i’ve written further up the thread.


#145

Would you be willing to share for possible inclusion in the documentation the script you wrote for this piece called, “Grateful FM Jam?”


#146

I don’t think that I kept it. It was just an experiment and probably did not contain more than described in the post plus the usual stuff you need as some clock signal and CV/TR output operators, maybe a quantizing scene. I think I used a pattern filled with some scales around that time.


#147

In this example you choose CA, rule 25 and an initial value CHAOS 63. You then set the variable A to CHAOS, but then you poll A with the bitwise Get asking that if A = 0 then TR.P 1 else the rest of the script.

What I’m failing to understand is how if the initial CHAOS value is 63 does the A variable ever or frequently enough get to 0,1,2, or 3 to create the rhythm?


#148

Almost. The setup phase is right, but here’s what happens in the metro script. The next CA state is stored in A, and then up to four triggers are generated depending on the first four bits of A.

Each IF statement has an opportunity to run independently of the others. Execution does not stop if one of the IF stamements fail.


#149

My primitive brain wants to exclaim a string of vulgarities in its enthusiasm for what is going on with this operator.

:slight_smile:


#150

Mine, too. @zebra wrote the core code, and although I set up the scaffolding, I don’t have great insight into the nature of these algorithms, but I can’t deny their application!


#151

Any chance of you recreating a small demo patch using CHAOS and Quantization to include patch notes that could possibly be used in the user manual?


#152

No, I don’t have enough spare time to do so atm.


#153

Can anyone explain the Chaos ops for me? Is it a form of seeded random? How does the syntax work? I dont get it.


#154

There is a lot of very useful information in that thread, hope it helps!


#155

I’ll try to explain it as I understand it (ie very basically). If I make any terrible errors, I hope someone will step in to correct me.

The results are similar to seeded random, in that they are deterministic - ie. you get the same output(s) for the same input. But, they are more useful than seeded random in several ways.

There are 4 different types of CHAOS algorithms.

CHAOS.ALG 0, the Logistic algorithm has low variance, in the output, for low values of “r” (which you can imagine as a seed value for now) and high variance for higher values of r.

See this diagram from the Chaos topic:

In the diagram r is the “seed” along the x-axis and x, on the y-axis is the value that will be returned.

With the exception of CHAOS.ALG 3, the value of r that you set always ranges from 0-10000 - so there are 10,000 “seeds”. This number from 0-10000 is then mapped to the interesting portion of the graph - in this case, for CHAOS ALG 0, it is between r=3.2 (where small changes in r result in an output which is one of two potential values) to r=4.0 (where small changes in r produce a practically random output).

So to use CHAOS, we choose an algorithm, set an “r” value (along the x-axis of the function) and then the output is read from CHAOS which is a number between -10000-10000 mapped from the -1 to 1 on the y-axis.

For example:

CHAOS.ALG 0 - set algorithm to 0, Logistic
CHAOS.R 5000 - set the r value (“seed”) to half-way along the x-axis
CHAOS - read the value there, which is oscillating between 4 values

…from there you would map CHAOS to a useful number and use it to set a Pitch or Length of a gate, or whatever you want to do with your chaotic number.

As I say, the term “seed” isn’t really correct for “r” but the value of r which you input does dictate the possible outputs.

This post shows the graph for CHAOS.ALG 1, the Cubic algorithm - and @zebra explains why it is even more useful, musically, than the Logistic algorithm:

CHAOS.ALG 3, is the Cellular Automata Ruleset - these are binary arrays rather than floating point numbers. I believe it is the same ruleset developed by Stephen Wolfram in his incredible, if not humble book “A New Kind of Science” (https://www.amazon.co.uk/New-Kind-Science-Stephen-Wolfram/dp/1579550088). I highly recommend it!

@zebra goes into more detail on that here:

And check this excellent post from @sliderule on using Cellular Automata rules to generate 4 percussion parts:


Teletype workflow, basics, and questions
#156

Woah thanks friend! That is way above the call of duty, and very appreciated. I’m going to spend the afternoon digesting it all. Thanks very very much for your efforts.