An Intro to Max 7

A graphical signal flow programming environment by Cycling 74.

In some development circles, especially media arts, Max and Pure Data are not only well known, they may be the only programming environments used at all.

In other circles, developers have never heard of these languages.

Let’s start with a question that often comes up right away: is Max even a programming language?

Well, you use logic within a given syntax to create source files, and then compile those source files into executable binaries. You can extend Max with new functionality, and you can drop down into lower level languages when appropriate/necessary.

I think many of the arguments against Max and Pure Data as programming languages just come from developers who don’t know anything about them. At first glance, all they see is a graphical interface with patch chords moving around, but they have all of the functional traits of other programming languages.

Max programs are built with files called “patches”. Each patch is a text file just like other languages sources, but the Max7 app renders these patches as graphical environments. Logic is added by creating “objects” and connecting them with “patch chords”. Max can be used for all sorts of programs, but it was designed for signals and sampling.

Notice the different types of patch chords: one is a solid grey line, and the other an alternating grey-green line. The solid grey represents the flow of control-data, and the other represents the flow of sampled audio-rate signals. (There are also grey-blue patch chords which represent the flow of video matrices.)

Most objects allow you to define parameters when you create an object, but most parameters can be changed in real time using control objects. In the above example, cycle~ is an object that encapsulates an oscillator. Once audio is instantiated, it will begin outputting an oscillating signal. This could be used for whatever purposes, but the simplest is to listen to it as a sine tone.

cycle~ requires a frequency parameter, which can be declared as a parameter of the object, or we can add a number object and connect its outlet to the cycle~ frequency inlet.

In order to hear it, we then need to tell the patch to convert the signal using a dac~ (digital-analog-converter). Then we can lock the patch (switch between edit and interact mode) and hear the sound.

Well, you can’t hear it here, but notice the power icon in the bottom right, and the level meter showing that the patch is playing sound.

From here, Max becomes increasingly complex. I’ll be following up with more details, but here’s a snapshot of a performative audio app I’ve been working on in Max. Essentially, each object and patch chord are just functions with parameter and return data (inlets and outlets). While there are some quirks to how data flows, especially since we need to be able to sync and work around data that flows at different rates, most of how this works should be very familiar to other developers.

Don’t let the patch chord spaghetti fool you. It might look like a confusing mess, but I promise it’s no harder to decipher than an equally complex app in a text-based programming language.

This particular app includes both an audio and graphics engine, as well as frontend code for controlling both. There’s plenty of other resources out there to be able to further explore what Max, but stay tuned for my follow up coming soon!