Blog  |   Puzzles  |   Books  |   About

Wheel Music

June 21st, 2006

Wheel Music is another music visualization, using similar techniques to those I used in my Whitney Music Box.

Each dot in the animation represents an individual note you are hearing. The notes are slowly traveling around in a circle. Each square represents a different tone cluster, or chord. Colors represent note values, and the radius of the circles is loudness.

The “Wheel” in Wheel Music is a recurring theme in a lot of my pieces, which often involve circles, oscillation, and radial symmetry. The cylindrical pattern that the notes form is reminiscent of a barrel organ, one of a handful of automatic instruments which this piece is intended to evoke, others being player pianos and wind chimes.

I made Wheel Music using various technologies, including Python, Syd, and Flash.

The score was generated using a Python script which generates note values and outputs to them to a text file in the SKINI format (similar to MIDI but more flexible). My software synthesis program, Syd, was used to render the audio score as a WAV file. I wrote another script which converted the SKINI score into an actionscript array, which I used to render the animation in real time in Flash, the animation is a literal rendition of what is going on in the score.

Mac & Cheese Fibonacci Spiral

June 15th, 2006

Flickr Mosaic: In Numerical Order

Krazydad Irregular Ryan Govostes writes:

Hey Jim,

I noticed a neat phenomenon while making myself a bowl of nutritious EasyMac (the fake microwaveable macaroni-and-powdered-cheese product from Kraft). The first step is to pour the noodles into a bowl and add a bit of water, then microwave for a few minutes. Now, obviously, when you put the noodles in the bowl they’re all jumbled up and arranged in no real order. When I pulled the bowl out, though, the noodles had all arranged themselves into a magnificent phyllotaxy-like pattern, with all the noodles oriented approximately the same way and no overlap.

I was too hungry to stop and take a photo, but it’s an easily repeated experiment. Happen to know the science behind this mystery?

I’m still hoping to acquire a photo of this magnificent phenomenon, but in the meantime here’s a guess:

The fibonacci spiral is the optimal way to pack circles in a round container – each circle gets the maximum amount of space. So, when the water heats up, the noodles are going to jostle and push against each other and find that optimal packing, kind of like corks floating in a bowl.

Goodbye, Gyorgy Ligeti

June 12th, 2006

One of my favorite composers, Gyorgy Ligeti, died this morning at the age of 83.


Time for a little Lux Aeterna.

Tag Cloud Tips

June 10th, 2006

What are Tag Clouds, you ask? Here’s a sample.

I’ve provided some tips for building Tag Clouds at O’Reilly’s ONLamp website.

This is an excerpt from my longer article, Building Tag Clouds with Perl and PHP.

Google US Puzzle Championship

June 10th, 2006

Registration is now open for the Google US Puzzle Championship, organized by Nick Baxter and Will Shortz. Players have 2 1/2 hours to complete 25 fiendishly difficult puzzles.

Mosaic Blossom

June 8th, 2006

Mosaic  Blossom #2

I’m currently working on a series of mosaics using landscape and animal photos. Here’s a sample.

UPDATE: I received a letter about this image. Here it is.

I love the work that you do, and I have a question about what an algorithm is. Is it math that you can Javascript, taken from an abstraction of poesy, or is it abstracted image?

I have a Javascript called “fireworks”, and the original colours and pattern of the work conjures up a whole poem by someone admiring a beachline by sunset.

Yours seems to say: Rose image. “I love roses”, and image synthesized from dew delineating rose shaping.

I am an artist, and I see things like this, but I never get to check things out.

How do you make an algorithm? is it hard?

Best regards,

Sue

My answer:

An algorithm is a detailed set of instructions. For example, here is an algorithm for acquiring a loaf of bread.

  • Walk out your front door.
  • Walk down the street to the east until you get to the corner market.
  • Walk into the market.
  • Walk to the bread aisle.
  • Choose a load of bread.
  • Take the bread to the counter.
  • Purchase the bread.
  • Walk home.

An algorithm can have more instructions than this. For example, in the above algorithm, I did not provide instructions for opening the front door. I did not provide instructions for the baker who is baking the bread. I did not provide instructions for how to walk. If I were writing such an algorithm for the computer, I would have to be much more detailed, because computers don’t have the common-sense understanding that humans have. I would have to explain everything in excrutiating detail. Walking to the store and buying bread is extremely difficult for a computer, because the algorithm it needs is very long and complicated. This is why we don’t see a lot of robots walking the streets with loaves of bread.

Computer algorithms generally involve manipulating data. That data might be words, colors, sounds, monetary values — all kinds of things. But ultimately, the data is represented as numbers. So, for example, the color pink might be represented as individual RGB values (red=255, blue=190, green=185) or just 255,190,185.

A sound can be represented as a series of numbers which indicate which direction the cone in the speaker moves when the sound plays back. Positive numbers move the cone forward, and negative numbers move the cone backward: 0 20 30 20 0 -20 -30 -20 0

So, the data that is being manipulated is numbers, yet it is also, simultaneously, an abstract image or poetry, or whatever the data represents. The algorithm, which tells the computer what to do with the data, involves math, because it is manipulating numbers, but it can simultaneously involve non-mathematical ideas, such as painting.

