Functions, Objects & Arrays in Processing
As part of my exploration of the program Processing, I’ve been trying to work out the differences between Functions, Objects, and Arrays. In this first example, I made a car Function, where I can basically use one Function that describes the size of the rectangle to draw, and the relationship of the ‘wheels’ to the body of the car. I can make the color independent and here I call the car function three times, each with a different color. I can also offset the placement of the three cars, but since all three are tied to the same function, they move at the same speed, at the same distance from each other.
Rather than treating the car as a function, I can make a car object. This allows me to make as many cars as I like, all moving independently. I also decided to animate the yellow stripe on the road.
Adding an Array to the sketch, I can now cycle through a series of cars of each color that also decreases in size and opacity from the original, with the idea of adding a motion blur effect. I was too lazy to add the blur effect to the tires.
Instant Audio
Most pieces can be auditioned on their post pages. But you can sample some audio here.

Twitter Feed
Tags
American Embassy Ana Cervantes Anna Akhmatova Anna Petraškeviča Barbara Day Turner Brass Quintet Brazil Chamber Orchestra Christina Dahl Daina Treimane Damian Samuels Dances with Films Festival Denmark Electroacoustic Emergence Federico Garcia Lorca Flamenco Folk Music Furman University Percussion Ensemble Gastesi-Bezerra Georgia O'Keeffe Hold the Mayo Inkscape Jeffrey Williams Juan Ramon Jiménez Logic Lord Byron Magen Solomon Mezzo Soprano Multimedia Networking New Music Incubator Noatikl Nodal Processing Quintet of the Americas Reason Review Riga San Francisco Choral Artists Saul Herckis Sibelius Sweden Tiction TrumpetQuick Bio
Charles Griffin recently returned to the U.S. after spending 5 years living and working in Latvia. His compositions and arrangements have been performed at festivals and concert halls throughout the U.S., Canada, Mexico, Europe, Asia, Brazil, Cuba, and Puerto Rico. Recent projects include commissions from pianist Ana Cervantes and the Colorado State University Percussion Ensemble.
Read more in the biography section.
Google Ads
On Facebook





