Animated Visual Synthesis with MAX/MSP

After using 256 color VGA for a few years to code graphics I wanted to learn a programming system which allowed high color and variable resolution. A unique solution appeared in an unexpected place. I had been using Max/MSP for a while to make sound and sequence some of my music. I knew that there were extensions such as Jitter, that allow the creation of graphics - but I wondered if anything cool could be done with the stock set of basic objects. After some experimentation, I found out the answer is YES.

Max offers a pallete of objects to drag and create your audio and MIDI application. One of these is an object called LCD which is a resizable display upon which pixels can be plotted. This object seems to be utilized mostly for simple graphical tasks such as displaying musical staff, plotting data points, or displaying colored primitives (square, line, circle).

But, the LCD also allows plotting of single RGB colored pixel with the message "setpixel". This is the key. My thought was that if you can plot a single RGB pixel, then you should be able to do anything! By systematically translating the concepts from MOTH 1.0 into groups of Max/MSP objects I was able to recreate the concept in 16 bit color, at any resolution desired. The next step was to impliment oscillation of the parameters and interpolate the data to create animation sequences. This was a huge moment for me, the first time I created a system to generate animation.

The way it works, is by going through each pixel in the LCD object one-by-one. For each one of these pixels, a color is computed from attributes of that pixel. So for example, a simple gradient could be created by setting [ color=pixel's x position]. This color number then refers to a gradient which has already been designed by the user. So color 0 might be (#000000), color 1=(#0100000), color 2=(#020000) etc. You can see those are the first 3 entries in a gradient from black to red. Of course, the calculation of the color number can be extremely complicated, by using trig functions, multiple equations with mixing, etc.

CLICK HERE FOR AN ANIMATION.

The working version's interface:

Here is the color palette designer:

Some of the sub-objects:

Here is a variation on the concept, this time generating adjustable mandelbrot sets.

Scheduling these events in Max/MSP was tricky. This program crashed the computer hundreds of times before the exact working method was developed. It is very important to be very specific about event ordering. You must always use TRIGGER objects instead of making multiple connections from an output to an input. The basic working routine was as follows:

- (Loop through all pixels)
- For each pixel, store X,Y,r1 (distance from a movable point), r2, theta1 (angle from the point), theta2
- Calculate color number from these values
- Set pixel in the LCD based on the RGB value from the gradient
- Move on to next pixel.

Since MAX/MSP is not optimized for this huge amount of floating point calculations (many millions per image frame), these images sometimes took many minutes to render. And while the images were rendering, the machine sat in a 'dead' state while Max completely dominated all processor functionality.

CLICK HERE FOR AN ANIMATION.

Max/MSP 4.1 is an amazing tool. The fact that it can be molded into a program such as this shows its flexibility and robustness. The LCD object, and the nature of the handling of numbers in Max are not intended for this kind of use, but it does get the job done. For more complex processing and effects graphics-specific development tool is needed. Using Jitter would allow for more optimized graphics production. However since I wanted to create more powerful flexible standalone apps, the next step was to move on to openGL in the Mac OSX Cocoa language.

DOWNLOAD