now orbit has colors

Mar 01, 2009 00:58

okay, so you shamed me into implementing the hénon maps in Max/MSP/Jitter. the jitter matrix is so much better than the LCD object. (okay, no one actually personally shamed me, but i could hear your voices in my head.)

but here's the snag, and i'm feeling quite clever for solving it...

the LCD object only takes one value for color from 0 (white) to 255 (black). this makes it easy to map the iteration index to color in the LCD object. i simply run a counter object from about 50 (because white on white is invisible) to 255, and voila, i have a full spectrum of colors where it's easier to see what order the points showed up in.

however, a jitter matrix takes four values (but i'm ignoring the alpha channel...) so, in effect, it takes three values R (0-255) G (0-255) B (0-255). now, i tried iterative counters (again from something like 50 to 255). so R 50 G 50 B 50 up to R 255 G 50 B 50. then R 50 G 51 B 50 up to R 255 G 51 B 50. but, as you can see, it takes (i'm not going to do the addition, it's late) gagillions of iterations for the green to increment. and it takes gagillions squared for the blue to increment. which means that the image ends up looking like shades of red... starting to turn a sickly greenish color by the time the iterations are stuck on the attractors.

so, i was trying to figure out how to make it cycle through more colors more rapidly. and, believe it or not, the solution was in Gray code.

okay, so here's what i was thinking: i don't necessarily want all possible combinations of RGB. i just want to go through the possible combinations of the maxima and minima of RGB within a short time frame, and i don't want any sudden color changes. so, let's say Rmax (255) is 1 and Rmin (50) is 0. same with green and blue. what i wanted was something like this to happen:

B G R (this is reversed because of the way i was thinking it. it's too late for me to change now)
0 0 0 initial conditions
0 0 1
0 1 1
0 1 0
1 1 0
1 1 1
1 0 1
1 0 0
and return to the beginning.

Gray code.

so i made three ramps using the bline object (event based line object instead of time based), so that my hénon iterations controlled the steps in the ramp. and the colors were psychedelic!

best part is, now that everything's in a jitter matrix, it's way faster, better resolution, and i can play with alpha and betas and initial conditions all day.

down side is: it makes no sound.

at least i can console myself with the fact that the undergrads (who do both video and music) will surprise the video lecturer next time they're in class with him for jitter.
Previous post Next post
Up