Generative art refers to art that has been generated, composed, or constructed in an algorithmic manner through the use of systems defined by computer software algorithms, or similar mathematical or mechanical or randomised autonomous processes. http://en.wikipedia.org/wiki/Generative_art In the words of MIT Professor Harold Abelson, "processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program . People create programs to direct processes." Many pieces of software may have their origins in a quick impulsive decision, but as soon as they are made manifest in code they become rigid and fixed as dictated by the constraints of the technology. If the final program was specified through a combination of diagrams and text descriptions, it would be possible for the artist to work a longer time and more often in an undefined mental space. http://www.massmoca.org/lewitt/walldrawing.php?id=85 A wall is divided into four horizontal parts. In the top row are four equal divisions, each with lines in a different direction. In the second row, six double combinations; in the third row, four triple combinations; in the bottom row, all four combinations superimposed. http://artport.whitney.org/commissions/softwarestructures/_85/index_text.html Modification through interaction: "In the original plan, LeWitt doesn't specify the number of arcs to be drawn, but leaves this decision to the draftsperson. I have modified this drawing so that moving the mouse left and right across the surface of the image changes the number of arcs that are drawn. When the mouse is at the far right, there is only one arc drawn from either side and when the mouse is at the far left, there are over five hundred. As the mouse moves left, the arcs visually collide, creating a moiré pattern. This is a technically trivial change introduced with one line of code, but I feel it's a radical re-invention of LeWitt's concept and reveals the potential for creating responsive drawings in a software environment." http://artport.whitney.org/commissions/softwarestructures/_106_response/index_text.html Text Rain (1999) by Camille Utterback http://www.camilleutterback.com/textrain.html Text Rain is an interactive installation in which participants use the familiar instrument of their bodies, to do what seems magical—to lift and play with falling letters that do not really exist. In the Text Rain installation participants stand or move in front of a large projection screen. On the screen they see a mirrored video projection of themselves in black and white, combined with a color animation of falling letters. Like rain or snow, the letters appears to land on participants' heads and arms. The letters respond to the participants' motions and can be caught, lifted, and then let fall again. The falling text will 'land' on anything darker than a certain threshold, and 'fall' whenever that obstacle is removed. If a participant accumulates enough letters along their outstretched arms, or along the silhouette of any dark object, they can sometimes catch an entire word, or even a phrase. The falling letters are not random, but form lines of a poem about bodies and language. 'Reading' the phrases in the Text Rain installation becomes a physical as well as a cerebral endeavor. http://www.creativenerve.com/ ----------- Golan Levin develops artifacts and events which explore supple new modes of reactive expression. His work focuses on the design of systems for the creation, manipulation and performance of simultaneous image and sound, as part of a more general inquiry into the formal language of interactivity, and of nonverbal communications protocols in cybernetic systems. Through performances, digital artifacts, and virtual environments, often created with a variety of collaborators, Levin applies creative twists to digital technologies that highlight our relationship with machines, make visible our ways of interacting with each other, and explore the intersection of abstract communication and interactivity. http://www.tmema.org/messa/ Messa di Voce (2003: Golan Levin, Zachary Lieberman, Jaap Blonk, and Joan La Barbara) augments the speech, shouts and songs produced by two virtuoso vocalists with real-time interactive visualizations. The project touches on themes of abstract communication, synaesthetic relationships, cartoon language, and writing and scoring systems, within the context of a sophisticated, playful, and virtuosic audiovisual narrative. Custom software transforms every vocal nuance into correspondingly complex, subtly differentiated and highly expressive graphics. Messa di Voce lies at an intersection of human and technological performance extremes, melding the unpredictable spontaneity and extended vocal techniques of human improvisers with the latest in computer vision and speech analysis technologies. Utterly wordless, yet profoundly verbal, Messa di Voce is designed to provoke questions about the meaning and effects of speech sounds, speech acts, and the immersive environment of language. ------------------- Chapter 4 Variables Variables store data. "Technically speaking, a variable is a named pointer to a location in the computer’s memory ("memory address") where data is stored. Since computers only process information one instruction at a time, a variable allows a programmer to save information from one point in the program and refer back to it at a later time." Variables can hold primitive values or references to objects and arrays Variables are declared by first stating the type (to determine how much memory should be allocated to store the variable), followed by the name: int count = 50; Variable names: 1. must be one word (no spaces) 2. must start with a letter (they can include numbers, but cannot start with a number). 3. cannot include any punctuation or special characters, with the exception of the underscore: "_" 4. avoid using keywords that are used by the language 5. start variable with lower case letter and join together with capitals - "eyeColor" Primitive Data types stored in variables: int - whole numbers - 0, 1, 2, 30 float - floating point values or decimal numbers 3.14159, 2.5, and –9.95 char - characters, letters, text strings boolean - true or false, like a switch - it's either on or off byte - a small number, -128 to 127 short - a large number, -32768 to 32767 long - a huge number double - a decimal number with multiple decimal places (for programs that require mathematical precision) Variables are designed to vary as a program runs. Assignment operations may be used to assign a new value: int a = 5; int b = 7; int x = a + b; println(x); 4.5 System Variables width — Width (in pixels) of sketch window. height — Height (in pixels) of sketch window. frameCount — Number of frames displayed since the program started. Inside setup() the value is 0 and after the first iteration of draw it is 1... frameRate — Specifies the number of frames to be displayed every second. screen.width — Width (in pixels) of entire screen. screen.height — Height (in pixels) of entire screen. key — Most recent key pressed on the keyboard. keyCode — Numeric code for key pressed on keyboard. keyPressed — true or false? Is a key pressed? mousePressed — true or false? Is the mouse pressed? mouseButton — Which button is pressed? Left, right, or center? Relational Operators used to make comparisons > greater than < less than >= greater than or equal to <= less than or equal t0 == equal or same as != not equal or not same as -------------------- 5.1 Boolean Expressions or Conditionals Boolean value is either true or false; machine language 1 or 0 Use boolean expression to have a program take different paths depending on the current value stored in a variable: int x > 20 → depends on current value of x int y == 5 → depends on current value of y int z <= 33 → depends on current value of z pg. 60 Conditionals: if, else, else if Boolean expressions (often referred to as "conditionals" ) operate within the sketch as questions. Is 15 greater than 20? If the answer is yes (i.e., true), we can choose to execute certain instructions (such as draw a rectangle); if the answer is no (i.e., false), those instructions are ignored. This introduces the idea of branching; depending on various conditions, the program can follow different paths. Basic boolean expression or conditional: if (boolean expression) { // code to execute if boolean expression is true } The structure can be expanded with the keyword else to include code that is executed if the boolean expression is false. This is the equivalent of "otherwise, do such and such." if (boolean expression) { // code to execute if boolean expression is true } else { // code to execute if boolean expression is false } To test multiple conditions, employ an "else if." When an else if is used, the conditional statements are evaluated in the order presented. As soon as one boolean expression is found to be true, the corresponding code is executed and the remaining boolean expressions are ignored. if (boolean expression #1) { // code to execute if boolean expression #1 is true } else if (boolean expression #2) { // code to execute if boolean expression #2 is true } else if (boolean expression #n) { // code to execute if boolean expression #n is true } else { // code to execute if none of the above // boolean expressions are true } In one conditional statement, you can only ever have one if and one else . However, you can have as many else if’s as you like. Logical Operators are used to program a command when multiple conditions are checked || means OR && means AND ! means NOT ------------------------ CHAPTER 6 LOOPS, pg. 81 control structure —the loop A loop structure is similar in syntax to a conditional. However, instead of asking a yes or no question to determine whether a block of code should be executed one time, our code will ask a yes or no question to determine how many times the block of code should be repeated. This is known as iteration. Just as with conditional ( if / else ) structures, a while loop employs a boolean test condition. If the test evaluates to true, the instructions enclosed in curly brackets are executed; if it is false, we continue on to the next line of code. The difference here is that the instructions inside the while block continue to be executed over and over again until the test condition becomes false. 6.5 Local vs. Global Variables (AKA "Variable Scope"), pg. 90 Some variables exist (i.e., are accessible) throughout the entire course of a program’s life— global variables —and some live temporarily, only for the brief moment when their value is required for an instruction or calculation— local variables. In Processing , global variables are declared at the top of the program, outside of both setup( ) and draw( ). These variables can be used in any line of code anywhere in the program. This is the easiest way to use a variable since you do not have to remember when you can and cannot use that variable. Local variable are declared within a block of code and are only available for use inside that specific block of code where it was declared. If you try to access a local variable outside of the block where it was declared, you will get the same error as if no variable was declared. It is more efficient to declare variables only within the scope of where they are necessary. ---------------------------- CHAPTER 7 FUNCTIONS, pg. 101 Functions are a means of taking the parts of our program and separating them out into modular pieces, making our code easier to read, as well as to revise. Processing's library is made up of functions such as line, rect, ellipse... but you may also write your own functions. 7.3 Defining a Function A function definition (sometimes referred to as a " declaration " ) has three parts: Return type. Function name. Arguments. returnType functionName (arguments) { // Code body of function } Same format as setup( ) and draw( ). Once we write a function, we must call it to process. Example declaring a function, but no argument: void drawBlackCircle () { //arbitrary but descriptive function name fill(0); ellipse(50,50,20,20); } void draw() { background(255); drawBlackCircle(); } Example declaring a function, but with an argument: void drawBlackCircle(int diameter) { fill(0); ellipse(50,50,diameter, diameter); } void draw() { drawBlackCircle(16); } By using functions the code within draw() is reduced to function calls and there parameters, this is a key power of functions, beyond breaking the code into parts. Technically speaking, arguments are the variables that live inside the parentheses in the function definition, that is, "void drawCar(int x, int y, int thesize, color c)." Parameters are the values passed into the function when it is called, that is, "drawCar(80,175,40,color (100,0,100));". pg. 110 Important Things to Remember about Passing Parameters • You must pass the same number of parameters as defined in the function. • When a parameter is passed, it must be of the same type as declared within the arguments in the function definition. An integer must be passed into an integer, a floating point into a floating point, and so on. • The value you pass as a parameter to a function can be a literal value (20, 5, 4.3, etc.), a variable (x, y, etc.), or the result of an expression (8  3, 4 * x/2, random(0,10), etc.) • Arguments act as local variables to a function and are only accessible within that function. ------ Chapter 8 Objects - OOP Object-oriented programming - Chapters 1 through 7, data and functionality, all rolled into one thing. "class" - the concept or template (Flash - library symbol) "object" - the realization or execution of the template (Flash - intense based on symbol) All classes must include four elements: name, data, constructor, and methods. WALK THROUGH Baby() Example The class and object may be separated using the tabs feature in processing - to organize your code, separating various classes and the setup and draw code for a program to have compiled in one applet. Break out example into separate tabs. Arguments are local variables used inside the body of a function that get filled with values when the function is called. In the examples, they have one purpose only, to initialize the variables inside of an object. These are the variables that are used to write the actual parameters for an object. This allows us to make a variety of objects using the same constructor. WALK THROUGH Land myLand example A Processing sketch can include as many classes as you feel like writing. If you were programming the Space Invaders game, for example, you might create a Spaceship class, an Enemy class, and a Bullet class, using an object for each entity in your game. In addition, although not primitive, classes are data types just like integers and floats. And since classes are made up of data, an object can therefore contain other objects! For example, let’s assume you had just finished programming a Fork and Spoon class. Moving on to a PlaceSetting class, you would likely include variables for both a Fork object and a Spoon object inside that class itself. This is perfectly reasonable and quite common in object-oriented programming. class PlaceSetting { Fork fork; Spoon spoon; PlaceSetting() { fork = new Fork(); spoon = new Spoon(); } } Objects, just like any data type, can also be passed in as arguments to a function. In the Space Invaders game example, if the spaceship shoots the bullet at the enemy, we would probably want to write a function inside the Enemy class to determine if the Enemy had been hit by the bullet. --------------- void - Keyword used indicate a function returns no value. Each function must either return a value of a specific datatype or use the keyword void to specify it returns nothing. Syntax: void function { statements }