Fractal Terrains through Audio Input

This project is a fractal terrain generator specifically designed to sample data from audio files and utilize this data in the fractal terrain height generation. In addition to generating the terrains themselves, we sought to present them in a manner that was artistically meaningful rather than simple data visualization. In that respect we animated several terrains and mapped the terrains onto spheres.

The project utilized Processing’s ability to easily render data and one of its built-in libraries – Minim – in order to gather the data from audio files and then render it. A fast fourier transform function is used to sample the audio data. From this point, the fractal terrains are seeded and the height values are generated. Our project then can draw a number of these terrains at a time as well as allow the viewer to manually rotate the screen. Finally, the terrains can be regenerated as the audio track plays – allowing the user to notice that the terrains will be generated differently based on the position in the audio.

This project was prepared for Computer Graphics II. I worked with a partner: Sela Davis

My Contributions

Sela and I both planned and discussed the project and what we intended to do with it. After that, I worked on the whole framing of the actual fractal terrain and audio input stuff and made the work with fractal terrains and sounds part of an overarching artistic piece. I handled animation, framework, color, lighting, and controls for the application. I used cubes to test it and later replaced the cubes with code Sela wrote to generate the actual fractal terrains.

Source Download

The project was built in Processing, a data visualization language built on top of Java. This project compiles and runs under the Processing 0135 Beta. This software is available freely at and utilizes a layer on top of Java. The project itself uses version 1.1 of a sound library called Minim. Minim is included with Processing, though the newest version of Minim has changed some of its calls and can cause issues with our code.

Please ensure that you are using version 1.1. To run, open the .pde file in Processing and click on the play (>) button. This code has specifically been tested on Windows XP and Windows Vista, but may run on OSX and Linux as well in Processing.

The sound file included should be in a folder named "data" in the same directory as the PDE file. You can replace this sound file with another sound file, just make sure it still has that name because it's hard-coded.

Executables Windows, OSX

These executables should demonstrate the application without Processing and the Minim libraries installed. It may run slower on less powerful machines. Try using the controls to animate and add less terrains if this is the case.


  • C: Adds the maximum number of terrains.
  • A: Adds one terrain at a time. If you are already looking at the maximum number, it will reset to showing 0.
  • T: Changes the colors of the terrainsa.
  • G: Rotates the X values of the terrains slightly. (Based on the terrains' origins)
  • H: Rotates the Y values of the terrains slightly. (Based on the terrains' origins)
  • J: Rotates the Z values of the terrains slightly. (Based on the terrains' origins)
  • D: Toggles sphere terrains vs. box terrains.
  • S: Toggles whether or not the terrains are moving.
  • P: Restarts the music after it has finished. Do not hit until the track is complete or has been stopped.
  • L: Starts the music
  • F: advances the animation one frame at a time. Tap to move forward 1 fame and hold down to continuously animate manually
  • Finally, the x-value of the mouse over the window controls the zoom.