by Jennifer Hsu - email@example.com
A world where sound, nature, and tree generation are woven together
I have always felt that sound and music are natural sources of growth and progression, yet I have never seen this actually occur in nature. It's strange because it seems natural to pair sound up with something that continues to grow and progress. Yet, because things in nature take much time to grow and change, we are not able to experience this partnering of sound and growth in nature. With computers though, we can build things that do not and will not ever exist in the physical world. And so I decided to make a system where a person plays sounds/music and watches how these sounds pair up with tree growth.
I wanted to create a toy/instrument that enables the user to experience a mixture of both relaxation and fascination. The soft, sustained sounds and light, pastel colors should offer a source of relaxation. The fascination portion comes from the way that the user can control what happens on the screen through the sounds that are created. The user can observe something that never happens in the real world: nature actually growing in response to one's actions. I had hoped to stir up this kind of complex mood and emotion in the person that uses my software.
I created this program with C++ along with OpenGL for graphics and the Synthesis ToolKit for audio.
On the graphics side of this program, we have this big world that includes the moving clouds, the snow on the floor, and the trees that grow. The moving clouds in the background are generated with Perlin Noise and then binded to a quadrilateral shape. A simple incrementing static variable keeps the clouds scrolling until the end of time. The snow is also just a quadrilateral with another Perlin Noise-generated texture to add depth. The trees that grow are part of the Tree object class. The Tree object class contains three different types of trees modeled after fractal trees generated by L-systems. The trees that are drawn each time are chosen randomly, so we get a different scene each time. Additionally, each tree has a vector of leaves that are objects of the Leaf class. Each leaf moves (or flutters) a bit for their lifetime on the display.
On the audio side, we have a midi input device that feeds notes into the program. The notes that come out are sums of sine waves at different frequencies. I added some reverb and an envelope to smooth out the sound. Depending on the number of midi notes being played, the trees grow at a different rate: the more notes played, the faster the current tree grows. Last, I used the STK Granulate class to separate chosen sound files into chunks and tweaked these chunks to create a different sound. Thirty percent of the time current tree splits and branches, one of the chunks of the soundfile associated with the currently branching tree will play for as long as the midi note is held down.
If you are curious about the code for this project, feel free to download the source code HERE. It should work for bot Mac and Linux, but keep in mind that the code is still messy and not yet as clean as I wish it could be.