Foundations of Digital Media

Computational sketching

It can be helful sometimes to step into the shoes of those that have gone before, to see how we ended up here, and what we may have lost or missed along the way.

Take John Maeda, the designer & MIT Media Lab professor, who pioneered reactive graphics in the era of the Macintosh and CD-ROM.

Design By Numbers (John Maeda, 1999)
"Drawing by hand, using pencil on paper, is undisputedly the most natural means for visual expression. When moving on to the world of digital expression, however, the most natural means is not pencil and paper, but rather, computation. Today, many people strive to combine the traditional arts with the computer, and while they may succeed at producing a digitally empowered version of their art, they are not producing true digital art. True digital art embodies the core characteristics of the digital medium, which cannot be replicated in any other.

"Computation is intrinsically different from existing media because it is the only medium where the material and the process for shaping the material coexiist in the same entity: numbers. The only other medium where a similar phenomenon occurs is pure thought. It naturally follows that computational media could eventually present the rare opportunity to express a conceptual art that is not polluted by textual or other visual representation. This exciting future is still at least a decade or two away. For the moment, we are forced to settle with society's current search for true meaning in an enhanced, interactive version of the art that we have always known."

Maeda studied with Muriel Cooper, co-founder of the MIT Media Lab, and Paul Rand, and redefined the use of electronic media as a tool for expression by combining computer programming with traditional artistic technique, which helped lay the groundwork for interactive motion graphics as seen on the web today. (This itself is part of a longer genealogical history that traces back to a movement of thought in the 1960's regarding how computers can augment intelligence, the nature of creativity -- with implications for AI development today)

Other key insights from Maeda's interactive graphics explorations:

Maeda's courses and research in the Aesthetics & Computation group at MIT inspired a whole generation of creative coders. He taught Casey Reas and Ben Fry, and his Design By Numbers software was the precursor of their Processing (which led to P5.js).

Maeda's courses challenged students to rethink the medium from its most basic elements. A typical assignment:

Given a mobile point in space over a finite rectangular area, create a parametric drawing that illustrates repetition, variety, or rhythm. MAS 964 P


A reading

Golan Levin was one of Maeda's students, and went on to focus specifically on the creation of audiovisual instruments, responding directly to Maeda's project. He is now a professor at Carnegie Mellon University, and a key figure in the Art & Code community. There’s a lot to draw from his Master's thesis, both theoretically and practically.

(Also note the document structure, as an example of a thesis in our field.)

For example, look at Curly and Yellowtail -- perhaps we can try to recreate this as our first example of "reproducing research".



Let's get making

Let's start with a sketching application -- but let's think about how we can use computation to augment or transform our gestures in some way. How do we start?

First let's get a shareable workspace:

What is the ontology of this space?

Paint requires a canvas. HTML provides a canvas element that can be interfaced via a 2D context via canvas.getContext("2d")

We're working in pixel coordinates in X and Y axes, from zero to canvas.width and canvas.height.

Drawing lines:

We're working with mouse (pointer) events.

Let the canvas fill the window:

window.addEventListener("resize", resize);
function resize() {
  canvas.width = window.innerWidth;
  canvas.height = window.innerHeight;
}
resize();

Example from 2024

Open pen.


Animate drawing

Let's continue with the sketching.

First a quick note -- what we are doing looks a bit like p5.js. In fact, if we remember to refactor code that we will re-use into re-usable functions, then it might start to look even more like p5.js -- maybe we will have line() and background() etc. That's good: we are in the stage of reproducing research. And if we find there are moments where we want to do things a little differently, because of the needs of our project, that's good too -- we aren't limited to what's already given because we know how to remake it, and maybe we'll have a discovery that can advance research!

A more complex example, inspired by Paul Haberli's Dynadraw:

Open pen.

Reproducing Curly/Yellowtail

With these steps, we should be in a position to attempt to reconstruct Golan Levin's Curly/Yellowtail, for example.

This is an example of reproducing research. First we should sketch out what is required based on the source material, and work from there to refine from a sketch through pseudo-code and implementation of components until we have the final result.

"Yellowtail repeats a user's strokes end-over-end, enabling simultaneous specification of a line's shape and quality of movement. Each line repeats according to its own period, producing an ever-changing and responsive display of lively, worm-like textures."

Detailed description from page 73 of the thesis:

"a user’s linear marks transform into an animated display of lively, worm-like lines. After the user deposited a mark, the system would then procedurally displace that mark end-over-end, making possible the simultaneous specification of both a line’s shape as well as its quality of movement. Straight marks would move along the direction of their own principal axes, while circular marks would chase their own tails. Marks with more irregular shapes would move in similarly irregular, but nonetheless rhythmic patterns."

The " screen space obeyed periodic (toroidal-topology) boundary conditions, such that marks which crossed the edge of the screen would reëmerge on the screen’s opposite side, rather than disappearing altogether."

Notice also the self-observation and critique, see p79. Although this project does not achieve the goal of the thesis, these observations inform the progress that follows. This is a positive research path.


Code from Oct 1 2026:

https://codepen.io/editor/grrrwaaa/pen/01a0f8d2-15ef-7deb-a142-828bcb9c57fd


OK so let's start by pseudo-coding Yellowtail!

Here's what we ended up with as pseudo-code in class, before we started coding:

there is a canvas

state:
    mouse: x, y, buttonstate
    time
    currentpath = null
    list of finished paths
        start position
        list of segments (dx, dy change vectors)

pointerdown:
    create a new currentpath object, with start position at mouse x,y & t

pointerup:
    if currentpath
        add my currentpath to the list of finished paths
        currentpath = null again

pointermove:
    if currentpath exists
        add mouse dx,dy & t to currentpath's list of segments

animate:
    for each path of finished paths
        remove 1st segment (shift)
        (something about coordinates)
        stick it onto the end (push)
        wrap around canvas width/height 
            e.g. if x > width; x -= width, etc. for 4 boundaries

drawpath:
    begin position at path's start position
    for each segment of the path
        line from last position to new position by adding segment change
        (path, moveto, lineto, stroke)

draw:
    clear screen
    for each path of finished paths
        drawpath(line)
    if currentpath exists
        drawpath(currentpath)


Code from Oct 8 2026

https://codepen.io/editor/grrrwaaa/pen/01a11cba-5bc4-74f9-b711-057b39cd0cdd


Examples from 2024-25

Open pen.

Open pen.


And here's the final code we ended up with:

https://codepen.io/editor/grrrwaaa/pen/01a164aa-4f06-738c-819b-b99b563734b6

Here's another from a previous class:

Open pen.

Here's a more refined version from last year's class:

Open pen.

Please continue working on extending and mutating this into a new direction! We will share each other's codepens in the following classes.


past version 1

past version 2


Some rules of thumb while coding: