Generative art matt pearson pdf

Friday, March 29, 2019 admin Comments(0)

Request PDF on ResearchGate | On Dec 1, , Gary Greenfield and others published Generative art: a practical guide using Processing, by Matt Pearson. by Matt Pearson, Greenwich, CT, Manning. Publications generative art was first sparked decades ago when I . Since my review copy was a pdf version of. Manning Publications. Paperback. Book Condition: new. BRAND. NEW, Generative Art, Matt Pearson, DESCRIPTION Artists have always explored new media.

Language: English, Spanish, Arabic
Country: Dominica
Genre: Biography
Pages: 769
Published (Last): 09.02.2016
ISBN: 573-2-22882-861-8
ePub File Size: 24.47 MB
PDF File Size: 14.63 MB
Distribution: Free* [*Regsitration Required]
Downloads: 32258
Uploaded by: JERALD

The Kindle version is text only, but the PDF includes all the code and imagery. " Matt Pearson has provided an excellent introduction to generative art using. Generative Art. A practical guide using Processing. Matt Pearson Foreword by Marius Watz. June ; ISBN ; pages; printed in black &. art a practical guide using processing foreword by marius watz matt pearson Generative art is neither programming nor art, in their conventional sense.

In listing 6. A building has straight edges and sharp corners: Most modern mobile phones run Java. There are also two great tutorials on creativeapplications. This is how you tell Processing which rendering engine to use:

The author just glazes over the syntax and gives the bare minimum information about programing standards. This may be because processing is not a complex language and you can get away with know If you are new to programming and have ever programmed before, don't read this book yet.

This may be because processing is not a complex language and you can get away with knowing the bare minimum. I only wish the chapter on fractals was longer. That was my main reason for getting this book, but it was enough information to get me started in the right direction.

Dec 30, Tran rated it it was amazing Shelves: Design Programming was one of the three compulsory units of study in my first semester. An extremely well-written book, especially the Introduction part: Feb 17, Koshka rated it really liked it Shelves: Jun 28, John rated it it was ok.

Doens't really offer anything that you couldn't find online. Good for an absolute beginner. Jan 25, Jake McCrary rated it really liked it Shelves: This book shows you some building blocks of generative art. It uses Processing and steps you through examples ranging from as simple as drawing a line to generating fractals. All of the examples support Matt Pearson's idea that by embracing chaos you can create something interesting. I rewrote pretty much every line of code in this book into Clojure using the Quil library.

The immutable nature of Clojure transformed some of the examples dramatically. I'm not sure how approachable this book would be This book shows you some building blocks of generative art. I'm not sure how approachable this book would be to someone who doesn't have at least some background in writing software. Enjoyable book. It took me a long time to work my way through it.

I particularly enjoyed the chapters on using emergence and autonomy to generate interesting chaotic systems. I have some ideas for future projects based off some of the learnings in this book. Jul 03, Toby rated it really liked it.

A great introduction to generative art with Processing, with lots of practical examples and some colour plates at the start of the book. This book is ideal as a starter and inspiration, however by keeping things simple it doesn't go into the depth needed for a more long term or reference book. A lot of very simple and important functions and programming concepts are not covered, so you would need to get another book alongside this.

I enjoyed the authors informal and friendly style and step by st A great introduction to generative art with Processing, with lots of practical examples and some colour plates at the start of the book. I enjoyed the authors informal and friendly style and step by step instructions. Eric Tommer rated it liked it Apr 09, Julio Sueiras rated it really liked it Jan 20, Neil rated it really liked it Sep 12, Hussein rated it it was ok Dec 08, Kentskyo rated it really liked it May 18, Karl rated it liked it Jun 02, Siddhartha Mukherjee rated it it was amazing Mar 18, Scott Fitzgerald rated it it was amazing Jan 31, Raleigh rated it really liked it Jan 03, Rash rated it it was amazing Mar 25, Stef Woznarowycz rated it it was ok Jan 03, Mike Pepper rated it it was amazing Apr 26, Alberto Lara pompa rated it liked it Nov 29, Graham Heath rated it it was amazing Jul 12, Heather rated it liked it Jul 08, Ben Mitchell rated it really liked it Dec 06, Cat rated it it was amazing Mar 17, Pfree rated it really liked it May 18, Shuangshuang Huo rated it it was amazing May 19, Bob rated it it was amazing Oct 30, Anders Lund rated it really liked it Aug 25, Luis Fernando rated it it was amazing May 05, Sahand Akbari rated it really liked it Mar 03, The code for many of the other works in this book can also be found there.

