Processing Clocks

Processing has the ability to access the computers data and use this as part of the code to manipulate and work. One of these is the clock function, which can be accessed and manipulated to create time-based pieces. This can be used in works that require a time, date and year to manipulate images or text. One example of this could be making a simple real time clock which looks to the computer/mac for the time data. Bellow is an example of a digital clock I created which is displaying real time data.

This is an example I created by looking at time data that the clock provides. The data is put into a string and outputted to the screen. It also looks at the seconds and every minute displays a small image at 0. Creating this allowed me to understand how to take the data that is provided and convert it into a data type that I can work with to output into the display.

Here is some of the code I used in creating the Digital clock. You can see I have commented on parts of the code to highlight what different parts do to influence the image.

generative code

My next challenge was to make an analog clock. This provides far more challenges, as I need to convert the 24hr clock to 12hr so it can be displayed on an analog clock. Getting the hands to tick around the circle at the exact angle is the second problem as processing uses radians as it for of angles.

After a lot of time looking at different examples I managed to collaborate this together to create the clock. I had to look at code to distribute the clock angles correctly as I was struggling to get them to work correctly. The example is bellow.

From this I wanted to make the piece slightly more abstract and have more interesting elements. Getting rid of the conventional hands and replacing them with something more abnormal as this is a visual based image I don’t have to be constrained by physics and real world properties.

Some additional work i done on this was to add if statements to change the background colour depending on the time of day. This added a litte more understanding of what time of day it is as there is no numbers and the hands on the clock are sometimes confusing.

if (ah < 18 && ah > 7 ){
background(0);
};

From creating artwork using time a possible line of exploration could be to create some more art and generative images which use time to manipulate there physics. Potentially changing the shape of the artwork depending on the time could make it interesting what happenes.

Leave a Reply