Inspiration – Large-Scale Projects & Collaboration
- for – This is what we are mainly going to use. Used when you need to repeat something a very specific amount of times.
- while – We are not going to use this so much, but good to know it exists. Used mainly when you need to repeat something, but you don’t know exactly how many times. (waiting for an input, waiting for a status to change, waiting for a connection to something etc.)
How to Use Arrays in Processing
Looping through Arrays
How the for Loop Works
Random Walkers with Arrays
Random Walkers with More Arrays
If you try to search for video in the Processing language reference, you will notice that there is nothing to be found. The reason for that is that video playback is not part of the core Processing functionality, you need to use an additional library.
Libraries are collections of code that extend the functionality of Processing. There are a couple of libraries that are built-in (such as Serial and Network), but most of them need to be installed from the Library Manager. (Sketch–>Import Library—>Add Library)
Search for the official Video library from The Processing Foundation and install it.
The best way to figure out how the library works, is to go through the examples that come with it. Note that the functionality is split into two main classes:
- Movie: used to play video files. The library is a bit fussy about the codec of the video. H264 .mov files seem to work well.
- Capture: Used to capture the image from a webcam connected to the computer.
Playing sound in Processing also requires an external library. Try these libraries:
- Sound library – The official sound library from the Processing foundation (has some bugs and issues. Especially on Windows)
- Minim library – Often works better, so let’s use this mainly
There are some other sound libraries also, if you need to do something more specific.
Again the best way to learn how it works is to go through the examples.
Other Useful Libraries
You might want to install some additional libraries while you are at it. Some of the features might be beyond your skill level right now, but the libraries listed below are some interesting ones that you might want to come back to later. I added links to the libraries, but you should be able to install these directly with the Library Manager.
- List of Processing libraries – Don’t just listen to my suggestions, check the list to find the libraries that would be useful for you.
- Arduino (Firmata) – For controlling Arduino from Processing
- Box2D – Physics library
- controlP5 – Add GUI elements
- oscP5 – OSC library for Processing. Very useful for connecting Processing to some other software (like Pure Data).
- Open Kinect for Processing – For working with the Kinect sensor.
- Syphon – Used for sharing frames between applications
- toxiclibs – A collection of useful tools (physics, simulation
Assignment: Project Proposal for Your Final Project
Send me a project proposal as a pdf file:
- See the Final Project Guidelines for instructions about the project and the project proposal
- A simple description of what you want to do.
- What tools are you going to use (Processing, special libraries, something else?)
- Include 1-3 examples of works other people have made that are similar.
Length: 1 A4 (or can be more if you have drawings or sketches).
- The deadline for this is Thursday, October 10th, 23:00
- Upload the pdf to MyCourses (link will be here soon)