We may think we have both mastered the chaos and fought off the boredom and madness of purest order. But any living being can testify that there is a constant fluctuation between the two. No matter how much order you impose upon your life, chaos is never more than a car crash away. The complex appeals to us as much as the simple, the organic as much as the mechanical. Fashion or mood may sway us more toward one or another in any given situation, but we never go completely over to one side or the other.

For to do so is to stop living; to eradicate chaos is to become a robot; to eradicate order is to become a savage. Fortunately, no one is asking us to take sides. The aim of generative art, if it has any aim at all, is to make something beautiful. We can attempt to use the mechanical to create the organic, starting from order and heading toward chaos, careful not to stray too far in one direction or the other.

And if we become adept at this, we may be able to consider ourselves both programmer and artist. Two more of his creations appear in figures i. You can explore his other work and processes at www.

This is because, traditionally, programming languages have been the realm of logic, structure, and organization. Highly logical activities such as these inevitably make coding unattractive to more creative thinkers. This is a waste. They can be equally effective in the hands of a designer or in the hands of a systems architect, but the works created by these tool users will be radically different.

The history of programming has been toward ever-greater sophistication of organization. The intention is that common challenges can be addressed the same way, in a move toward a more universal language of programming. A fractal inspired by Piet Mondrian.

The joy of creating fractal structures is exploring the detail: Each detail is from zooming in to the upper-left corner of the previous image. These ideas are explained in chapter 8. Perlin noise applied to 3D circles.

All the necessary principles behind this work are discussed in chapters 4 and 5. It shows one of four generative animations created from the movement of the spectators viewing the piece approaching language use. But not the rules of programming syntax, unfortunately. This is an unfortunate reality. A programming language is, after all, just another language.

And a language can be spoken in many different ways, with a variety of accents or inflections. My conjecture is that code can be poetry, and code can be fun. But we may have to sacrifice some of the rigidity, good design, and best practices of professional, commercial programming to enable this. Ali published this work as an app, so others could create their own images using his system. You can download it from www. Figure 1. Agent-oriented behaviors at the micro level, producing emergent complexity at the macro level.

If these words mean nothing to you right now, chapters 6 and 7 will explain. It may even be in the realm of the ineffable. Without this unpredictability, our art would belong in a box other than the one labeled generative. Generative artists are chaos artists. They have bred the unpredictable, welcomed it, harnessed it, and can fashion it into pleasing forms.

Unpredictability is something unwanted in traditional programming practices, which is why more experienced programmers reading these words may be finding some of these ideas unpalatable. But trust me: Nonlinear approaches to the familiar can be healthy for the brain.

And, who knows, you may even be able to take some of these creative angles back to your coder day job and make yourself incredibly unpopular with your bosses and colleagues. Seriously, what is the worst that can happen? In my mind, GenArt is just another byproduct of the eternal titanic battle between the forces of chaos and order trying to work out their natural harmony, as expressed in a ballet of light and pixels. But, as is the nature of all things generative, even this definition has an emergent complexity.

Chapter One 1 1. You can read Prof. The concept of art can be so fragile and fuzzy that if we were to prod it too much, it would evaporate.

This is clearly doing it the hard way. With generative art, the autonomous system does all the heavy lifting; the artist only provides the instructions to the system and the initial conditions. This is hideously unfair, of course. In addition to the programming, the human contributes one other important skill: If we need to calculate pi to a million digits, it would be a misappropriation of resources to set a human brain to this task.

