nickm.com > classes > cms workshop ii, spring 2013

CMS.951: Comparative Media Studies Workshop II

Spring 2013

Instructor: Nick Montfort, nickm at nickm dotcom, coachmontfort (AIM, by appointment), 14N-233 & E15-329
Office hours Wednesdays, 1pm - 2pm, 14N-233 (The Trope Tank) & by appointment
Class meets Mondays, 1pm - 6pm, E15-335

Updated 15 February 2013

This is a hands-on, workshop/studio format course about using computing as a way to think about media — about exploratory programming.

We will spend most of our time and effort, during our class meetings and outside of class, writing programs that help provide us new artistic and humanistic perspectives on media. Two assigned books provide some readings to help us better connect this practice to our theoretical and critical work. In this class the readings are not the primary way we will learn; they are assigned to support our project work and help us generalize our insights from that work.

No programming experience is required. The exercises and projects are meant to offer "low stairs" for those who have not programmed before and "high ceilings" for those who have significant background.

Projects are largely individual, to maximize the time each student has for exploration and to allow students to choose suitable open-ended projects for their ability levels and interests.

All programming environments used in this class are cross-platform and, with the exception of Commodore 64 BASIC, all are completely free software.

Two books are required for this class. Both are available online in PDF format for free. Both are also available in inexpensive hardback editions from the MIT Press Bookstore (at a 10% discount for MIT students) and from your favorite online bookstore. Given that there is a free, downloadable edition of both of these, I did not ask for either book to be stocked by The Coop.

Digital_Humanities
Digital_Humanities by Peter Lunenfeld, Anne Burdick, Johanna Drucker, Todd Presner and Jeffrey Schnapp. While celebrating the humanistic tradition, this book explores methodologies and techniques unfamiliar to traditional modes of humanistic inquiry — including geospatial analysis, data mining, corpus linguistics, visualization, and simulation. To make the point that digital media studies are not synonymous with the digital humanities, this book's case studies deal with traditional cultural heritage materials from centuries past, but the argument of Digital_Humanities is relevant to studies of contemporary culture as well. This book frames the small-scale explorations we will undertake in class in the larger context of the humanities and the digital humanities, explaining what sorts of larger projects can be undertaken using one's ability to program in an exploratory mode.
10 PRINT
10 PRINT CHR$(205.5+RND(1)); : GOTO 10 by Nick Montfort, Patsy Baudoin, John Bell, Ian Bogost, Jeremy Douglass, Mark C. Marino, Michael Mateas, Casey Reas, Mark Sample and Noah Vawter. This book takes a single line of Commodore 64 BASIC code and uses it as a lens through which to consider the phenomenon of creative computing and the way computer programs exist in culture. Code is treated not as merely functional but as a text that yields a story about its making, its purpose, its assumptions, and more. The study of the 10 PRINT program is accomplished not only through familiar humanistic means but also through programming variations, ports, and extensions of the original program, the code of which is included and discussed. This book presents a digital humanities project, undertaken collaboratively, that is essentially about computation and culture.

This syllabus is tentative and may be updated throughout the semester. Major changes (in deadlines, assigned readings, etc.) will be explained either in class or by email. Details about how grades are assigned are at the bottom of this page.

1 · Feb 11

Computation and Programming. The approach of the class is introduced: Providing access to the ways that computation and programming work, rather than offering instruction in a particular programming language. Some of the ways computation has been transforming the humanities and arts will also be introduced. The idea of generality is discussed and demonstrated, both with regard to the arbitrary input that computer programs may use and the arbitrary ways that they may work upon their input. Programming is distinguished from editing and the use of applications because, at the cost of more complexity, it allows the truly general use of the computer: Anything a computer is able to do can be done on any input.

Programming as an exploratory and expressive practice is introduced using the Commodore 64 and the BASIC programming language, not out of simple nostalgia or for retro cachet, but because (1) this platform is very amenable to exploratory programming, and (2) use of the system provides a historical perspective on popular programming.

Students will develop very simple (one line) Commodore 64 BASIC programs that generate visual patterns using character graphics. These will be completed in class.

Through discussion of 10 PRINT and in-class examples of BASIC one-liners, we will determine several specifics ways in which code connects to culture and speculate about how these connections may manifest themselves in other programs.

Install for Feb 11 on your computer: The VICE emulator.

Read for Feb 11: 10 PRINT pp. 1-62 (through "REM Ports to Other Platforms").

2 · Feb 19 (Tuesday)

Three Starting Points. Three small starter programs will be presented in both Python and JavaScript. The two languages help to show the different contexts of the terminal window and the Web browser and the different ways in which programming languages are designed:

Hello World. Making the computer "speak," and say hello, is often the first task done when learning to program in an imperative programming language, one which frames the computer as obedient, autonomous, and able to communicate.

