=> 🏠 home

1-dimensional cellular automata in ORCΛ

2023-10-28

Encouraged by randomly discovering a binary counter, I made a cellular automaton.

I've introduced the ORCΛ only recently on this gemlog. It's a grid-based system that can generate MIDI messages to be picked up by external instruments, to compose / compute music in a live-coding kind of way.

The thing is, ORCΛ is not a musical instrument. It is a language. A weird one, made by weird people living on a boat. A minimal one, a cryptic one.

I love minimal, cryptical geek-things.

The other day I created a binary counter in ORCΛ through a lucky typo. Musical instruments don't generally do binary counters, programming languages do.

For reasons that deserve at least one separate journal article, I've taken that happy accident and ran with it. I made a one-dimensional cellular automaton.

It is limited by the fact that ORCΛ — to my knowledge — has no means of counting further than 36. Due to the math I'm doing to calculate cells and their neighbours, the playing field is limited to a width of 36 / 2 == 18 cells. Not very impressive but it does get the message across.

What I really like is that the code can produce all 256 varieties of 1-dimensional cellular automata simply by entering the associated Wolfram code in binary form into the sequence of the T operator of ORCΛ. Another happy accident in a way.

I've tried to make the code somewhat well-commented. It was important to me to keep the code itself compact, to get as much space as possible for the playing field itself.

I unfortunatelly have no easy way to introduce syntax-highlighting here on gemini so the code will look somewhat crappy in the gemini browser of your choice. It will be somewhat more readable once loaded into ORCΛ.

    #....................................#......#.numeric.pointers.................#
    #.......1d.cellular.automaton........#...................Ci......Ci........iCm..
    #....................................#.................hAf.1X..1Af.1X.....aA2...
    ..................................................Ci....wYYwIi..gYYgIi...yVc....
    .#.block:.inject.y.offsets.#....................xVf.......0Ve.....2Vg...........
    ......Vy....................................#.middle.cell.left...right..column.#
    ....Vyc...Vy....................................................................
    .d2Xc.Jd2Xc...#.block:.read.3.neighbour.cells.#.................................
    ...8..J..5......V0.Vx.V2........................................................
    ...e0Xc.......6Ae3Af0Ag.........................................................
    ...............kcOicOgcO......#...read.from.offsets...........#.................
    ...............4M.2M.1M.......#...multiply.with.powers.of.two.#.................
    ..............lV0mV0rV0.......#...store.in.variables.l.m.r....#.................
    ..............#.block:.calculate.child.cell.value.#.............................
    ................Vl..Vm..........................................................
    #write.offsets#.0Y0A0..Vr.......................................................
    .......Vy..........0Y0A0........................................................
    .....9Bc...Vx.........0B7......#.build.decimal.sum.of.binary..#.................
    ...i0X3.c0Xf...........78T...1111....#.......T:.Wolfram.rule.in.binary.........#
    .....3................f3X......#.write.child.cell.value.......#.................
    ............#.0.#...............1...............................................
    ............#.1.#...............................................................
    ............#.2.#...............................................................
    ............#.3.#...............................................................
    ............#.4.#...............................................................
    ............#.5.#...............................................................
    ............#.6.#...............................................................
    ............#.7.#...............................................................
    ............#.8.#...............................................................
    ............#.9.#...............................................................
    ............#.a.#...............................................................
    ............#.b.#...............................................................
    ............#.c.#...............................................................
    ............#.d.#...............................................................
    ............#.e.#...............................................................
    ............#.f.#...............................................................
    ............#.g.#...............................................................
    ............#.h.#...............................................................
    ............#.i.#...............................................................
    ............#.j.#...............................................................
    ............#.k.#...............................................................
    ............#.l.#...............................................................
    ............#.m.#...............................................................

update: 2023-10-29

I've restructured a lot of the code to make the generator more compact.

While doing that I've also removed the comments. The code is now a bit less readable but with the first version above this shouldn't be an issue.

Currently I'm working on widening the usable playing field to generate wider patterns but I'm suffering a lot of brain-fog today, this will have to wait.

    #.1d.cellular.automaton.#..................................
    ...........................................................
    ..Ci..............zVo...#.z.is.number.of.rows.to.generate.#
    mVeYYYYYYYe.........J......................................
    ..J.......J.......iCo......................................
    hAe.1X..1Ae.1X...9Aa.......................................
    .vYYvIi..fYYfIi.yVj....Vy..Vy..Vy..........................
    ...lVd.....rVf......22Xj12Xj.2Xj...........................
    ........................Vl.Vm.Vr...........................
    ......................6Ad.Ae.Af............................
    .......................jjOhjOfjO...........................
    .......................4M12M.....#.interesting.rules......#
    .....................21X4..0...J.#..30.00011110....a.RNG..#
    .................Vz........J...J.#..90.01011010.Sierpinsky#
    ............Vy.1Xo.......4A0...J.#.110.01101110....Turing.#
    ..........8Bj.1X..........4YY4A............................
    ...........bYYbIo.....Vm......4B7#.Wolfram.rule.in.binary.#
    ............h.Xb...90Xe........38T...1111..................
    ..............................ebX1.........................
    ..........................#.0.#.........1..................

Links

=> My journal on ORCΛ and Sunvox, my music-making setup | ORCΛ on Hundred Rabbits' internet page | Wolfram code for 1d cellular automata


=> see all my articles

Proxy Information
Original URL
gemini://laniakea.rodoste.de/journal/2023-10-28-cellular-automata-in-ORC%CE%9B.gmi
Status Code
Success (20)
Meta
text/gemini; lang=en; charset=utf-8
Capsule Response Time
209.750957 milliseconds
Gemini-to-HTML Time
0.704683 milliseconds

This content has been proxied by September (3851b).