The common factor of generative artworks is the methodology of its production, not the style of the end result. This particular arrangement of pixels may have been achieved in Adobe Illustrator not by my cloddish paws, 2. In Theory and Practice Figure 1. In this book, the programming language, specifically the Processing language, is the chosen tool. To be able to call a methodology generative, our first hard-and-fast rule needs to be that autonomy must be involved.

The artist creates ground rules and formulae, usually including random or semirandom elements, and then kicks off an autonomous process to create the artwork. The second hard-and-fast rule therefore is there must be a degree of unpredictability. It must be possible for the artist to be as surprised by the outcome as anyone else. Creating a generative artwork is always a collaboration, even if the artist works alone. Partauthorship of any generative work must belong in part to the mechanisms the artist uses: To retain a necessary focus, this book discusses only one tool—the programming language— as a way of producing only one range of output: But generative methods may also be used to produce music, architecture, poetry, dance, storytelling or interactive experiences, and the autonomous systems behind their creation may also be mechanical, games of chance, natural phenomena, or subconscious human behavior.

Art colleges across the globe are churning out tens of thousands of painters, potters, fashion designers, and graphic designers every year, but the number of practicing generative artists in the world at present could probably fit comfortably onto a single Caribbean cruise liner which would be a lovely idea if anyone fancies arranging it. This demographic is changing fast, though. As popular computing technology accelerates, more creative people are getting theirs hands on the tools and discovering this novel art form.

Generative forms of music, for example, have been around since Mozart. The idea was to create a minuet by cutting and pasting together prewritten sections, making selections according to the roll of a die.

Even with a single six-sided die, the number of possible combinations rises quickly: These types of artistic parlor games became popular in the eighteenth century. Generative Art: In the last century, composers such as John Cage, Karlheinz Stockhausen, and Brian Eno expanded on the idea of generative music.

Generative Art Later, Stockhausen and Eno and others experimented with procedural methods of composition, where music is defined by a set of rules or conditions.

The first side is a minute piece created by a tape-loop feedback system. A synthesized melody was recorded onto a tape machine, the output of which was fed into a second tape machine.

The output of the second machine was then fed back into the first machine and the overlapping signals recorded. We know of this process because Eno included a diagram of his setup on the back cover of the LP see figure 1. Pearson 3. Even though Processing can be used to create generative music, this book focuses solely on the creation of visuals.

Generative music is a huge and fascinating topic that warrants a book of its own. Mohr wrote his own software in order to explore his art. The real tools of GenArt, the underlying constants to the various tools you can use, are the algorithms. Algorithms are a part of the natural world; they have a universality that transcends medium.

So while the systems capable of creating GenArt change over time, evolving as technology evolves, the algorithms remain the same. Generative art may not be quite as old as art itself, but it may be said to be at least as old as mathematics. This book is all about the algorithms. We invest a lot of time in mastering their quirks, and we upgrade them frequently.

Generative Art

Software and hardware alike, all of these are the tools in your digital toolbox. But how long-term are these man-machine marriages? In Theory and Practice plotters, then with visual display units VDUs , and later in more sophisticated forms of print and video.

Pdf matt generative art pearson

It was the cutting edge of British home computing circa The lack of a visual operating system meant you had to learn basic programming skills just to be able to load a game.

An application like Adobe Photoshop has, on average, a major new release every 18 months, with a dollar price for each release in the hundreds. It would be unimaginable to buy a chisel, or a paintbrush, or a set square, knowing that it would be obsolete in two years, yet this almost-immediate obsolescence is unquestioningly accepted on the cutting edge of both hardware and software.

An unwritten complicity exists between users and manufacturers of technology. The manufacturer will have a roaring trade if every year it can deliver the same product to the same customer who bought it last year, but this is made possible only by the demand of the market: This creates a cycle of perpetual impermanence, which marches the technology forward. 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.

Matt generative pearson pdf art

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.

Art pearson generative pdf matt

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.

Manning | Generative Art

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. The iPhone and iPad though, are a different matter.

Small steps are already being made. But at the If you want a quick way to see your Processing sketches on your iPhone, there is one beautifully crazy solution. You can find the download and introduction to Processing. It exists as a few hundred lines of JavaScript that you include in a webpage. You can find it here: Anything you create using Processing. 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.

