Processing
Creative Coding and Generative Art in Processing 2
Ira Greenberg, Dianna Xu, Deepak Kumar
PROCESSING
Copyright 2013 by Ira Greenberg, Dianna Xu, Deepak Kumar
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Exempted from this legal reservation are brief excerpts in connection with reviews or scholarly analysis or material supplied specifically for the purpose of being entered and executed on a computer system, for exclusive use by the purchaser of the work. Duplication of this publication or parts thereof is permitted only under the provisions of the Copyright Law of the Publishers location, in its current version, and permission for use must always be obtained from Springer. Permissions for use may be obtained through RightsLink at the Copyright Clearance Center. Violations are liable to prosecution under the respective Copyright Law.
ISBN-13 (pbk): 978-1-4302-4464-6
ISBN-13 (electronic): 978-1-4302-4465-3
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logos, or image we use the names, logos, or images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made.
The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com , or visit www.springeronline.com .
For information on translations, please e-mail rights@apress.com or visit www.apress.com .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk SaleseBook Licensing web page at www.apress.com/bulk-sales. APress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Any source code or other supplementary materials referenced by the author in this text is available to readers at www.apress.com . For detailed information about how to locate your books source code, go to www.apress.com/source-code/ .
The front cover image was generated by the Processing sketch noise.pde found in .
Credits
President and Publisher: Paul Manning
Lead Editor: Ben Renow-Clarke
Technical Reviewer: Ryan Rusnak
Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Louise Corrigan, Morgan Ertel, Jonathan Gennick, Jonathan Hassell, Robert Hutchinson, Michelle Lowman, James Markham, Matthew Moodie, Jeff Olson, Jeffrey Pepper, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Gwenan Spearing, Matt Wade, Tom Welsh
Coordinating Editor: Anamika Panchoo
Copy Editors: Michele Bowman, Linda Seifert
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Cover Image Artist: Corn van Dooren
Cover Designer: Anna Ishchenko
To Robin, Ian, and Sophie, and to Hilary, Jerry, and Eric
Ira Greenberg
To Marcus and Kira
Dianna Xu
To Debika and Sameer
Deepak Kumar
Contents at a Glance
Contents
Foreword
One of the very best things about writing a book is the opportunity it presents to meet new people. After the release of Processing: Creative Coding and Computational Art, in June 2007, I received many thoughtful notes from creative coders around the world. Most of these readers, similar to me, came from the arts and were just discovering the exciting creative potential of code. I also received some notes from professional programmers and computer scientists, which at the time was very surprising. As a self-taught coder, I wasnt sure what I could offer trained computing professionals, or even if I would be taken seriously.
Two of the computer scientists I met at the time were Deepak Kumar and Dianna Xu, both professors in the Department of Computer Science at Bryn Mawr College. Deepak and I first communicated (virtually) in the Processing online forum, during a somewhat heated discussion thread about the disconnect between the creative coding and computer science communities, especially within academia. You can read the original thread at: http://processing.org/discourse/beta/num_1212418008.html . Near the end of the thread Deepak graciously extended an open invitation to visit Bryn Mawr, to present Processing and explore the connections between our two communities. What especially motivated me to follow-up on Deepaks invitation was the last sentence of his comment:
Lets work together and see how we can bring about some radical change!
During my initial visit to Bryn Mawr I met Dianna and Deepak. Though I had been coding for a fairly long time by now and had regular interactions with computer science faculty from the institution where I was teaching, it was still intimidating sitting across the table from themwith actual PhDs in Computer Sciencebut it was also equally exhilarating! Dianna and Deepak were very seriously exploring new ways to teach Computer Science, including how to make programming more engaging and accessible to the widest possible audience. They had been very successful pioneering an earlier approach utilizing robots in the introductory computing classroom. It was such a thrill to learn about their work and to be able to talk so intensively about coding and computer science pedagogy. Though we started from very different placesthe arts and computer sciencewe somehow ended up in a pretty similar place, with a shared passion for presenting computation as a powerfully creative and fascinating medium, and spreading the word to future generations.
Over the next few years, Deepak, Dianna, and I worked closely presenting lectures and workshops on Processing and our emerging creative coding approach. We were very fortunate to receive funding from the National Science Foundation enabling us to more formally explore our approach in the Computer Science 1 (CS1) classroom, which we did at our respective schools. During this period we also began discussing the idea for a new CS1 book, based on Processing and creative coding. These discussions, along with the result of our research, directly led to the creation of the book youre holding in your hands.
This book is a departure from the existing Processing and CS1 literature in that it attempts to present the spirit and excitement of creative coding, while rigorously covering the fundamentals taught in the CS1 classroom. We structured the book to be useful to the autodidact, but equally useful to the CS1 instructor, at both the secondary and post-secondary levels. Weve each had very positive results utilizing the books approach within our own classrooms and are very excited to now help others do the same.
Next page