L system music revisited

I’ve hacked a different way of interpreting l systems which is more suited to time based patterns, such as for music. Instead of parsing the rules into a long string in one go (as I used to do for pattern cascade), this version uses a stack based method to evaluate them continuously, meaning that they use up much less memory and the processing time is spread out – this means you can set the recursion depth much higher, or should that be deeper? The code is here.

Here’s an example run, although be warned that the synth patches I’m using are rather untamed (partly due to the mood I was in when composing 🙂

The rules for this are:

cCBca-aa/c-d-c<.d/b++b+ACd

Which I think is quite a good compression ratio for the complexity resulting - this is an important aspect of the 'livecode-ability' of a procedural approach, less keystrokes equals more time to think about what you are doing. If the embedded thing doesn't work, the archive.org page is here

Flat Gardens

Playing with some doodled textures and a flattened l system. The components of the plant are now properly parented together, so you can animate them – rotating branches moves the whole subtree, as you’d expect.

The code for this is here. BTW – if clicking on that asks for a password, try it until it goes away (it’s not really password protected, I’m not sure why it’s doing that).

Treetris prototype finished

This game prototype is pretty much done. The completed tetris lines now trigger the tree growth, so if you play long enough the tree obscures the game 🙂 I also set the block colours to be consistent, which seems to be important, as they reinforce the shapes as you get used to the game.

The blocks are deformed by the radial grid which makes them hard to recognise at first, so I also tried making the grid visible, resulting in a cobweb, which does make the game easier, but moves it too far from nice organic plant shapes:

First plant perspective

The game works now! It’s actually quite playable. The fact it’s tetris isn’t really important, more that it helps think about playing a game from a plant’s POV – the blocks could be nutrients provided by the roots, which you fit together to grow your plant. The problem is that you can’t see yourself, (the central player plant is still there, just clipped from the camera). I need to look at more of a third plant perspective next.

The code is here.

Circular tree tetris

I’ve put the tetris logic in the fluxus script, and stuck a tree in – some way to go yet… You still can’t actually play it, but the blocks fall into place properly. It might be quite challenging to play like this as it’s quite difficult to predict where the blocks will fall. Some camera movement may help, if it tracks the currently falling block. I also need to plug the lines created into the tree growth, and do some work on the clashing visual styles 🙂

ASCII tetris


..............................
..............................
..............................
....................##........
....................#.........
....................#.........
...........................#..
....###...................##..
.....#....................#...
##############################

Retro games, and ASCII for extra points! A quick script hacked together in pure PLT scheme to use for the game prototype, no actual interaction yet. It’s surprising how small the code is, I was expecting it to be harder to do. I think I’ll need to do more checking when you can drive the blocks, i.e. prevent moving left and right or rotating if there is a collision.

More ASCII output, and the code is here.


..............................
....................##.....#..
....................#.....##..
...........##.......#.....#...
...........#........###.......
..##.......#.........#........
..##......###.......##..#..#..
.######...#####.....#..##.##..
..#..#....##.######.#..#..#...
##############################