Part 1 Creative Coding

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. I scribbled the arcane markings you see in figure 4. Figure 4. But there is a lot more fun to be had if you break it down a little. The sine of angle x is equal to the opposite over the hypotenuse. The cosine of angle x is equal to the adjacent over the hypotenuse.

Knowing the center point of the circle, the hypotenuse between the center and a point on the circumference is the radius. The opposite and adjacent then correspond to the difference in x and y positions from the center point. By jigging the equations, you can calculate the coordinates of any point on the circumference of a circle relative to the angle as follows: Increments of 5 degrees are smooth enough for this example, but you can decrease this increment later if you want.

Radians and degrees Angles used by trigonometric functions are in radians, not degrees. Pearson trigonometric function. The formula is on my postcard: You now have a systematic way of drawing a circle; the next job is to begin tweaking it into something less rigid.

To do so, you simply increase the radius as the angle turns. The required changes to the code are highlighted in the following listing, and the output is shown in figure 4. So far, so boring. A possible output is shown in figure 4. Is that a butterfly in the middle there? The next step—and I firmly believe that, if in doubt, this should always be your next step—is to multiply it all by see figure 4.

In this version, you use a for loop to draw the same spiral times. You also lighten the line weight; and for each spiral, you randomize the stroke color, the alpha, the starting angle, the end angle, and the angle step.

The full code is in the following listing. Listing 4. In the last chapter, you created a custom random function for the drawing of a line. In listing 4. The Wrong Way to Draw a Circle a start. Instead of drawing lines back to the previous point, as you did before, this time you use beginShape and endShape to draw an enclosed area to which you apply a fill.

You add points to the shape with curveVertex x,y. The result is something a little like figure 4. Pearson Using this function, you end up with something like figure 4. Now that you have the structure, you can experiment with the mathematics in your new function. But you now have a custom variance you can call your own, which you can apply to lines, shapes, movement, or anything else you might apply noise to.

The next stage is to continue throwing whatever mathematics you know into the function and seeing what other glorious messes the routine can create see, for example, figure 4. Juggle some numbers, alter the shapes or the drawing style, turn it up to 11, and see if you can surprise yourself. Wave Clock My Wave Clock see figure 4. I began by plotting a circle, exactly as you did in the previous section, and then drawing a line from each point on the circumference to its opposite point.

I then extrapolated the two circumference points using the same sine and cosine functions: Next, I made the length of the connecting line change by varying the radius with a noise value as it rotated see figure 4. I allowed the angle to increase or decrease so the rotation could reverse. This gave the effect you can see in figure 4.

To give it a fade, I added a few lines to vary the stroke color. I defined a strokeCol variable, started it at white , and decremented it by 1 every frame until it reached 0 black. Then, I reversed the process back to ad infinitum. The result is shown in figure 4. Finally, for one extra touch of non-linearity, I wobbled the center of the circle slightly, again using a noise function to move it plus or minus 10 pixels in the x or y direction: The basic methodology established in these last two chapters is as follows: Reconstruct it with some form of unpredictability.

You can apply this simple technique to make just about anything more interesting. But you may now want to try other computer-drawn forms. This is the point at which you should consider adding extra dimensions.

The computer monitor, printed page, or gallery wall has only two dimensions. Anything you create for these media will always be flattened for presentation.

At this stage, it feels as though there is nowhere new for you to go, nothing new to see. That is, until you discover up, and suddenly you find a perspective from which ever ything looks ver y different. Chapter Five 5 1. One-dimensionally, a progression of noise values yields a wavering line, like a mountain range viewed on the horizon.

Open a new script, and tap in the contents of the following listing. Listing 5. You loop through the pixels of this by square, traversing column by column, row by row, one pixel at a time. Noise seeds in the x and y direction are incremented by 0.

The result is shown in figure 5. Generative Art 5. In this case, you draw a tiny square, using the noise factor to determine its size. How about visualizing the noise as a rotation? The functions pushMatrix and popMatrix are a way of storing the previous drawing position before you perform the translation and rotation, and then restoring it afterward.