Exercise 2

Exercise 2: Playing Sound Files, Routing Audio

In Exercise 1, we used the built-in MIDI synthesizer in macOS or Windows to render sound in response to Max messages. Now we will generate audio entirely within Max. We’ll start by playing sound files.


The basic points covered in this exercise are

  • setting up a master audio fader and getting sound out of Max;
  • understanding the differences between Max messages and audio signals;
  • playing sound files, with adjustable speed and other parameters;
  • exploring various ways to trigger playback of sound, from the computer keyboard, MIDI controller, or from the metro object; and
  • creating the equivalent of an effect send in order to use a simple reverb unit that comes with Max.

How To Do This Exercise

Working on the assignment is a three-stage process.

  1. Download Exercise 2 Max Tips. This is a folder of Max patches that will give you enough of an introduction to make the patch described below. Open them in Max in order (part 1, then part 2, etc.), reading the comments and operating the patches.

    You will learn the program faster if you add objects and patch cords to these patches, according to the suggestions contained therein. (These begin with a bullet ('•') and are printed in blue.)

    One of the best ways to learn is to simply recreate patches, or parts of patches, in a new patch window. Although you’re just copying someone else’s work, creating and connecting the objects helps you understand the ideas and the workflow that are crucial for working in Max.

  2. Make a patch that lets you play at least four short (less than 2 seconds) sound files. Trigger playback from the computer keyboard or a MIDI keyboard.

    Make your own short sound files! Put them in the same folder that your patch file lives in.

    Use a send reverb for at least some of the players, and use a master fader for everything, directly upstream from the ezdac~.

    Audio routing is one of the main points of this exercise. In addition to making the reverb send, be sure you understand how to route the dry sound from your players, in mono or stereo as appropriate, to the master fader.

  3. Make a second patch that also plays sound files, but this time using the kind of metro-driven scheme we explored last week.

    Use the speed command word that playlist~ understands to vary the playback speed of the files. Make the speed change randomly in response to metro bangs.

    If you wish, explore the other command words supported when playlist~ is in timestretch mode. This is optional.

You probably noticed that parts 2 and 3 above don’t tell you exactly how to do anything. We’d like you to study the MaxTips patches, as well as the advice in the Suggestions section of this web page, and try to build your patch by thinking about what might be necessary to make it work.

If you get stuck, please email both instructors. You can send your patch as an attachment. It can help to put comments in the patch to ask questions (type ‘c’ to get a comment box).

Be sure you understand each of these Max objects or concepts:

  • ezdac~
  • live.gain~
  • playlist~
  • key, select
  • stripnote
  • yafr2 (reverb patch)
  • float number box (called “flonum”)
  • $1 notation for message boxes


  • If your playlist~ contains a single sound, you can play it by sending it the number 1. For your first patch, this number will be in a message box that is triggered from a select (or sel) object, which matches keys on your computer or MIDI keyboard. All this is covered in the Max Tips patches for this week.
  • When creating a reverb send, first give each sound file player its own fader (live.gain~) to control the level of the dry signal. Then patch directly from the playlist~ audio outlet(s) to a reverb send fader. For this patch, it would be okay to use only one reverb send fader, even if more than one player sends to the reverb. The output of this fader feeds the left inlet of the yafr2 reverb patch, which then goes to the master fader, along with the outputs of all the dry signal faders.

    If a sound file has two channels, you should sum those together when sending to the reverb send fader, as this reverb patch has only mono input. Summing together just means sending both outlets to the same fader inlet, using two patch cords. This is one of the few times it makes sense to discard stereo in a signal.

    Be sure to preserve the stereo output of the reverb when feeding it to the master fader. Also, when routing the dry signal of players, preserve the stereo of any players that use stereo audio files.

  • To change playlist~ speed, you must use the $1 notation for message boxes. Create a message box with this inside: speed $1. Then send it numbers that scale the speed, relative to 1.0. (So 2.0 is twice as fast; 0.5 is half as fast.) Connect this message box to the inlet of playlist~.
  • There are many ways you might use the metro-driven scheme from Exercise 1 to play sound files. One way is to have the metro feed its bang message to a random object, whose argument is the number of players you have. Then send that to a sel object that contains all the values random will produce.

    For example, if you have four players, use random 4, which emits integers between 0 and 3 inclusive. Connect this to sel 0 1 2 3: now the leftmost four outlets of sel will emit a bang whenever random produces a matching number. This bang can trigger a message box containing 1, which you can use to ask the player to play the sound. Each player would have its own message box setup like this.


  • Please submit to Canvas one zipped folder containing your sound files and the two Max patches you wrote.

Grading Criteria

This exercise is graded pass/fail. You must submit the exercise by Thursday midnight to be eligible for a pass.

Your patches must

  • operate correctly and
  • implement the functionality described in items 2 and 3 of the “How To Do This Exercise” section above.