## David R. Lorentz

I'm an independent Flash game developer, with a background in lots of types of game design. My web site is davidrlorentz.com.

Somehow I ended up attending three sessions today that revolved around very similar concepts in generative art. If it wasn't already clear, it is now totally clear that when mathematical algorithms meet Flash's unique powers of visualization, great art is born. (Sometimes.)

The three sessions in question are those of Alec Cove, Mario Klingemann, and Joshua Davis. These sessions were in some ways amazingly similar, invoking procedural repetition of elements to produce visually appealing output, but it is very interesting to compare and contrast the differences in the ways these three guys approach the task. What is the artist's role in algorithmic art? Should he be massaging the algorithm, or massaging the output? Well, apparently either way's fine.

**Alec Cove's talk, “Beautiful Algorithms: Design from Nature and Mathematics,” **centers on deterministic algorithms (containing no randomness) that transform minimal initial conditions into complex and beautiful output. This output often resembles patterns seen in natural organisms such as flowers and seashells, which, as Alec points out, is the result of algorithms in the DNA.

Alec's slides are available here. Here's a quick summary of what he went over:

- Repetition combined with geometric transformations (scale, rotation, translation) yields interesting patterns. Examples include corn, spikes on a cactus, mandalas in Darmic art, and plants in general.
- In a sunflower, for example, seeds are packed in a golden spiral pattern. This is actually the most efficient way to pack seeds into a limited space, and it looks beautiful to us; apparently there is some beauty in efficiency.
- Cellular automata – a conceptual simplification of biological cells, whose life or death depends in various ways on their neighbors. Manipulating the binary life/death rules yields tons of variety – unstable patterns, stable repeating patterns, and stable chaotic (non-repeating and non-dying) patterns. Examples of this include Conway's Game of Life, and Stephen Wolfram's opus,
*A New Kind of Science.* - Other examples: L-systems; reaction diffusion; sound vibrations; chaotic systems such as the Lorenz Attractor.

All of Alec's experiments involve deterministic systems—nothing is randomized. The complexity comes instead from the interplay of the algorithm with the initial conditions, yielding either a chaotic system or something that is complex but repetitive. Alec’s artistic method seems to center around picking the right algorithm: he plays with lots of different algorithms till he finds one that is pretty. Once he finds it, the next step is to find a good visualization by playing around with things like colors and alpha.

The overriding point of Alec's talk (or one of ‘em, at least) is that repetition + variation = beauty.

**Mario Klingemann's talk, “The Tinkerer's Box,”** explored algorithmic art from a different angle. Most of the algorithms in Mario’s talk rely on randomness for their variety, as opposed to the chaotic non-random systems from Alec’s talk.

Mario’s slides will soon be available here. Here’s a summary:

- The topic of this talk is the various algorithms Mario has been playing around with to generate interesting visuals. He starts off by describing why the iterative playing-around process is so important to him; he feels that tinkering is important even if the end result is not meaningful. If you manage to create something meaningful along the way, he says, that’s a bonus.
- Chapter 1 is subdivision—drawing lines within a polygon to break it into sub-polygons. Mario demonstrates how subdivisions can be evenly spaced, producing an even (and boring) output, versus random orientations, which produces more irregular (and interesting) output. Some of these are automatically generated, but in most examples Mario generates a subdivision by clicking in the area he wishes to subdivide. This allows him (the artist) to drive, or at least impact, the final output.
- Everything Mario shows is being generated live in swf’s, which is fun to watch. Most of his examples have a menagerie of sliders and buttons to manipulate the algorithm; most of the time Mario doesn’t remember what these controls do, since he neglected to label them after coding them up.
- As Mario’s examples of subdivision progress, the pictures gradually get prettier and prettier. As a grand finale to the subdivision chapter, Mario demonstrates a system in which a photo is obscured beneath a colored rectangle. Each time Mario clicks, a subdivision is generated, with each new polygon taking its fill color from the center of the underlying portion of the photo. The exact position and angle of each subdivision is randomized, leading to irregular output. As he clicks and clicks, generating successively tiny triangles which act like irregular pixels, details start to emerge. He clicks more for extra detail in important areas of the photo; other areas are left barren. When it’s done, it looks crazy and beautiful.
- Chapter 2 is stippling: using a distribution of dots to represent a grayscale image.
- Chapter 3 is convolution. Using a photo or other image as a base, simple convolution filters can be applied on the pixel level to determine the
*x*and*y*component of nearby angles, generating an angular signature for the area. - One of the things Mario does with convolution filters is draw little linear brushes on various spots in an image (generated randomly, of course), where the orientation of the brush is determined by one of these angular convolutions, and the color is sampled from the underlying pixels in the image. The result is a swirly Van Gogh-type effect. Mario points out that this, as well as lots of the other toys he’s been showing, is available in the free web-based tool he’s been working on at http://aviary.com/tools/peacock.
- One of the last points Mario makes is that all of the algorithms he uses—from convolutions, to line intersections and calculating new polygons, and everything else—come from outside sources, such as books on numerical algorithms in C, Wikipedia, and Mathworld. He also looks at proceedings from Siggraph; he claims that he only understands 10% of what he reads there, but it’s enough to get him started tinkering. He equates this whole process with playing Legos—finding formulas here, coding tricks there, and sticking them together in every which way till something good comes out.

