INFO 1100: Introduction to Media Programming

3 Week Summer Course (5/31-6/23), meets twice daily, M-F 10:30-12:00 & 16:00-17:00, in Gates Hall G03/05

Course summary

In this course, students will learn how to program a computer by manipulating media, including generating images, producing animations, manipulating text, and making media that respond interactively to user input. We will use Processing, a programming language designed for visual and interactive applications, as a basis for creating and developing software ‘sketches’ that allow students to express themselves visually. This course is designed for students with no technical background; students who have already completed CS 1110 or have similar programming background may take the course by permission of the instructor only.

The core concept of this class is to cover the standard introductory programming material including variables, types, control structures, iteration, functions, arrays, and object-oriented programming, but to do so in a way that emphasizes the creative potential of programming and thereby reach students who are turned off by the abstract, mathematical approaches to programming which normally dominate introductory programming courses.

Learning objectives

Planned course topics

  1. Making images: Introduction to Processing programming environment; Drawing geometric shapes to the screen; controlling color, background, foreground; Variables and types; Mathematical operations; Conditionals
  2. Animation: Event loops, frame rates; For loops; Creating motion; Introduction to objects
  3. Transforming images: Image as data, Pixels, color, and image formats; Arrays; Loading images from files, saving images to files; Basic image processing, accessing and altering images; Functions
  4. Interactivity: Event processing, responding to mouse and keyboard input, Object inheritance
  5. Transforming text: String data type, Creating and storing text, Writing text to the screen, Reading text from files and from the web, Parsing text
  6. Data Visualization: Integrating course topics, programming puzzlers

Course format

Course meetings will interleave short lectures with interactive programming exercises which students will complete in pairs. There will be daily homework assignments which will account for the bulk of the grade. There will also be 2 exams.

Textbook

The course uses the following textbook:

Casey Reas and Ben Fry. Processing: A Programming Handbook for Visual Designers and Artists. Published August 2007, MIT Press.

An excellent alternative, optional text on this subject is:

Shiffman, Daniel. Learning Processing: a beginner's guide to programming images, animation, and interaction. Morgan Kaufmann, 2015. (available online through the Cornell library.)

You will also likely find the processing.org website a useful reference.

Prerequisites

This course is designed for students with no technical background; students who have already completed CS 1110 or have similar programming background may take the course by permission of the instructor only.

Schedule

Introduction

Day 1 (5/31) morning - Intro to Processing

Introduction to the class. How to install and use the Processing environment. What a Processing program looks like. Writing a simple program to create shapes on the screen.

Reading:

Using Processing, pp. 9-11 only

Structure 1: Code Elements, pp. 17-21

Homework 0 due 5/31 at 11pm

Making Images

Day 1 (5/31) evening - Shapes

Image layout. More on drawing shapes and varying what they look like.

Reading:

Shape 1: Coordinates, Primitives pp. 23-35

Homework 1 6/1 at 11pm

Day 2 (6/1) morning - Variables

Using variables to make it easier to experiment with your sketches by changing their parameters. Activity 1, activity 2.

Reading:

Data 1: Variables, pp. 37-41

Day 2 (6/1) evening - Images by the numbers

Using math to manipulate the variables that control your images. Representation of colors in Processing. Controlling the color of your images. A brief introduction to dynamic code. Activity 1, activity 2.

Quiz

Reading:

Math 1: Arithmetic, Functions, pp. 43-50

Color 1: Color by Numbers, pp. 85-93

Homework 2 due 6/4 at 11pm

Responding to input

Day 3 (6/2) morning - Conditionals + Mouse

Varying the behavior of your program based on what someone is doing with the mouse. Programs that decide to do different things based on input data. Activity 1, activity 2, activity 3,

Reading:

Control 1: Decisions

Input I: Mouse 1, pp. 205-210 only

Day 3 (6/2) evening - EXTRA PRACTICE + LAB

Day 4 (6/5) morning - Mouse II

Constructing and controlling programs that run continuously and respond differently in different situations. Using this to respond dynamically to mouse input data. Activity 1.

Reading:

Structure 2: Continuous

Input I: Mouse 1, pp. 210-215 only

Homework 3 due 6/5 at 11pm

Day 4 (6/5) evening - Keyboard

Programs that vary their behavior based on what people type in at the keyboard. More practice in responding differently to different situations. A brief introduction to repetition. Activity 1.

Reading:

Data 2: Text, pp 101-103 only

Input 2: Keyboard, pp. 223-227

Transforming images

Day 5 (6/6) morning - Repetition

Designing programs that 'loop,' or repeat the same instruction multiple times. Using loops to create patterns in an image. Activity 1.

Quiz

Reading:

Control 2: Repetition, pp. 61-68

Homework 4 due 6/6 at 11pm

Day 5 (6/6) evening - Operating on images

Introduction to pixels. Altering images by accesing and altering pixels. Loading and saving images. Activity 1.

Reading:

Image 1: Display, Tint, pp. 95-97 only

Image 3: Pixels, pp. 321-325

Output 1: Images, pp. 367-368 only

Day 6 (6/7) morning - Arrays

Introduction to the array, or structured lists of values. Use of the array to allow for more complicated control of images (without making your code more complicated). Activity 1, activity 2,

Reading:

Data 4: Arrays, pp. 301-313

Day 6 (6/7) evening - Images using arrays

Operating directly on arrays of pixels in order to transform and manipulate images. Array Tutorial.

Reading:

Image 5: Image Processing, pp. 355-360, pp. 364-365

Day 7 (6/8) morning - Functions

How functions can make your code easier to write and debug. Defining and using functions in your code. Using functions to modularize an image processing program. Activity 1, Activity 2, Activity 3.

Reading:

Structure 3: Functions, pp. 181-190, 193-196

Homework 5 due 6/8 at 11pm

Day 7 (6/8) evening - Image processing

Using for loops, arrays, and functions to read and alter images on the fly. Activity 1, Activity 2, Activity 3.

Reading:

Image 5: Image Processing, pp. 355-360, pp. 364-365

Homework 6 due at 11pm

Pause and Synthesize

Day 8 (6/9) morning - Review

Homework 6 due 6/8 at 11pm

Day 8 (6/9) evening - EXTRA PRACTICE + LAB

Day 9 (6/12) morning - Midterm

Transforming text

Day 9 (6/12) evening - Intro to text

How Processing stores text. The String object. Data conversion. Creating strings, printing them, and displaying them to the screen. Activity 1, Activity 2, Activity 3.

Reading:

Data 2: Text, pp. 103-104

Data 3: Conversion, Objects, pp. 105-109

Day 10 (6/13) morning - Visualizing text data

Using Processing to read and visualize plain text files. Looking for and visualizing patterns in text.

Homework 7 due 6/14 at 11pm

Day 10 (6/13) evening - Objects

Using objects and classes to structure your code. Defining and instantiating classes.

Reading:

Structure 4: Objects I, pp. 395-406 only

Day 11 (6/14) morning - Arrays of objects

Arrays of objects. Modularizing files.

Reading:

Structure 4: Objects I, pp. 406-411 only

Homework 8 due 6/15 at 11pm

Day 11 (6/14) evening -Using text files to control programs

reading text from a file to control your program's output. Finding patterns in text. Using text data to change what programs do.

Reading:

Input 6: File import

Quiz

Day 12 (6/15) morning - Writing text files I

Writing data from your program to a text file, which can be used as input later.

Reading:

Output 2: File export

Day 12 (6/15) evening - Writing text files II

Writing data from your program to a text file, which can be used as input later. Finishing out morning lecture and working on Homework 8

Day 13 (6/16) morning - Reading from the web

Loading a web page, finding the data you want on it, and responding to that data in your program.

Homework 9 due 6/18 at 11pm

Day 13 (6/16) evening - EXTRA PRACTICE + LAB

Deepening Processing

Day 14 (6/19) morning - Advanced objects

Using classes that inherit from other classes. Using these techniques to simplify your code.

Reading:

Structure 5: Objects II, pp. 456-460 only

Homework 10 due at 6/19 11pm

Day 14 (6/19) evening - Event handlers

How Processing programs can respond to things that happen outside of it. Real-time interaction using event loops. What is an 'event' and how can programs respond to one. Using events to create meaningful interactivity.

Reading:

Input 3: Events, pp. 229-236

Day 15 (6/20) morning - Multiple constructors and multiple objects

Using multiple constructors and creating composite objects.

Reading:

Structure 5: Objects II, pp. 453-455 only

Homework 11 due at 6/21 11pm

Day 15 (6/20) evening - Multiple constructors and multiple objects II

Day 16 (6/21) morning - Recursion

Using recursion, or functions that call themselves, as a way to generate more complex structured images.

Day 16 (6/21) evening - EXTRA PRACTICE + LAB

Review and Wrap-up

Day 17 (6/22) morning - Simulation and Synthesizers

Dorking around with the cool code, for cool outcomes.

Day 17 (6/22) evening - FINAL REVIEW DAY

Day 18 (6/23) morning - Final

Day 18 (6/23) evening - Intro to Python

Assignments

The assignments in this course are designed to help you develop and assess programming skills. Your work for the class will consist of the following components: readings from the course textbook and in-class handouts; brief, informal quizzes to help you and us keep tabs on how well you are understanding the course content; near-weekly homeworks that let you practice and develop your programming skills; and a mid-term and final exam. Of all these assignments, the homeworks are most critical because they are where you will really be learning the course material.

Homework assignments are posted to, and can be submitted at, our Course Management System. If you do not have an account for this class, please contact me to be added.

Grading formula

Grading is not just a matter of numbers, but also of judgment. I reserve the right to adjust grades by up to half a letter grade based on knowledge of your performance not summed up in this tidy formula.

Due dates

Homeworks are generally due via submission to our Course Management System. Late assignments accrue a half-letter-grade penalty for every 24 hours they are late, starting directly after the deadline (i.e. submitting at midnight on the due date would make a one-day penalty). All students may submit up to 2 homeworks in the semester up to 2 days late without a penalty - please save these for emergencies such as sickness, as additional extension requests will only be granted in extraordinary circumstances.

Regrade requests

If you believe that there may have been an error in grading your assignment, you may request a regrade in the 7 days after an assignment has been graded by contacting me in person or by email, explaining the nature of the mistake. I reserve the right to lower the grade as well as to raise it.

Academic Integrity

Academic integrity is taken seriously in this course. Please be aware of the specific requirements of academic integrity at Cornell.

You may be wondering what 'academic integrity' means in the context of programming. In this course, you may consult with other students for conceptual and debugging help while working on your code, but unless otherwise specified on the assignment the final code you submit should be written, tested, and documented by you. This means that, with the exception of code developed in in-class exercises, if 2 students submit code that is substantially the same we will consider this a likely academic violation. All assignments will be automatically scanned for similarity.

It is a usual practice for real-world programmers to find and adapt publically available code written by others in their own projects, and you may also do this in this class. If you use 'found code' from on-line sources you must bring that code up to the standards expected in this course. You must also identify which code is 'found' and document its source with a comment in your code, just as you would for an academic citation in a written paper. Unless otherwise specified for a particular assignment, found code may not take up more than 10% of the code that you submit (counting by correctly formatted lines).