Temperature Conversion. Converting between Fahrenheit and Celsius is often the first mathematical function implemented by new programmers. It shows demonstrates how computation is general — how it can work on arbitrary values. But this is a practical program, for an important reason: measurement systems are culturally situated and units require conversion.

Fibonacci Numbers. Generating the nth Fibonacci number is a typical early exercise, or first exercise, when learning a functional programming language. It demonstrates recursion, showing that the computer can do a long, multi-step computation about as easily as it can perform the one-step conversion above.

Students will each create an alternative "starter program" of similar simplicity to the ones demonstrated — one that does only one simple thing. Those with existing programming background may wish to try a using another programming language they are curious about but unfamiliar with. Those new to programming can work in Python or JavaScript, and can develop examples based on research online. The programs will be completed and shown in class; a short text explaining the rationale for the program and the cultural connection is to be written and posted online with the program before the next class meeting.

We will discuss how platforms of different sorts (such as the Commodore 64, BASIC, our computers and operating systems, Python, and JavaScript) relate to the programs written in them, with reference to the 10 PRINT reading and in-class work.

Install for Feb 19 on your computer: Confirm that you have Python 2.7 (not Python 3) installed — it is installed on Mac OS X and most Linux distributions by default. On Windows, install Python 2.7.3.

Install for Feb 19 on your computer: Firefox, even if you strongly prefer another browser, because we will be using the Firefox scratchpad.

Read for Feb 19: 10 PRINT pp. 63-242 (through "The Commodore 64").

Read for Feb 19: "Critical Code Studies" by Mark Marino, 2006. (Web, about 12 pp.) In Electronic Book Review.

Read for Feb 19: "Hello, World Considered Harmful" by Ralph Westfall, 2001. (2 pp.) Search for & download this article via MIT's subscription to the ACM Digital Library.

3 · Feb 25

Programming Fundamentals. The most essential programming concepts will be introduced here briefly with examples and exercises in both Python and JavaScript. Code's essential property of being formal, and the difference between formal validity and proper functioning, will be discussed. Variables, values, and assignment will also be explained, as is the basic principle behind type systems. Iteration and nested iteration will be explained. The concept of an object (as in Object-Oriented Programming) is also introduced. While these concepts are to be explored in detail later, they will be introduced here. As concepts are introduced, it will be shown how exploratory programing can demonstrate them and can allow the programmer to learn more about them.

Install for Feb 19 on your computer: A true GUI text editor. On Mac, a very good choice is TextWrangler, unless you want to invest in the even better BBEdit. On Windows, the built-in application Notepad is suitable, but consider Notepad++, which is free and very good. There are plenty of options on Linux (many of which are also cross-platform) including gedit, geany, and Bluefish as well as editors based on pre-GUI systems such as emacs and vi.

Read for Feb 25: 10 PRINT rest of book.

4 · Mar 4

Text & Modeling Data I After introducing some basic computational linguistic concepts, such as the distinction between types and tokens, we see how to compute on language to determine the properties of a document and of a set of documents (a corpus), using Python. Work with text proceeds by modifying and elaborating simple example programs — an important way of understanding programming and developing new code. The use of regular expressions is introduced in Perl (which has great facility for quick text manipulations); the discussion continues using Python. Accessing more advanced computational linguistics resources is discussed with NLTK as the main example. The English-centric nature of text processing, and the persistent bias for the Latin alphabet, is also discussed, as are the practical ramifications for those wishing to work on texts in other languages.

Students develop a general (working on any text file) program to transform texts in ways that support humanistic research and/or are aesthetically pleasing and provocative. The program can be more or less elaborate, depending on one's previous programming experience, and can developed mainly for humanities research purposes or for aesthetic or literary purposes. A draft or first working version is to be completed in class; the finished versions, with suitable short documentation, are to be completed and posted online before the next class meeting.

Install for Mar 4 on your computer: NLTK.

5 · Mar 11

Text & Modeling Data II

6 · Mar 18

Image. Python programs will be presented for study, offered for modification, and assigned to show how simple bitmap image manipulations work "“ manipulations of the sort found in Microsoft Paint and image viewers, which include flipping the image horizontally and vertically and inverting a monochrome image. Through programming and modifying programs, students implement Photoshop-style filters. Finally, methods for determining properties of images in a corpus, and the relationship of different images, will be described. This should provide a basic, technically grounded understanding, for instance, of the workings of ImagePlot by the Software Studies Initiative.

Students create a program to generate images, one which is not based on the transformation of existing images but allows the viewer/listener to set different parameters and see the difference in output. The first steps should be completed in class; a finished version is to be posted only before the next class meeting.

7 · Apr 1

Statistics. An introduction to the essentials of statistics, as they are likely to be used by humanists and artists, is provided here along with programming examples. Statistics is introduced not as a scattered collection of tools, but as a discipline for systematically interpreting data. With high-quality data (which can be difficult to collect), statistics can be used both to test hypotheses and to explore correlations and trends, pointing to areas worth further study. The language used is not the one I originally listed, GNU Octave, That system is a Matlab-like free software system which has excellent facilities for working with matrices and provides easy access to statistical operations. I will show it briefly in class so you can get an idea of what languages and frameworks are available. Please install, however, SciPy, a library (like NLTK) which provides advanced statistics capabilities within Python.

We will discuss the first half of Digital_Humanities and relate the discussion in the book to the field and our experiences in class.

We will discuss "A Short Guide" in relation to our inscription mini-project, discussion of statistics, and general thinking about using computers in the humanities. This guide and the Digital_Humanities book overall remind us that data visualization is not the only type of digital humanities work; the book also helps to situate the practices of DH within the tradition of humanistic inquiry.

We'll use this list of values in discussing basic statistics and how to work with them computationally:

[98.48, 98.6, 99.1, 97.86, 98.6, 98.41, 98.96, 98.05, 98.89, 98.6]

These 5-to-10 minute exercises are provided for the coming week. These are not required or graded; attempting them is strongly suggested. If you encounter problems, copy the text in your interpreter and email it to me and I'll be glad to help.

Install for Apr 1 on your computer: SciPy. SciPy requires NumPy; on Mac you should go to SourceForge and install from there. As the page notes, the binaries do not work with Apple's built-in version of Python.

Read for Apr 1: D_H pp. 121-135 "A Short Guide to the Digital_Humanities."

8 · Apr 8

Data Visualization. It is now common for humanists to "read" and understand data not only by examining statistics, but by viewing visual patterns based on the data. Aesthetic visualizations have also been developed by artists and designers, ones meant for popular viewing rather than for analysis by researchers. The language used to explore both types of visualizations is Processing.

Students create a data visualization system directly corresponding to one or more statistical principles — one that does not just look nice or provoke, but helps the viewer to "see" in statistical ways and to understand data in these ways. It is possible to start from a data set that is of particular interest, to start from a general statistical idea, or to start from a visual idea that is grounded in statistical understanding.

A new set of 5-to-10 minute exercises are provided for the coming week. Again, these are not required or graded; attempting them is strongly suggested. If you encounter problems, copy the text in your interpreter and email it to me and I'll be glad to help.

We will discuss the beginning of Digital_Humanities and relate the discussion in the book to the field and our experiences in class.

Install for Apr 8 on your computer: Processing.

Read for Apr 8: D_H pp. 1-71, parts 1 and 2.

9 · Apr 22

Email me by Tuesday Apr 23 with a preliminary idea or domain in which you would like to do your freeform project. This can be a sentence or two. I will continue the conversation with you and will use what you write to (a) suggest a starting point, and (b) help you prepare by finding and installing appropriate libraries, choosing an appropriate programming language, etc.

We will discuss the rest of Digital_Humanities and relate the discussion in the book to the field and our experiences in class.

These 5-to-10 minute exercises are provided for the coming week.

Read for Apr 22: D_H rest of book.

10 · April 29

We will cover a few of the issues in programming that will confront those continuing on to take on more extensive projects in humanistic or artistic domains. The practical issues of collaborating with others on programs will be discussed and version control systems described. The benefits of modularity will be described, and unit and system testing will be discussed. Commenting and documenting code as well as maintaining it according to an organization's standards will also be discussed here. Time/space tradeoffs and efficiency will be discussed here, making reference to programs studied and written earlier. Choosing a language for a project is discussed, as is developing facility in new programming languages. The use of IDEs, debuggers, and tools for static code analysis is also discussed.

Begin work on the freeform project and have a first sketch completed by the end of class. This project is not a "term project" or typical "final project" in the sense of being a culmination and summary of all the topics covered. It is just another exploration, but at this stage students will be free to draw on any of the work done. Those with previous programming background or a strong drive to develop interactive programs may create such programs, but interactivity is not required.

Read for Apr 29: "What is Computation?" by Ian Horswill.

11 · May 6

Further work on the freeform project (during the first half of class) and presentations of the completed project (second half). Freeform projects will be posted online after presentation, but work on the program should conclude during this class session.

12 · May 13

Sound and Image Generation. Today's class involves writing and sharing sound- and image-generating programs; not programs for analysis or transformation of existing media, but programs that create sound and/or image using computation and paramters.

After introducing an unusual style of very short C program that generates sound (pioneered by the Finnish demoscener viznut), audio synthesis in SuperCollider will be quickly explored. Computing on sound is a highly advanced area, in many cases requiring musical training, and has been less central to digital humanities projects so far than computing on text and image have been. Work with audio is discussed briefly, however, as this is a rich area and introduces time-based data.

Students will use SuperCollider to create a program to generate sounds and Processing to generate images, one which allows the viewer/listener to set different parameters and hear or see the difference in output. This program does not have to traditionally musical or follow visual design/art conventions. A working version is to be run and submitted by email by the end of class.

Install for May 13 on your computer: SuperCollider.

Evaluation