Rather than looking to nature for his algorithms, Mario looks anywhere and everywhere; he *tinkers* with these algorithms in an iterative process where nothing’s out of bounds, till they start producing interesting output. The artistic method here is much more deliberate than the one described in Alec’s talk. The choice of algorithm is arbitrary; additionally, in many of Mario’s examples, the artist drives the output itself by, for example, clicking to generate subdivisions. Quite opposite to Alec’s talk, here there’s randomness everywhere: in the code itself, in the complex initial conditions (an entire photo, for instance, as opposed to Alec’s single pixel or two chemical points), and in the artist’s choice of where to generate subdivisions.

**Joshua Davis’s Talk, “Space,”** recounted the trajectory of Joshua’s recent explorations in generative art, with several examples of algorithms he has used and the process he went through to massage beauty out of them. Sound familiar? Yeah, that’s how I felt. Of course, there are some critical intricacies to Joshua’s process that make it completely unique.

Here’s a summary of what Joshua talked about:

- Repeated reference to Red Bull, as Joshua attempts to fit 3 hours of material into 60 minutes.
- Quite like Mario, Joshua expounds the virtue of constantly giving himself new projects—new stuff to play around with and learn from, as if he’s constantly going to school. Recently, Joshua has been giving himself projects related to the concept of space, partly in order to address a convention themed around space he’ll be speaking at later this year.
- The first example Joshua demonstrates is an orbit system, which simulates orbits. The code randomizes initial conditions, such as planet mass, position, and velocity, then simulates a Newtonian orbit. To get something interesting out of this, Joshua simply throws some interesting visual pieces into it—these could be anything, but generally they tend to be little objects that he illustrates by hand. He sets these bits off in their random orbits, and sits back till he finds a good, artistically satisfying moment to snap off a screenshot. And there it is.
- Joshua points out that he is using OOP to re-use code and save a lot of time in his work. This example is his “Orbit” class, which he can plug in wherever he wants. Using Orbit in combination with different pieces of art and other classes, he can generate totally different pieces of art for diverse clients.
- Another experiment Joshua describes is his quest to make a good-looking kaleidoscope image. The important thing with any kaleidoscope is that it can work with any arbitrary set of visual data. So after coding up a Kaleidoscope class, he set about fiddling around with different inputs until he found something he liked. He ended up plugging in a set of little illustrated Christmas bulbs and snowflakes, which he has illustrated with a muted, earthy color palette. Lo and behold, the output of these was beautiful, and Joshua ended up giving away prints, each one unique, as Christmas gifts. Joshua is currently finishing up an iPhone app called “Reflect” which uses this kaleidoscope tech. He’ll probably make tons of money off of this—another example why you should build your algorithms as classes!
- The last experiment Joshua shares is based on Bezier curves. Like Mario, Joshua makes no attempt to memorize or even understand the math; in this case he simply took a simple Bezier tool someone else had helped him code up, and started messing around with it. Bezier curves require four points: start point, end point, and two anchors to define the curvature. Joshua realized that if he set up rectangles to define areas within which each of these points can be randomized, the result is a complex “flow” of particles. Joshua demonstrates moving shapes along the curves, then deforming the shapes along the curves, which looks cooler. He then shows that turning down the alpha has a huge effect, giving the flow a cloudy appearance. All of these manipulations were the result of Joshua dicking around, and the final result is breathtaking.

Joshua calls his artistic method “computational design.” As he puts it, “I write code to make design.” I imagine Alex and Mario feel the same way, at least as far as their sessions are concerned. All of these guys have demonstrated how a Flash developer can take a mathematical method and tweak it one way or another until he ends up with something that looks good. Joshua’s method of tweaking relies heavily on duplicating and manipulating artistic elements that were illustrated by hand. Mario’s method relies on lots of randomness, and control over where to apply the algorithm. And Alec’s method depends more on carefully constructing algorithms and initial conditions, in order to produce art in a completely deterministic manner.

Clearly, any of these methods works. The important thing is that all these techniques allow some form of artistic control—parameters, visualization, and simply the ability to choose when to take a screenshot in an evolving system. Lesson learned: repetition + variation + artistic control = beauty. At least, sometimes.