blocks

Recursive algorythms have been in use for decades in computer graphics, from the old "LOGO" turtle graphics programs, to more advanced graphics applications like "fractint". It's use within audio has never been done to the best of my knowledge, and I definetly have not yet explored even a tiny fraction of the limitless possiblilities.

Essentially the Recursion program will take a string of commands, Iterate over them a specified number of times, to generate a long commandcode. Finally it executes the command code and draws a waveform.

EXAMPLE: DRAGON CURVE
The script was run using the "dragon curve" which looks like this in graphics renderings


The command key (axiom) that builds the commandcode looks like this:
commandaxiom = ["F","X"]
productionreplace = ["Y","F"]
productionreplacement = [("X","+","Y","F","+"),("-","F","X","-","Y")]

It starts with the string FX. Then it goes through and replaces each occurance of "F" with "-FX-Y", and each occurance of "Y" with "X+YF+". This gives us "-FX-YX" on the first pass. The recursion was repeated a bunch of times, resulting in a long string of commands.

I ran this command axiom with all kinds of different settings to generate a bunch of related waveforms. Here are a few selected samples:

EXAMPLE DRAGON 1:

PLAY

EXAMPLE DRAGON 2:

PLAY

EXAMPLE DRAGON 3:

PLAY

EXAMPLE DRAGON 4:

PLAY

EXAMPLE: ALGAE GROWTH
commandaxiom = ["A"]
productionreplace = ["A","F"]
productionreplacement = [("F","[","-","A","]","[","+","A","]","F","A"),("F","F")]

EXAMPLE Algae 1:

PLAY

EXAMPLE Algae 2:

PLAY

DOWNLOAD the recursion source