I’ve been playing with Lindermayer’s L-Systems these days, in supercollider the Prewrite function, and one of the things I wanted to experiment with is applying the golden ratio to the system itself. My maths is quite limited and I didn’t manage to do it.
The idea would be as follows:
~phi = (1 + sqrt(5)) / 2;
// Definition of the system L
~axiom = ‘A’;
~rules = (
A': “AB”,
B': ’A’
);
But I got errors on all attempts. Has anyone ever tried it successfully ?
This blog post and the accompanying thesis are on L Systems, focusing on using them in SC. The code was updated to work on a more current version of SC in 2016. There is also the disclaimer that you’ll need the wslib quark. Hopefully this is a helpful starting point at the very least.
Here’s my attempt at a simple binary L system. I’m not sure how you’re incorporating the golden ratio, though.
(
~rules = { |x| if (x == 1, {[0, 1]}, {[1]} ) };
~lSystem = {|seed, rules, n = 1|
// Var to store most recent iteration
var prev = [seed];
// For each n iteration
n.collect{|i|
// Evaluate rules for each item
prev = prev.collect{|item, j|
rules.(item);
}.flat;
};
}; // ~lSystem
)
~lSystem.(0, ~rules, 5)