Making an algorithm for a computer involves being able to translate from the world of human concerns (painting, cooking, writing, whatever) to the more symbolic and numeric concerns of the computer. It is a skill that is acquired with time. I suspect that some people have a natural affinity for it, and can learn it more easily.

There are also some programmers who are not particuarly interested in human concerns, so they tend to translate one level of computer concerns to another level of computer concerns. These folks are “low level” or “system” programmers.

I myself am a “high level” or “applications” programmer, because I like making software that involves more human-centered issues, such as user interfaces, software toys, art and music.

So yes, making the image above involved some math, but it also says, “I love roses,” or perhaps more accurately, “I love the processes that cause things like roses to happen.”

If you’re interested in learning more about this subject, a good book to read is “The Pattern on the Stone,” by Danny Hillis.

Petals around the Rose

June 3rd, 2006

Petals around the Rose is a puzzle in which you must figure out an underlying system based on the roll of 5 dice. It took me about an hour to figure it out. Some people get it right away, others take months.

Here are two versions.

Chris Davis’s version (flash)

Lloyd Borrett’s version (javascript)

Virgin Territory

June 2nd, 2006

While on a morning coffee run with a coworker, we chanced on the subject of religious experience, and I mentioned that exploring mathematics is the closest I’ve come to a religious epiphany. Although this notion is probably familiar to folks versed in the physical sciences, my friend was surprised to hear it. I brought up fractals made with complex numbers as an example, and was pleasantly surprised to find that my friend was unfamiliar with them.

On getting back to the office, I fired up a windows program I had written a couple of years ago.

“Look at this shape. Have you seen this before?” I asked.

“No,” my friend said, “it looks kind of like a Buddha!”.

My heart skipped a bit as I realized I was in the presence of a Mandelbrot virgin. There was only one thing to do. Zoom in!

So I pressed the left mouse-button and proceeded to give my friend a guided tour of the hidden buddha-nature of this complex landscape. It is always a pleasure to introduce the Mandelbrot set to a newbie. Zooming into it for the first time is like opening up a fresh jar of wonder.

My program exploits the acceleration on modern graphics cards to do fractal zooms in real-time. You use the left-mouse-button to zoom in, and the right-mouse-button to zoom out. There are various other keys that do things, but that’s all you really need. As I explored and explained some different locations in the mandelbrot set, my friend sat there and said “Wow!” repeatedly, as unjaded Mandelbrot virgins are wont to do.

This was also a good time to explain the bizarre concept of “imaginary numbers,” so I made a stab at that too. I must admit, I still find imaginary numbers damnably counter-intuitive. I’m just glad they make such pretty pictures! The only other time I’ve encountered them in my work is in making pretty music – they are also used in audio effects processing.

Later, when my friend asked for some links to some software for exploring the Mandelbrot set, I had a hard time (using Google) finding software that does these kind of continuous zooms (although I’m sure there is lots of it out there). There is tons of Mandelbrot software on the Internet (writing such programs is a common hobby for newbie graphics programmers). The heydey of Mandelbrot exploration was probably the late 80s and early 90s. The problem is that a good deal of the Mandelbrot software that is out there and easiest to find was written some years ago, and is designed to generate still frames only. So there’s a lot of noise covering up the good stuff, and a need for simple programs with more intuitive interfaces.

Then there’s my software. Even though it’s a bit half-baked and completely undocumented (I just wrote it for my own use), I thought I’d provide it here, for those that lack a suitable substitute. If you have a friend that is a Mandelbrot virgin, you too can add a little wonderment to their world.

Here is my program, MandelZoom. Like I said, windows only.

MandelZoom supports the following commands, which are single keystrokes:

Escape Quit the program
Home Reset
Page Up Change Rendering Style
Page Down Change Palette
f Toggle Full screen
j View corresponding Julia set
p Take a screen snapshot
arrows Pan

There are a few other hidden commands in there (+ – [ ] space), which I’ll leave undocumented, for messing with the colors. You’ll figure them out if you dig.

Although this is a windows program, the source code is fairly portable. At some point I’ll get around to putting up a Mac executable. If you’d like to compile it on another platform, and you’re familiar with OpenGL/GLUT programming, here is the source code. Don’t try this if you’re not an experienced programmer. I love getting your emails, but it is not a good medium for me to teach you C++. :) If you manage to do a successful port, let me know, and I’ll link to it below, when I update this post.

No doubt, there are much better programs out there, with the same real-time zoom capabilities. If you know of them, please tell us in the comments, and I’ll mention the better ones below as well.

UPDATE: Krazydad irregular Ryan Govastes points us to a more full-featured cross-platform program called Xaos. Oooooh. Smooth zooms! The first of many, I am sure.

Krypto Kakuros in Games Magazine

May 26th, 2006

Hey look at that! I managed to sneak a few of my Krypto Kakuro puzzles into the July issue of Games Magazine!

Welcome puzzle solvers! If you’re visiting Krazydad because you want more puzzles, you’ll find ’em here.

Also, you may enjoy the various offerings in the fun & games section.

Processing Group at Flickr

May 26th, 2006

Logarithmic Starburst

The Processing group at Flickr contains a gallery of stunning images created with my favorite language for making motion graphics and algorithmic art: Processing.

As I’ve mentioned before, processing is an excellent first language for budding algorithmic artists.