Exercise 9: Granulation

To granulate a sound is to break it up into many tiny grains — each anywhere from a few milliseconds to about a half second in duration. Each grain is encased in an envelope and can be independently transposed. The grains flow out of the granulator in one or more streams, one grain after another. The time between successive grains determines the grain rate, which has a profound impact on the sound. If the grain rate is regular, you may hear a pitch with a frequency corresponding to the time between successive grains. If the grain rate is randomly varied, this pitch disappears.

Why would anyone want to granulate sound? The applications range from time-scaling audio to making a sustained sound out of a short snippet (e.g., a choral sustain from a guitar pluck) to creating interesting noisy or pulsed repetitive textures. Play with it and see.

While Max is a (mostly) closed-source commercial application, many people have developed externals that you can add to Max to extend its capabilities. (“External” is a term used for the individual objects you drop into your patch.) Most of these are provided with the Max application, but you can add others.

We will use one such external, jg.granulate~, to perform granulation on audio stored in a buffer~ object.


We’re learning how to...

  • access the jg.granulate~ external,
  • associate it with buffer~ and waveform~ objects, and
  • use this set of objects to granulate sound, producing a variety of colors and textures.

How to Do This Exercise

Working on the assignment is a two-stage process.

  1. Download Exercise 9 Max Tips. This folder of Max patches gives you a few examples of granulating sound using jg.granulate~.

    Note that jg.granulate~ is included in the Auzzie package that you already have installed.

  2. Make a patch that granulates audio, and store a few presets that capture parameters for contrasting sounds.

    See the Requirements section below for details.

Be sure you understand what each of these Max objects does:

  • buffer~
  • waveform~
  • jg.granulate~
  • pak
  • rslider


  • Make a folder for your exercise, and save an empty patch file into it. Close and reopen this file; then build your patch in it.
  • Copy a few short sound files into your patch folder.
  • Make a buffer~ object with a name as argument, and load one of your sound files into it. To load this file into the buffer and set the size of the buffer to the length of the sound file, Use the replace message to buffer~. Without an argument, replace opens a dialog in which you can choose a sound file. Instead, you can give the name of the sound file as an argument to the replace message. The file should be in the same folder as your patch.
  • Make a waveform~ object, and in the Inspector, set its buffer~ Object Name to the name of your buffer~. Also set its Click Mode to “Select.” This will let you select parts of the waveform to granulate. See the Tips patches to learn how to do this.
  • Make a jg.granulate~ object with two arguments: the name of your buffer~ object and “2,” to indicate the number of output channels you want (can be many more than two).
  • Add float number boxes to control parameters and a preset object to capture their values.
  • Make some presets that create any five of the following kinds of sound. (Relevant jg.granulate~ parameters listed in parentheses.)
    • a time-scaled version of the original sound that lasts four times as long and sounds as smooth as you can make it (trav, rate, durrange);
    • a fast backward version of the sound (trav, rate);
    • a version that captures the timbral evolution of the sound in extreme slow motion (trav);
    • a “frozen” sound that can last as long as you need it to, while the sound cursor sits on one spot in the original sound file (trav=0);
    • a noisy, radio static-like sound — hints: very short grains (durrange), irregular grain onset times (outjitter);
    • a stream of pulsed sixteenth notes made with grains pulled from random places in the buffer (low rate, injitter);
    • a swarm of angry bees (transjitter);
    • bees arpeggiating a harmony (transcoll)
  • If you’re looking for another challenge, try recording into your buffer while granulating it. To do this continuously, use the loop message to record~, setting it to 1 or 0 to start or stop looping through the buffer while recording. Playing the buffer will sometimes produce clicks or other glitches. (The real solution is to use several buffers and alternate between them, so that jg.granulate~ is not trying to read from a buffer that you’re recording into.)

    This last step is optional!


  • Be sure you satisfied the criteria listed above.
  • Submit your Max patch in Canvas.

Grading Criteria

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

Your patch must

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