Saturday, February 23, 2013

Music Reactive Wolfram Automata

Wolfram based automata that change their ruleset based on the FFT values of music


Modified the "Wolfram Automata" example in processing to do the following:
  • Radiate from a center point
  • Use colors (Red, Green, Blue)
  • Change the ruleset in response to sound, keyboard, or mouse input
  • Work online
Really it just serves to makes pretty pictures and act as a novel way to do music visualization.




It's terribly hard to find a video capture program that handles sound and doesn't suck. The one I used has crappy quality and causes weird stuff like black boxes occasionally. Run the actual program for much better results. All music was obtained via royalty free music.
  • Ghost Procession -- Very simple song, shows them obviously reacting when a drum beat hits
  • Frost Waltz -- Harder to see a 1-to-1 correspondance to sound and behavior, but makes much nicer patterns

Design For Music Input

Other forms of input are pretty self explanatory, the music input was not. Basically it is taking the fast fourier transform, averaging it, taking ten of those (one for each rule) and then mapping that to a rule (ie. Off, Blue, Red, Green). This doesn't work at all though, because constantly changing rules means you don't get pretty repeated patterns. I tried several things, such as keeping track of the maximums, but had the best luck with comparing the previous value to the current one, and incrementing or decrementing appropriately.
I also found that it takes a while for the rule corresponding to no active neighbors to change, so I set up the initial pattern as random noise, which makes it so changes start coming right when the first piece of sound is played.
Frames and music playback in Processing don't necessarily sync. This results in 2 issues. First that playing back a song doesn't produce the same results, and that sometimes events are slightly out of sync (You see it before hearing it, by a frame or 2). I added a little bit of alleviation to the latter by averaging previous values.
A tolerance is needed for each individual song. Since quickly changing the ruleset kills the ability to make patterns, faster paced songs usually need a higher tolerance to get decent results.

Source Code


Well the pictures look pretty, and alot more interesting than the original example. Not sure how usefull the 'Wolfram' definition for automata rules is though, since it seems needlessly restricted. The music input worked pretty well, but took a lot of tweaking (Thus the delta definition). Revisting this several years later I realize how crap the video quality is.  Maybe one of these years I'll make it better, or bundle the whole mess into Hypernova :P

No comments: