User Tools

Site Tools


summer2015b:progress

Genart Journal

Day 0: Since Professor Carl and I discussed this genart project in early May whereas the internship was not to take place until mid-August, I had most of the summer to familiarize myself with the concept and form a general idea of how I wanted to go about building the final product. Dr. Carl also gave me his original version of Waves.pde which would become the template for my project. At that time it made waves in greyscale across a two dimensional array of circles and could be linked to Pure Data to generate an audio component. Our three goals for the summer research position were to improve the aesthetic of the waves, improve the audio component, and clean up the code. In order to improve the aesthetic I decided to add color to the previously greyscale piece and have the cells change shape as the color rippled through them. To improve the audio, I wanted to have Processing be capable of producing the sound without Pure Data, so that it could someday be exported to a Javascript file seamlessly. Conclusively, the majority of the summer before my internship was spent considering ways to accomplish these goals by examining Dr. Carl’s ‘Waves’ template while simultaneously refreshing myself in Processing.

Day 1: I started with heavily picking at the code by commenting out lines to see exactly how it worked. Since the final product would require a lot of computer power, I wanted to remove as much extraneous code and variables as possible. I also researched other classes that I could use to replace ‘Cells’ altogether and, in particular, particles. In other scripts that used this class, I noticed the particles included a pre-programmed general set of physics which could work to improve the rippling effect.

Day 2: After reading the Processing javadocs on particle systems, I discovered that I needed to rewrite the ‘Cells’ class to be a subclass to particle systems in order to retain the physics elements of particles because the particle systems class did not have the necessary methods. So I reviewed my understanding of sub-classes and super-classes before beginning to reconstruct the sketch.

Day 3: The particles looked exactly like the original sketch did, except the circles appeared as if ‘noStroke()’ had been called. When I removed a few of the particles to create room for them to bounce, it required too much processing power to give each particle its own agenda in accordance with the color to make ripples. Each iteration of draw stuttered, even with a high framerate, and I hadn’t even added color or sound yet. Therefore, I tossed the particle idea and started over with the original template again.

Day 4: While researching different shapes in other Processing scripts from the Processing handbook by Casey Reas and Ben Fry and looking at examples from Matt Pearson’s book Generative Art, I found a class builds polygons with a constructor for the number of sides the polygon would have. I thought this would be promising since Professor Carl wanted the cells to change shape depending on the ripple. I manipulated the variables in their polygon class and implemented it as the constructor for each cell. The RGB value would dictate the number of sides, in such a way that an intensity of 255 would yield almost a circular polygon and a black cell would be a triangle.

Day 5: Since the polygonal shapes were successfully implemented, today is the day of color! Essentially I am creating three different layers of rippling—red, green, and blue—to constitute the RGB values of a pixel. This required tripling most elements of the preexisting code and tweaking the empirical formula for the ripple that we were using.

Day 6: I finished getting each cell to display color in three separate ripples, but it was extremely glitchy. Today I was supposed to meet with Professor Carl for the first time to check up on the progress, but I spent the day combing over the code to figure out what was causing the slowness besides the color. It ended up being that clearing the canvas and re-shaping the cells in each iteration of draw was too processor heavy, so I decided to stick with a lattice of pentagon shapes since my favorite of Matt Pearson’s examples utilized them.

Day 7: Today was the first day I met with Professor Carl and while I hadn’t fully corrected the code yet, we went over my ideas thusfar. We also discussed ways to implement sound, as well as other general goals he had in mind for the sketch. He pointed out that you can’t create a lattice of pentagons without having them overlap because of the way they are shaped, so after our meeting I started using a hexagon instead. I overlapped the hexagons after I didn’t like the static, pixelated way they appeared and settled on the crystalline pattern that formed.

Day 8: I researched different Processing libraries to use for sonification. ESS was the one we used back in CS276, but it is not compatible with Processing 3. Processing comes with a sound library itself, but there are not javadocs to accompany it. I chose Minim because it has regularly updated documentation and it came with the methods I would need. I wrote one script here:

I had to remove the code because DokuWiki thought the syntax of java was syntax for formatting textboxes, will update when I figure out how to fix that

It is activated by a two-layer for loop in draw on each cell. The volume was based on each RGB value of the cell and the frequency was dependent on the cell’s coordinates on the canvas. This way the sound would come out as fluctuating as the waves moved across the canvas. However, since three news oscillators were constructed for each cell without being stopped, the noise sounded like a screeching cricket. I spent the rest of the day considering of ways to make that not happen.

Day 9: I tossed the previous code and decided to use a three-dimensional array of oscillators in which they all began playing at zero volume in setup. The volume would be changed in each iteration of draw, as seen in the code below:

I had to remove the code because DokuWiki thought the syntax of java was syntax for formatting textboxes, will update when I figure out how to fix that

However, the number of computations the computer performed in each iteration of draw was too great and this sounded choppy. I had all but given up on a means of sonification without Pure Data and emailed Professor Carl to request a meeting time that afternoon, but then I had an epiphany while eating a sandwich. I typed up code that would only use three oscillators wherein the frequency of each was calculated from the average R, G, and B values of cells across the campus.

I had to remove the code because DokuWiki thought the syntax of java was syntax for formatting textboxes, will update when I figure out how to fix that

It worked and didn’t sound too painful, so I brought it to the meeting with Professor Carl and he seemed appeased. After the meeting I added a method that would set the volumes of each oscillator based on the overall proportions of RGB values.

Day 10: Since today is the last day of the research position, I cleaned up the code by adding comments and formatting to coding standards. I attempted to add another variable to the cell class which would construct the hexagons based on their intensity. Therefore, the more illuminated cells would appear as full hexagons while their neighbors would only appear as triangles or trapezoids. The Quick-Sort algorithm I used ended up being too demanding on the computer, so I tossed that code as well. The last change I made before archiving the sketch and emailing it to Professor Carl was editing the onMouseClick action and adding an onMouseDrag action. The R, G, and B values of whichever cell the curser moves over are set to 255.

summer2015b/progress.txt · Last modified: 2015/08/21 18:40 by tyler_danger_epps