generative art a practical guide using processingmatt pearson MANNINGforeword by marius watz generative art ii. types of generative art through history, and discuss issues of art theory that are support/pflegeelternnetz.info (accessed January 15, ). In this paper an attempt is made to offer a definition of generative art that is Some might wonder whether the attempt to define generative art is an empty.
|Language:||English, Spanish, Hindi|
|ePub File Size:||20.86 MB|
|PDF File Size:||12.47 MB|
|Distribution:||Free* [*Regsitration Required]|
From this p.o.v., not all rule-based art is generative and some generative . and Edmonds pflegeelternnetz.info PDF | Generative art is created by a system that operates autonomously, or semi- autonomously, rather than directly by the artist. The artist creates the system. 1 Generative Art: In Theory and Practice. 2 Processing: A Programming Language for Artists. Part 2 Randomness and Noise. 3 The Wrong Way to Draw A Line.
But I failed. We maintain a practical approach throughout though, exploring how we might simulate these phenomena in code, and learning, by stealth methods, more advanced object-oriented programming required for these experiments. Cellular automata in general have generated considerable attention from both scientists and artists. All this code does is iterate through a grid using two loops; then, a function call on line 14 draws a circle at each grid point and displaces it in 3D space using a mathematical variance. What would happen then?
In conceptual art the idea or concept is the most important aspect of the work. When an artist uses a conceptual form of art, it means that all of the planning and decisions are made beforehand and the execution is a perfunctory affair.
The idea becomes a machine that makes the art. This kind of art is not theoretical or illustrative of theories; it is intuitive, it is involved with all types of mental processes and it is purposeless.
It is usually free from the dependence on the skill of the artist as a craftsman. LeWitt LeWitt was a relatively conservative conceptual artist, compared to say Robert Barry, who created invisible artworks using radio-activity, electromagnetic fields, inert gases and even telepathy Meyer , pp.
It seems that much of conceptual art was directed against the idea that art had to be in a gallery, promoting what would have been documentation of an artwork to the role of artwork itself: When art does not any longer depend on its physical presence Seth Siegelaub, quoted in Meyer , p.
All of this has little to do with generative art as discussed in this essay. It is also clear that in the artworks discussed in Chapter 6 the execution is just as important as the underlying idea, and the work is certainly not the same as its documentation. Another candidate for an art of ideas is Islamic art: Some of the properties listed by Marks: Algorithmic structure: An emphasis on performativity rather than representation: Marks , p.
These points make what seems to me to be a good case for a surprising similarity in aims and methods. Again, Marks would agree that the execution is as important as the idea: Marks says p.
Thus, as noted in Section 6. Again, the much-hyped but as yet unreleased generative computer game Spore by Will Wright, who was the person behind SimCity begins at the level of single-celled life and ends up with space-faring civilisations Electronic Arts However, it appears that there are a series of artificially imposed stages of development in the game; the progression does not arise naturally from the internal structure of the process.
There is no obvious solution to the problem. Yet Whitelaw also quotes the artist Bill Vorn as saying about a-life art: Artists are now able to do things that have no sense, let them interact, and the overall meaning is going to emerge just by itself.
Artificial Life is the Spirograph of the 90s. Mladen Milicevic , commenting on music produced by complex processes, says: There is an easy misunderstanding of emergent behavior which lies in the assumption that whatever is produced on the verge of chaos is good or creative.
A related point is made by Johnson , p. In science, as Johnson indicates, adaptive systems are important, and the book Emergence by Holland is largely about adaptive systems. Yet Ima Traveller, a successful art work exhibiting emergence, is not adaptive at all.
The way forward may be to analyse in detail how artworks give rise to feelings of surprise- wonder-mystery-autonomy, a task certainly beyond the scope of this essay.
I believe that the definition of generative-art emergence given in this essay comes closer than previous definitions to capturing what artists are looking for under the name of emergence. Computational Complexity and the Difficulty of Prediction In this Appendix I use the theory of computational complexity to show that, given plausible assumptions, there is no way in general of finding out in reasonable time what a computer program will do.
Computational complexity is concerned with how long it takes to solve certain problems; an example is to sort a jumbled mass of data into alphabetical order. We assume that the input is in a computer file, and the size of the problem can be taken as the size of the input file in bytes, or some similar measure.
We want to know how long the problem will take to solve, that is how many steps basic computer operations will be needed. The answer will be expressed as a function of the size of the input. Suppose the input size is n. Computer scientists generally draw a line between problems that take a time polynomial in n, say n 2 or n 3 , and a time exponential in n, say 2 n Cook , pp.
In Section 4. Then n 2 is about 67 million, and n 3 is about billion. Depending on how long it takes to carry out one step, we could expect a current personal computer to solve a problem requiring n 2 steps in seconds, and one requiring n 3 steps in hours or days. However, we have seen that if the problem requires 2 n steps, it is completely beyond reach. Now consider a computer program such that the program, plus data and working space, fits into n bits.
This is about the simplest thing we could wish to know. There is a brute-force solution: However, in some cases we can do better that is, find a short-cut. I conclude from this that in general there is no practicable way to tell what a computer program will do, even if we know its source code.
It seems very likely that almost all programs are intractable in this way. Indeed the whole point of structured programming, object-oriented programming and similar techniques is to produce programs that are in the small subset of programs with comprehensible behaviour. A problem is in class P if it can be solved by some procedure that takes time polynomial in the size of the problem.
A problem is in class NP if a purported solution can be checked in polynomial time1. For example, consider the problem of factorising an n-digit number, e.
No algorithm for factorising numbers in time polynomial in n is known. But if I am given a supposed factor of ,,,,,,, say ,, I can check in time polynomial in n whether it is a factor or not Cook , p. Cook remarks p. Can we join some of them together to make a pipe exactly one metre long? Can we join some of them together to make a pipe cm long? No, but on the face of it this requires checking every combination.
This is very generous, allowing 1,, bits for my actual program, and plenty of space for copies of the input, etc. I now apply the short-cut algorithm to my program.
The above shows that we cannot answer in reasonable time the simplest question about a program: Other questions we might want to know the answer to will fall to similar arguments. The two assumptions I have made are: The distinction between a polynomial number of steps and a greater-than-polynomial number of steps corresponds to the distinction between feasible in practice and not feasible in practice.
It does show that there is no general way of determining in a reasonable time what a computer program will do. The argument given above is not taken directly from any of my sources, but it would be an easy exercise in a course on complexity theory. ArtsConnect, Accessed 30th December Bedau, Mark A. James E. Tomberlin, Malden, MA: Blackwell Publishers, pp. Accessed 12th April Bentley, Peter J. Corne eds , Creative Evolutionary Systems.
San Diego: Academic Press. Berlekamp, Elwyn R. Conway and Richard K. Guy, Winning Ways for your Mathematical Plays: Bird, Jon and Paul Layzell, Swarm Intelligence: From Natural to Artificial Systems. New York: Oxford University Press.
Boolos, George S. Burgess and Richard C. Jeffrey, Computability and Logic, 4th edn. Cambridge University Press. Brown, Paul, Bentley and David W. Corne, San Francisco: Morgan Kaufmann, pp. Brown, Richard, Royal College of Art. Burke, Tim, Accessed 22nd May Burraston, Dave, Brown, Brisbane: Creative Industries, Queensland University of Technology, pp. A historical and technical review.
Cariani, Peter, Christopher G. Langton, Charles Taylor, J. Addison- Wesley, pp. Chapman, Robert L. Clark, Andy, Emergence and explanatory interlock.
Margaret A. Boden, Oxford University Press, , pp. Contingency Analysis, Cook, Stephen, Accessed 11th February Cope, David, Virtual Music: Computer Synthesis of Musical Style. Cambridge, MA: MIT Press. Damper, R. Darley, Vince, Rodney A. MIT Press, pp. A survey of emergence definitions. Accessed 24th May Devlin, Keith, The Math Gene.
Basic Books. No place of publication given. Dewey, John, Art as Experience. Page references are to this reprint. Dickie, George, The Art Circle: A Theory of Art.
Haven Publications, Curiosities of Literature, 10th edn.
Edward Moxon, Dorin, Alan, Dorin, Alan and Jon McCormack, A conference on generative systems in the electronic arts. Accessed 21st April Electronic Arts, Accessed 19th May Esler, Robert W. Emmeche, Claus, A note on the semiotics of emergence and computation in artificial and natural living systems. The Semiotic Web , eds Thomas A. Mouton de Gruyter, pp. Friedman, Batya, Peter H.
Kahn, Jr and Jennifer Hagman, What online AIBO discussion forums reveal about the human-robotic relationship. ACM Press, pp. Galanter, Philip, Complexity theory as a context for art theory. Gardner, Martin, Scientific American, vol. Gell-Mann, Murray, The Quark and the Jaguar: Adventures in the Simple and the Complex. Freeman and Company. Paperback edition by Abacus, London, Page references are to this paperback edition.
Graham-Rowe, Duncan, Goldman, Michael, Accessed 24th April Grishchenko, Victor S. Accessed 16th June Gunew, Sneja, Australian Writers and Cultural Displacement, eds. Deakin University Press, , pp. Accessed 28th December Haacke, Hans, Using a nonlinear dynamic system as physical metaphor. School of Music, Victoria University of Wellington, pp.
Holland, John H, From Chaos to Order. Perseus Publishing. Huws, Ursula, The Emergence of a New Relationship? Jet Propulsion Laboratory, Accessed 28th April Johnson, Steven, Penguin Books. Kaneko, Kunihiko and Junji Suzuki, Christopher C. Addison-Wesley, pp. Knuth, Donald Ervin, The Art of Computer Programming: Reading, MA: Kolve, Carsten, Langton, Christopher G. Nadel and D. Reprinted in The Philosophy of Artificial Life, ed.
This is a revised version of a paper that first appeared in Lansing, J. Stephen and James N. Kremer, Coadaptation on a rugged fitness landscape. LeWitt, Sol. Li, Wentian, Lippard, Lucy R.
Six Years: The Dematerialization of the Art Object from to Studio Vista. Marks, Laura U. Strategies of enfoldment in Islamic art and computer art. Marter, Joan M. Alexander Calder. McCormack, Jon, Impossible Nature: The Art of Jon McCormack. Australian Centre for the Moving Image. Accessed 26th May McCormack, Jon and Alan Dorin, McDonough, Richard, Five degrees of freedom.
An Interaction, ed. Terry Dartnall, Westport, CT: Praeger, pp. Meyer, Ursula, Conceptual Art. Milicevic, Mladen, Mitchell, Kerry, Accessed 18th May Moura, Leonel and Henrique Garcia Pereira, Making the artists that make the art. Accessed 31st December New Line Productions, Massive brains. Oxford English Dictionary, The Oxford English Dictionary, 2nd edn.
Prepared by J. Simpson and E. Clarendon Press. Pask, Gordon, Pergamon Press, pp.
Chaos and Fractals: New Frontiers of Science. Peterson, Ivars, Pritchett, James, Quaranta, Domenico, Accessed 29th December Rasmussen, Steen, Nils A. Olesen, Ray, Thomas S. Zen and the art of creating life. Reynolds, Craig, A distributed behavioral model.
Background and update. Accessed 5th January But by what yardstick do we measure such sophistication? Compared this way, our digital tools appear extremely primitive in their usability, and at times quite an impediment to our creative flow. The purpose of a tool is not only to extend our capabilities; it should also enhance the flow of our creativity.
The newest software gives us the power to fashion the world in ways that would have been unimaginable only 50 years ago, but there is still a long way to go in terms of a natural artistry to their use. Almost all of the more powerful tools have a steep learning curve and require dedication and constant use to master. On the other hand, using a pencil or Generative Art: In Theory and Practice a fragility to the work you do: For this reason alone, many artists gravitate toward more tangible art forms such as print and sculpture the decreasing prices of 3D printers promise some exciting possibilities for tangible generative art in the coming decade.
An art form is defined by its tools. The tools give an art form its grammar. They can limit our creative choices at the same time they extend them. The trick is to appreciate these parameters and to come up with new ways of using the tools, to avoid falling into tired and over-familiar practices. This applies to a programming language as much as it does a paintbrush.
For what use is a paintbrush without an artist with the will to hold it? Surely there must be something positive to take away from this chapter. At the same time, they have a huge bearing on the type of work we produce with them. Even constrained as you are to the toolset of the early twenty-first century, you have an abundance of software choices for experimentation with generative visuals. The options range from expensive professional tools such as Flash and 3ds Max to free online resources like HasCanvas and Scratch.
But your time is precious, and you could never hope to master them all. For your purposes, you need just one. The best one. To narrow it down, I came up with a few criteria. The language has to be easy, powerful, extensible, and well supported. I also wanted it to be equally adept at producing generative visuals for print and video, not just the computer screen. This book could just Processing: Chapter Two 2 13 have easily been focused on openFrameworks www. With this in mind, I propose that there is only one obvious choice: The main reason I favor Processing, though, and the reason it warrants a book like this one at this point in its life cycle, is that I believe this one tool marks a significant advance in the democratization of programmatic art.
To date, generative art has struggled to catch on outside of the realms of mathematics and computer science—fields that have never traditionally attracted those with more adventurous aesthetic obsessions. Processing is perhaps the first language to enable the creation of professional generative art by a general audience, not just computer scientists.
Processing was conceived as a language for artists. It was developed as an open source project initiated by Casey Reas and Benjamin Fry while at MIT specifically intended to teach programming skills via the instant feedback of visuals. As it has grown in popularity, the simplicity of the core language has been enhanced with third-party libraries, enabling it to also be put to other more sophisticated uses: This would mean Processing could be run directly in the web browser, without a plug-in.
There are also implementations of Processing in Ruby http: The barriers for entry are dropping as the potential distribution opportunities are expanding. Rather than the immediate feedback of sweeping a pencil against paper and seeing the line created, the process of write—run—amend or write—run—debug puts a gap between the artist and their work.
But, as previously mentioned, the Processing language, once tamed, can assist you in your art, and become your collaborator as well as your instrument.
The programming language, with mathematical and logical aptitudes far beyond your own, can do all the heavy lifting and leave you to concentrate on the finesse. New programmers will find that there is a logic to coding that becomes familiar with time, appealing to the ordering, categorical instincts of the left brain. The application went through versions prior to its 1.
There are also many other resources to be explored at www. You can find the latest version at www. The screenshots used throughout these pages are taken from the Mac version, but the interface is nearly identical for all the supported Processing: A Programming Language for Artists art. Although it may not be possible to pick up Processing instantly, the learning curve required to get started with Processing makes it accessible to a much wider range of technical abilities than other languages, while it still retains the power to be more than just a toy or learning aid.
All tools, even the most basic, come with a learning curve. Your first efforts with a pencil will unlikely be great works of art; and although most of us are first introduced to handheld drawing implements as children, when our brains are most malleable, it may take years to master even this simplest of tools. But if you do, the rest of the chapter is a whistle-stop tour of the language essentials, written specifically with the beginner in mind.
It will take you through the key concepts of Processing and programming languages in general, and arm you with everything you need to start experimenting.
But every programming language has its idiosyncrasies, so it will be useful for you to learn how Processing uses concepts such as the frame loop, for example. One of the joys of open community projects such as Processing is that there is no shortage of free resources on the web in support of the product.
Again, I refer you to www. A Programming Language for Artists demonstrating various features of the language again in the Learning area , and an active forum in the Discourse area. Key the following in the main window: Quickly, before blank- Pearson 17 Then, click the Run button: What do you see? The output window should pop up see figure 2. In it is a x pixel canvas within which has been drawn an ellipse, center point at coordinates 25, 25 measured from upper-left , width and height 50 pixels.
This is the visual programming equivalent of Hello World. You can think of a function as a service you use to perform a certain task. Sometimes you feed it parameters; sometimes it only needs to be called. The reference is also online at http: Figure 2. The output window shows the result of your commands.
The single line ellipse 25, 25, 50, 50 drew a circle 50 pixels in diameter with its center at point 25, But try this in a programming language, and it will break.
The semicolon is the Processing syntax equivalent of a full stop. Forgetting the semicolon is a common cause of errors. At their core, all programming languages boil down to the same types of structures: I appreciate that some of this may be a little unintuitive at first. There is no time limit, and your patience will be rewarded. A Programming Language for Artists There is a certain fragility to the syntax of most programming languages.
In a human 2 Pearson 19 2. Open a new window, and type the following into the PDE window see figure 2.
First, set the size of the canvas to pixels by pixels: Each value is a number from 0 to defining how much of that color goes into the mix. Together, these three numbers give you 1. In this case, because 20 Figure 2. You can use a shorter version of the function for grayscale, with just one parameter: This produces the same result as the three-parameter version. Many other graphical applications use this RGB notation. This notation is similar; the three RGB values are expressed as hexadecimal base 16 character pairs.
Each two characters represent a color value: In the slot for each of the four parameters is a simple sum. The result of each sum is passed as the parameter. Remembering that you previously defined a width and height of x pixels, you can calculate that the resulting drawn line will be from point , 90 to point , Coordinate values are always measured from upper-left.
For more information about hex notation, see www. The next line of code does the same, drawing a second line relative to the center point to complete the cross: Your code will be easier to read, and it will execute faster if the processor has to do fewer calculations.
The CPU in any machine can perform only so many calculations per second. Try changing the two cross-drawing lines to the following: Think of a variable as a box in which you can put only one thing of a certain type; but the thing you put in may, um, vary hence variable.
The following is a valid way of declaring and filling a variable: A Programming Language for Artists change the size function at any point—say, to size , go on, try it —the crossed lines will still meet at the center point.
A float? Table 6. Table 2. An integer a whole number. Can be positive or negative. A number that may have a decimal point. Used for logical operations because it can only ever be one of two states. It can also be undefined, but this would resolve as false. Note the capital S on String, signifying that this is a composite type a collection of char s. The final two lines of the script draw the circle: The fill is the area within An alpha value of 0 is fully transparent, whereas is fully opaque.
Any time you define a color, you also have the option of giving it an alpha value. If you like, go back and try adding an alpha parameter to your stroke color too. With the three-parameter RGB syntax, the alpha value is the fourth parameter: If you change the order so that the ellipse is drawn before the crossed lines, the point where they cross will be above the semitransparent white circle, so the lines will appear solid.
A Programming Language for Artists the lines of a shape. Using this fill value and the stroke you previously set for the crossed lines, the final command draws a circle an ellipse with equal width and height. You set the fill color using the single color value the grayscale notation , which is white. But you also have a second parameter that sets the alpha value—the transparency of the color—again, a number 0— Processing is state-based, which means that when you set a style such as the color or weight of the stroke , that state will be maintained until you set it to something else.
In the example, you call stroke and strokeWeight before drawing anything, so all the lines drawn are Generative Art The first section of the code sets up the drawing and creates the background. Next, you set the stroke and fill. Finally, you draw the circle followed by two lines. But you can change these settings as often as you please; whenever a line is drawn, it uses whatever setting was received last.
Feel free to take a little time to try a few commands to get used to the coordinate system; or perhaps pick a few other shapes from the Processing reference, such as rect to draw a rectangle or quad for a non-right-angled quadrilateral.
But with anything above the most basic level of simplicity, you need to go a little further: The word frame can mean a variety of things within the computer sciences, but our meaning is the movie industry sense—a single still image which, if we flash enough of them faster than the eye can see, gives the illusion of animation. With Processing, a frame loop redraws the screen continuously.
If you instruct Processing to do so, you can use this feature to add the dimension of time to your two-dimensional visuals and can create works that grow and move. Pearson aside two special blocks for frame-based scripting: The code inside the setup function block is called once when the program launches, so it should contain all your initialization code—setting the canvas size, setting the background color, initializing variables, and so on.
The code you write inside draw is then called repeatedly, triggered on every frame. You can set the speed with which draw is called by using the frameRate function.
If you give it a number 12, 24, 25, and 30 are typical , it will attempt to maintain that rate, calling draw regularly. Otherwise, it will perform the frame loop as quickly as the machine can handle.
Generative Art To enable this way of drawing to the screen, you need to begin putting your code in function blocks. A function block is a way of chunking a group of commands together. Processing sets Processing: A Programming Language for Artists with no parameters to remove the fill entirely. Similarly, if you want to turn off the stroke, call noStroke. It will loop as fast at it can, which may result in not just a lower frame rate, but potentially an irregular one as well.
Open a new script, and enter the code in the following listing. Listing 2. The diameter and the center points are kept in variables, with the center points calculated in setup. The frame loop then checks that the diameter is smaller than , redraws the background, draws the circle, and increases the diameter by 10 for the next time it goes around the loop.
The effect is that it draws a circle of diameter 10, 20, 30, and so on until the diam variable gets to Note that the frame loop continues to be called over and over after the circle has reached its full size, but the draw script is no longer drawing anything.
Pearson This is called variable scope. Variables inside functions are called local: Variables outside of functions are called global: For example: Generative Art Notice that you still declare your variables outside of the function blocks.
This is fine syntactically: If you define a variable within a function block, rather than outside it, that variable is only available within that block. A Programming Language for Artists Figure 2.
When you run the script, the circle grows from a diameter of 10 to The chunk of script in listing 2. There are no required parameters to these functions either. The other valid return types for functions are the same as the data types for variables: String, char, int, float, and so on. The idea of a function returning something will make more sense when you start creating functions of your own. Open a new script, and try this: If you give a function a return type, there must be the keyword return somewhere within the function; otherwise it throws an error.
After the function has completed its job and the returned value has been put into variable x, Processing continues to execute the commands in the setup function block. The line println x outputs the value of this variable to the console window the black window below the text editor in the PDE. This script has no visual output, so the output window is an empty canvas.
The full list of operators is in table 2. You do this within the setup function: You also define the data type of the two parameters the function requires, so it knows what to expect. The value of num increases by 1. The value of num decreases by 1. Adds 4 to the value of num, and puts the result back in num. Subtracts 4 from the value of num, and puts the result back in num. Multiplies the value of num by 4, and puts the result back in num.
Divides the value of num by 4, and puts the result back in num. If you want to leap ahead and try some of your own codebased fun, look at the available functions in the Processing reference and play around. With an if A Programming Language for Artists The final new element in the circle-drawing script is the conditional: The following is valid code: The ability to take a single instruction or group of instructions and repeat it hundreds, thousands, or millions of times is a key advantage of programmatic drawing over any other comparable creative process.
This is a very straightforward way to scale ideas. The while command checks a condition and, if the condition is met, executes the code inside the braces; it then loops back up to the top of the block.
The execution continues to the final line only after the condition is no longer met in this case, when bass is 0. If your code includes an infinite loop, it can lock up your system, and you may have to force-quit Processing to escape it. So be careful out there, kids. A Programming Language for Artists chunk of code within the draw function is called every time a new frame is entered, so the code is executed repeatedly for as long as the program is running.
You can code your own loops, too. Modify the circle script with the additions highlighted in the following listing, and then run it. Generative Art Listing 2.
You can see the effect in figure 2. Notice how you have to add extra lines to reset the stroke and fill; otherwise, the next time the frame loop was triggered, the previous settings would be applied. Try changing the noFill ; line to fill , 25 ;, giving each circle a highly transparent white fill color see figure 2. Pearson Even though the transparency is barely visible, the effect is accumulative. In the center, where more circles are layered atop each other, the white is deeper than on the edges where fewer circles are overlaid.
Generative Art Again, you see the same concentric rings from figure 2. The crucial change is that you comment-out background ;, the command that clears the image every frame and forces you to redraw everything every time. The animation of the growing circle is a series of frames of circles at growing diameters. A Programming Language for Artists There is actually a much easier way of drawing concentric circles though.
Try the following. Open a new script, and enter the following: For example, if you wish to stop your loop as soon as the black line is entirely invisible and the white line is fully visible , place the following line inside the loop: Generative Art Knowing that the h variable follows this pattern, you can use it in multiple ways.
But the alpha transparency of the lines also varies as h varies: Square edges on lines Processing: A Programming Language for Artists There is one final loop to show you before we can go boil the kettle. The for loop is used when you want to iterate through a set number of steps, rather than just wait for a condition to be satisfied. The syntax is as follows: There are a few more to come in later chapters, but these are the essential ones.
But Processing also makes it significantly easier to publish your work and share it with the world. I presume this is to increase the artist appeal, but I think the metaphor becomes rather limiting after a while. Once you have your script folder, you can free your pixels from the confines of the local output window in a number of ways.
The first to try is clicking the Export button the far-right arrow on the toolbar. Doing so creates a folder called applet within your script folder, containing everything needed to run the sketch in a web browser see figure 2.
If you launch the index. A Programming Language for Artists Before you publish your work you should save it. When you first save a script, a folder is created with the name you provide in the dialog box. Your script is saved as a text file in this folder, sharing the same name, with the extension. The reason for the folder is to keep things neat when you begin importing and exporting. Generative Art Pearson Figure 2. Publishing Java to the web is often fraught with cross-browser difficulties.
This enables you to create standalone applications for OS X, Linux, and Windows, or all three at once. Again, the folder containing all you need for these installations is placed in your script folder. A much more useful feature is available for organizing your work: If your work has a trail of iterations, it frees you to make more sweeping changes to your code, to take new directions, or to try stupid ideas, without worrying about doing anything catastrophic.
This will, imperceptibly, make your coding bolder and more confident, in the same way that when you drive a bumper car at an amusement park, you feel safe knowing that no one is really going to get hurt no matter how crazily you yank the wheel. You tend to drive more recklessly than you would the family sedan. This practice also enables you to revisit interesting accidents or follow strange tangents.
This is partly why different languages can have such different flavors. Some encourage 2. Capturing still images from an application is relatively straightforward. You can export screenshots of the output window in a variety of formats as the application runs. If you put the following function into your code, it captures a snap at that point and saves it in your script folder: If you want to save as. You can also add folder paths to the URL. It will likely require some pretty complicated logic for the machine to determine a good shot from a bad one, so the best way to capture the perfect still is probably to rely on your own eye instead.
Include this function within your code: The keyPressed function is a built-in event function, called whenever a key is pressed. The previous function checks whether the key pressed is Enter and, if so, takes a snapshot and saves it in the script folder.
A Programming Language for Artists a methodical, structured approach; while others, such as Processing in its native PDE form, anyway , are more attuned to creative flurries. You may have noticed in figure 2. You do this by modifying the generated index.
Look for this line: If you replace loading. Next up: This is useful for software such as QuickTime Pro, which can open an image sequence available from the File menu in QuickTime Pro to create a movie file. The joy of creating for video is that you no longer have to worry about processing power and maintaining a smooth frame rate in Processing.
But if you export each frame as an image, to use video as your final medium, you have to take frame rate into account only when you build the movie from the image sequence.
The movie will run as fast as you tell it, even if the image sequence it was generated from took many hours to create.
You can explore the functions provided by the Video library at www. Similarly, the frame rate you specify when importing the sequence is usually arbitrary. But there exist various standards that are used for the web and broadcast media. If you imagine a movie as being alternating black and white frames, at frame rates below fps, a person would see it as a flicker; above this limit, it would be seen as grey.
With screen dimensions, a widescreen format is the most common, usually a The best practice, though, is to consider where you may want to show your video, and aim for that. Projecting a work onto the wall of an art gallery will doubtless require a different screen ratio than a work designed for mobile phone. YouTube, for example, currently recommends x or x Most modern mobile phones run Java.
Does this mean you can create mobile-phone applications in Processing? The answer is yes.
Processing enables you to publish sketches to an Android emulator or an attached device as easily as you can export them to the desktop. The 1. If you select Android Mode, the run and export functionality will be overridden to target a device. You will need to have the Android SDK installed on your machine to use this though.
Full instructions on how to set this up are at http: There are also two great tutorials on creativeapplications. The Java that most current mobile phones run is special flavor called Java Micro Edition Java ME , which means there is a special flavor of Processing too to go with it. It has a similar IDE, but you also need to download a wireless toolkit WTK —basically, a phone emulator—to develop for these very particular mini platforms. As with Processing, the project is well supported, and a number of tutorials and a reference are available on the site to get you started.
Generative Art This brings you to the end of your introduction to Processing. You now have a tool grasped firmly in your eager little fists and are ready for some creative coding. You have the basics of programmatic drawing and a variety of options for media in which to publish—web, print, video, or mobile device.
There is also a comparable, and promising, initiative for Processing, called iProcessing. But non-native conversions from one language to another will never compete with native Objective-C applications in terms of performance. But precision is of only limited interest to us in the context of generative art.
If our art were to achieve such perfection, it might be dismissed as overly mechanical. To find this, we may need to move away from the efficient, programmatic way of drawing lines and nudge the process toward something a little less deterministic.
This is partly why they have revolutionized design, architecture, manufacturing, the sciences, and countless other fields. Mathematical formulae above a certain degree of sophistication always return predictable results, yes, but the result may only be predictable to another calculating device of comparable sophistication.
It may be beyond what a human observer can project. The formulae behind these functions are an art in themselves, but you need only trust that a returned random value will be good enough to fool us dumb humans. I may make light of the topic, but pseudo-randomness is a significant problem in computer science, mainly because of its use in data encryption.
But this only moves the debate into the realm of chaos math and the questionable quantum predictability or unpredictability of the natural world. Using random is simple. A random function typically returns a value in the range 0 to 1, which you can then manipulate to give a value within any given range. In Processing, you pass a parameter to give a maximum value, or two parameters to return a number within a range.
Without using any parameters, you can express any random range as follows: Note how you use the width and height constants, even though you know the width is and the height is It means the script will adapt to these relative values if you decide to change width or height later. Without wanting to be too judgmental of your first piece of generative drawing, this is rather uninteresting. You could start by breaking the line-drawing process into a series of steps. The following code chunk uses a for loop to iterate through the x position in pixel steps, keeping track of the last x and y positions so it can draw a micro-line back to the previous point.
The line is constructed as a chain of 46 links. The resulting image in the output window will look exactly the same as that shown in figure 3. Add an instruction to vary the y value with every step: The result is shown in figure 3. Generative Art Pearson Figure 3. The line will be different every time you run the script. In the following example, instead of just making the y position random in a range, you add or subtract a random amount from the previous y value, creating a more natural variance: The Technical Achievement Oscar that Ken was rather belatedly awarded in was for his work on procedural textures developed while working on the graphics for the science fiction film TRON TRON was a pioneering movie in both subject matter and production.
Most significantly, though, it was one of the first films to rely heavily on computer graphics for its special effects. He was looking for ways to generate randomness in a controlled fashion, much like we were in the previous section.
The Wrong Way to Draw a Line 3. You pass it a series of seed values, each of which returns a noise value between 0 and 1 calculated according to the values that precede and follow it.
Small increments, between 0 and 0. Pearson 57 Figure 3. Listing 3. For a smoother result, you can reduce the x step to 1, so the line steps only one pixel at a time horizontally; reduce the ynoise step accordingly.
Figure 3. Generative Art In this example, the sequence of values starts somewhere between 0 and 10 random 10 and increments by 0. The call to noise for every seed value in the sequence returns a floating-point number between 0 and 1, which you adapt multiply by 80, add 10 to produce a useful y value between 10 and The result one possible result, anyway is shown in figure 3.
Between 10 and 90 59 3. You have the whole world of mathematics to explore. Like noise, the trigonometric functions sin and cos also return values that vary smoothly according to arguments you pass to them. With these two mathematical functions, you pass an angle in radians , and the functions return a value between -1 and 1. Try listing 3. If you replace sin with a cosine function see figure 3. Not too dissimilar from a sine curve.
Is that cheating? Perhaps if you can transform the randomness into something a little more predictable, it may have more aesthetic value. The Wrong Way to Draw a Line only because the calculation is too simple. If you were to raise it to the power of a half, the number would tend toward 1. Taking it further, raising it to the power of 5 or, in the other direction, 0. Pearson 63 3. Through this mechanism, you can add some attractive flavors of variance, freeing your line from its mechanical perfection.
Prepare yourself to rediscover the joys of trigonometry, as we look at that simplest of shapes, the circle. I remember thinking to myself that I would never use this crap in the real world. And I was right—for a couple of years at least. Chapter Four 4 65 4. A Companion to Digital Art. Related Information. Email or Customer ID. Forgot password? Old Password. New Password. Your password has been changed.
Returning user. Request Username Can't sign in? Forgot your username?