Max/MSP/Jitter Depot

CNMAT's expanding collection of Max/MSP/Jitter patches designed for composers, programmers, performers and music educators. The MMJ-Depot includes basic programming tips, modular programming units for copy and paste, interactive tutorials on all aspects of computer music, and functioning musical works with commentary and criticism.

Design and Implementation of CNMAT's Pedagogical Software (ICMC 2007) explains the genesis and structure of the Max/MSP/Jitter (MMJ) Depot.

Join the MMJ Depot Users Group to participate and receive news about MMJ Depot developments. Join the MMJ Depot Contributors Group to become an active software contributor to the Depot.

The MMJ-Depot is available as a single download
(Downloads>Major Packages>Max/MSP/Jitter Depot).

visit Cycling74 (commercial distributor/developer for Max/MSP/Jitter)

Modules (building blocks of the MMJ Depot)

A generalized package, to be used in an application, demo, tutor, or tutorial. Modules are addressable with
OSC messages.

Below is a list of all modules by type. Click here to browse modules by categories.

cnmat.alib

A large group of patches derived from Ali Momeni's aLib, at: http://alimomeni.net/aLib

coll-listdumper

dump out contents of a collection as a list

readwrite-ui

Small UI in a bpatcher for generating read and write messages

Controllers

Wrappers for a number of controllers. Many wrappers use OSC-style max messages.

OSC-bcf2000.js

OSC wrapper for the Behringer BCF2000, programmed in Javascript.

OSC-Chameleon-Game-Pad

This patch was designed for use with the Pelican brand "Chameleon" wireless gaming controller.

OSC-pc1600

OSC wrapper for the Peavey PC-1600 or PC-1600x “MIDI command station”

OSC-propedals

OSC wrapper for the propedals usb controller, made by ch products.

OSC-STC-1000

OSC wrapper patch for the Mercurial STC-1000 touchpad

OSC-Xkeys-Stick

OSC wrapper for the Xkeys controller

Wacom (non-OSC)

A package containing patches for processing data from Wacom Tablets.

wacom-display

display bar for wacom-interpreter data

wacom-interpreter

interprets data from the wacom object for use with other CNMAT wacom objects

wactilt-scale

linearly scale wacom tilt to desired range

Data Generation

Modules pertaining to generating data

Series-maker

Creates numerical sequences that are "Lucas Sequences" -- such as fibonacci numbers.

Data Storage

Modules pertaining to storing and retrieving data.

data_recorder

records one data stream into a collection, and plays it back

data_recorder_audio

records one data stream into an audio buffer, and plays it back

data_recorder_list

this patch records lists into a collection, and plays them back

Data Transformation

modules relating to transformation of incoming data

Calibrators

A package of patches for calibrating incoming data.

rcalib

adjusts a running stream of numbers to the required range

rzcalib

adjusts a running stream of numbers to the required range, and adjusts the zero point

OSC-alias

changes OSC-style messages into other OSC-style messages

Diffusion

Modules related to spatialization, etc.

Panhandler

A package of patches for controlling signal panning using Ville Pulkki's VBAP

dlinterface

gui for defining loudspeaker placement

multipan~

controls panning: 2-10 inputs, 4-8 outputs

panhandler~

controls panning -- 1 in x (4-8) out

Effects

This module is a collection of classic audio "effects."

chorus~

a simple, mono chorus with variable feedback

see: Roads, The Computer Music Tutorial, p. 439

harm-gran~

granularly transposes playback from tapin~ buffer

newrev~

public domain reverb

ringmod~

a simple ring-modulator

MIDI

modules relating to MIDI data

MIDI-bend-scaler

map midi pitch bend values (0-127) to values between -1 and 1

midivel2gain

map midi vel to gain (dB)

Soundfile-sampling

Modules related to Sample recording and playback

Groovewrap

Groovewrap is a playback wrapper for the groove~ object with memory and recall.

groovewrap~

Groovewrap~ is a playback wrapper for the groove~ object with memory and recall.

gwinterface

a graphical user interface for groovewrap~

Synthesis

Modules related to synthesis

mz.toys

A collection of simple synths.

mz.drummachine

simple, old-school drum machine

mz.sawsynth~

monophonic sawtooth wave synth with filter

mz.stepsynth

step sequencer for mz.sawsynth~

mz.toys.overview

all the synths in one handy grouping

mz.tritip~

five triangle waves in a delicious sauce

Sin-synth

This module frees the user from the tedious details of synthesizing sinusoidal models from SDIF files.

Timing

Depot modules pertaining to Timing and Rhythm

Stepmetro

A package for scheduling events based on a signal-driven metronome.

clicker~

simple auditory feedback for sub-beat

eventlist

an interface for triggering events on specific sub-beats

eventnode

an interface for triggering events on specific sub-beats

mastertempo~

a phasor~-based metronome

sub-beat

reports beat groups and subdivisions from a master tempo

Applications (fully functional patches or packages)

A generally useful patch with a complete enough GUI that it can be used without doing any Max programming. An Application is a turnkey solution to some problem, not a reusable software component. Applications are suggested when a composer or researcher desires to share an activity that has become habitual to the point where a fixed environment can exist. Applications might edit or reformat data, provide composer or audio engineering assistance, as well as operate on or perform digital sound in a specified way.

8-track_recorder

A standalone, 8-track recorder, with or without nixie tubes

CUE_PLAYER

A general purpose cue player for pieces including instrument and "tape" where the tape part might be several different cues as several different audio files.

Internal_Synth

Quickly sets up the internal General MIDI Synthesizer in a traditional orchestra.

Music_Calculator

Handy calculations for computer music.

Pulser

some ways to visualize audio signal with (and without) jitter

Resonance Model Workspace

Provides a workspace for transforming sinusoidal models into resonance models, auditioning, and editing.

Samplemixer

Lets the user create, edit, and record phrases base on sets of samples.

Weather Report

Downloads and reports current weather conditions in United States Locations.

Tutorials (large-scale topics for teaching and learning)

The tutorials explain specific topics in depth; they cover programming details as necessary but tend to focus on core theoretical and conceptual issues in computer music, synthesis, signal processing, etc. Tutorials are designed primarily for learning purposes, but are also available to be plundered.

CNMAT Spectral Tutorials

A large number of tutorials on using CNMAT objects for spectral (additive and resonant) synthesis. Includes use of SDIF and OSC.

Max/MSP Day School

All the in-class and activity patches from the Day School

Tutors (single topics covered in-depth)

A Max/MSP/Jitter (MMJ) patch and reference document that serves as a single collection point for the expanding communal wisdom on a particular MMJ object or programming topic. For an advanced user it is a mnemonic aid and for entry level users it is learning space.

aliasing

A tutor demonstrating aliasing.

DSP_Settings

Basic ideas about DSP and scheduler settings

Essential Max/MSP/Jitter Objects

Beginning Max users see the manual with a couple hundred max objects and get intimidated. But this is like trying to learn English by looking at the Oxford Unabridged Dictionary. In fact", most of those 200 objects are special-purpose, or could be programmed with a few more "primitive" objects. If someone really takes the time to thoroughly understand a small group of max objects, then they are well on their way to successful programming.

Object Tutors

Tutors about specific objects

expr+sprintf

Max's expr and sprintf externals are essential tools because of their extreme generality. expr allows the construction of almost any mathematical expression, and sprintf provides the full generality of C's sprintf() procedure for formatting text strings.

Unfortunately, both of these tools are hampered in critical and confusing ways by the way Max itself deals with text.

loadbang-universal

sends a bang to all loadbangs

set-tutor

"set" message: theory and practice

sprintf-tutor

tutor for sprintf syntax and uses

Priorities

objects that reassign the priority of max messages

Ratio Tuning

A few patches for exploring ratio-based intervals and tuning.

string_example_stopped

An example patch for auditioning arbitrary stoppings of a string. Both sides can be plucked.

tuning_explorer

A patch for exploring relationships between various ratio-derived intervals.

Routing Data Types

Kind of a disturbing patch that confuses shows how to get the most out of your patch cords.

smoother+derivitive

Demonstrates some techniques for dealing with a data stream, perhaps from a sensor.

Demos (ready to play demonstration patches)

A patch that shows one (impressive) idea, not necessarily with enough flexibility or generality to be useful for extended work (Desired reaction: “Wow!”) Formatted for projection.

migrator-demo

Based on David Wessel's "migrators" patch, this patch demonstrates control of multiple oscillator banks with OSC Max messages. The user can control wavetables, pitch profiles, and "gaussian blur" for each voice. Presets may be saved and recalled with pattr.

Music 158

Music 158 demos

Alfador Workstation

In the Spring of 2007 I was lucky enough to enroll in Music 158 at UCB. I had been spending all of my free time sequencing and synthesizing before attending Berkeley and was upset to see that I didn’t have many options to continue with that at Cal. However, when I discovered 158 I was pumped! This project is a culmination of my programming in that class and I presented it as my final project at the end of the semester. I ended up fashioning three main patches to make up my mini techno orchestra. The orchestra is made up of one drum machine, one bass machine and one sequencing synth.

The first window that opens is the Master Window. From this window you can monitor the gain of each synth and pan the sounds to either the left or right. You can open each instrument by clicking the button next to the patch. Most importantly you can open the Audio Out window and record your song using the application inside of that window. The best way to record is have your sequences running. While this is happening click the open button. Save your file name and then click record. When you click record it automatically goes to beat one— there will sound like there is some clipping but it won’t come through in the recording. When you are done recording hit the stop button. If you stop the sequencer it will to continue recording until you click stop.

The Sequencer Synth has only one channel and plays up to an octave chromatically. Each sixteenth note can be a 5 different velocities including off. You can store pitch and velocity patterns separately. Make sure it is paused when loading up presets. The harmonic table on the right is real time. Make sure to turn off the interpolator if you are trying to build and save your own wavefoms. The envelope is also realtime. Click and drag to shape it. Shift click deletes dots. Hit play (the spacebar) and experiment.

In the Machines you can load up 8 different sounds by clicking the load button and finding an AIFF drum sound you would like to import. Then you can click the toggles to trigger that sound. To mod the sound use the 3 different velocities, use the knob on the left to adjust pitch&length, the knob on the right for channel volume and the “M” button for mute. There is also an overdrive slider and a bit crushing slider. Both the Bass and Drum Machines have what I named “scorers”. I wrote a score using binary messages sent to the toggles to play the demo.

singing-voice

A demonstration of voice synthesis using harmonics~ to simulate the glottis and resonators~ to simulate the vocal tract.

Repertoire (complete pieces)

A specific kind of Application that is "branded" by a composer. Repertoire is intended for performance (concert, installation, internet, CD) and involves a special intent (to form one musical world or specific piece).

It is not enough to ask “What can this software do?” By presenting technologies in an aesthetic context, the repertoire integrated into the Depot answers to the question: “What is this software good for?”

Edmund Campion

pieces by Edmund Campion

Michael Zbyszynski

Pieces by Michael Zbyszynski

Alone in a Crowded Room

Alone in a Crowded Room a situation for solo alto flute and live electronics (2005)

Michael Ferriell Zbyszynski

My musical interests in Alone in a Crowded Room are twofold. Electronically, I am exploring macroscopic and microscopic processes in the time domain. At the same time, I am engaged with the physical reality of the alto flute and by extension, the flautist.

The long delay lines at the beginning of the piece are an example of macroscopic process; the technique has long been a part of compositional vocabulary from analogue tape loop to cannon at the unison. In this piece it creates the situation for an interior monologue between the player and himself. Concepts repeat, decay, and interact with one another, creating new layers of meaning with each recontextualization. As the piece progresses, microscopic process come to the foreground. The sound of the flute is broken into individual grains that gradually loose cohesion. The monologue branches out, as memories of the original performance split into fragments.

Daguerreotype

Daguerreotype for Violoncello and Electronics

for Francis-Marie Uitti

This set of effects was designed in collaboration with cellist Francis-Marie Uitti in November 2005 to be used with her six-string electric cello. Many of these effects came from the CNMAT guitar library.

Paper: NIME 2006 | ICMC 2006

Ronald Bruce Smith

pieces by Ronald Bruce Smith

Five Pieces for Guitar and Live Electronics

Five pieces for Guitar and Live Electronics was commissioned under a UC Discovery grant from the University of California’s Industry-University Cooperative Research Program (IUCRP) and Gibson Guitar Corporation. It was made possible through the support of the Center from New Music and Audio Technologies (CNMAT), Department of Music, University of California, Berkeley. The aim of the commission was to incorporate into a concert piece for solo guitar the guitar-centered software technology that researchers there had developed. These guitar effects were developed in the Max/MSP environment and I make use of a number of them as well as a few other things that are not in the specific package.

The composition consists of five short pieces and, as might be gathered by the titles of each piece, it is reflective of our current time of conflict. Much of the music in this composition requires a high-level of guitar virtuosity. It was written with the outstanding technique and musicianship of David Tannenbaum in mind.

Third Party Externals

Some of the CNMAT Depot may rely on the following third party objects:

Also recommended, but not required, are:

searching for Max/MSP/Jitter objects:

for Jitter:

Baseline (useful software tidbits)

CNMAT Baseline is the set of softwares that MMJ-Depot software (tutors, apps, modules etc.) may depend on. Always include the current Baseline collection in your Max search path.

basic-DSP

a collection of patches for common DSP situations

asym-tanh~

Asymmetrically applies a hyperbolic tangent function to a signal.

envelope-follower~

rms-based amplitude envelope follower with lowpass filter

multigain~

controls overall gain for 2-24 audio signals

only-positive~

half-wave rectifier

pan+amp~

controls stereo panning and amplitude in dB for a mono audio signal

scale~

Signal-domain version of scale

silictor~

Like selector~ but with a settable ramp time instead of abrupt click.

basic-programming

A collection of small patches that solve common programming problems

change-sym

Like "change" but works for symbols.

delta

Outputs difference between current and previous input.

int+frac

Given a float, output the integer part (rounding towards zero) and the fractional part (a float of the same sign as the input, with absolute value between 0 and 1).

version 1.1

list-of-last-n

outputs list of last n inputs

nearly==

Just like ==, except that there's tolerance factor for the maximum allowable difference between two "nearly" equal values.

nothing

The nothing object doesn't do much, but it can be handy for wiring.

onepole

single-pole lowpass filter

pipe-any

Like "pipe" but accepting lists and messages as well as floats and ints.

round

round to nearest integer, even if negative

By default, Max "truncates" floats when turning them into integers. That is 1.01 would turn into 1, as would 1.999. If you want 1.999 to be rounded to 2, then use this abstraction.

scramble

randomly reorders a list

sel-long-enough

Like "select" with one argument, except that the value it's looking for must be held for long enough (i.e., no different inputs may come) to get the bang out the left outlet.

zereoy-gate

A gate for floats that outputs a zero when closed and then outputs the most recently received input when its reopened.

multibuf

this abstraction helps you read sound files into buffer~'s

multicoll

simplified way to load lots of coll files

multiple-sdif-buffers

creates a number of SDIF buffers with common names and OSC addressing

MMJ Depot coding conventions and style guidelines

There are two important aspects to the programming style of the CNMAT MMJ Depot. First, it should be relatively easy for developers to add new patches and second, it should invite users to copy and paste elements into their own patches. To facilitate these, the number of required elements are minimal. Specifically:

Another important consideration is avoiding duplication. Whenever there are two copies of a piece of software, inevitably one ends up changing (like when a bug is fixed), and then the other copy doesn't get updated, so they go out of synch. (This is called "version skew" and it drives people like Matt and Michael crazy.) So never have two copies of the same patch in two different places in the Depot; instead move that useful patch into a module or the baseline. And before you add something new to the Depot, see if you can find something already there that does the same job.

Finally, we are recommending that patches accept control parameters in the form of OSC-style Max messages. This is especially relevant in Modules -- groovewrap is a good example.

Authorship, License, Copyright, and Disclaimer

##

Every patch or textual source code file should contain a comment listing the names of the authors and the year(s) it was written.

Software developed by CNMAT students, faculty, and staff almost always belongs to the University.

We generally use the standard UC Regents license, which grants "Permission to use, copy, modify, and distribute this software and its documentation for educational, research, and not-for-profit purposes" along with a lot of legal language protecting the University.

There is an even more open license that grants "Permission to use, copy, modify, distribute, and distribute modified versions of this software and its documentation without fee and without a signed licensing agreement", even for for-profit purposes. This is our "open source" license, used, for example, by our OSC libraries, which are included in commercial products by, e.g., Native Instruments.

In the event that we don't have permission to assert a UC copyright, such as with Public Domain Software, the disclaimer should still be included.

License and disclaimer patches can be found in /MMJ-Depot/baseline/support/

Creating Drupal nodes for patches in the depot

  1. Update your Subversion Working copy
  2. Find the patch you for which want to create a page
  3. Double-check to make sure that both the patch and the help patch have authorship, version, and uc_license patch.
  4. Log in to the website
  5. At the bottom of the left column, click Create general content
  6. From the huge list of content types , select Max Patch (near the bottom)
  7. Enter the information
    • name is the name of the patch, without the .pat extension
    • make a screenshot by pressing cmd-shift-4 and then dragging a box around the stuff in the patch
    • enter the screenshot path into the box
    • the description is the short sentence (fragment) at the top of most patches. In the aLib, getting info on the bpatcher at the top lets you copy that info (in quotes).
    • unfold the categories menu, and select the appropriate category (eg -Max/MSP/Jitter Depot--Modules)
    • enter the author(s) -
    • if there are obvious related items or dependancies, enter them
    • enter the repository path (that is /CNMAT/trunk/max/patches/MMJ-Depot/... wherever in the depot you get this patch)
  8. Click on Submit
  9. If the page you made looks good, click on Outline near the top
  10. Select the appropriate place in the Depot outline (eg MMJ Depot - Modules - cnmat.aLib)
  11. Note the node number of the page you just made (in the address bar of your browser)
  12. Add "• view html reference" to the help patch you are working on with the proper node number.
  13. Commit all of your local changes to the Subversion Repository when you are done.

Generic OSC-Style Messages

While not every patch implements all of these messages, these are some very common and desirable messages for a patch to understand:

  • /gain Controls the Linear Amplitude of the signal output. Should accept an optional second argument to change to a specific amplitude over a number of milliseconds.
  • /gain Controls the gain in decibels applied to the signal output. 0 dB = unity gain. Should accept an optional second argument to change to a specific amplitude over a number of milliseconds.
  • /init Brings the module back to the state it is in when it loads.
  • /tellmeeverything Reports the current state of all variables as OSC messages in the Max Window, and sends them out the rightmost outlet.
  • /transposition Controls a transposition factor in floating-point semitones. Should accept an optional second argument to change to a specific transposition over a number of milliseconds.
  • /version Reports the version in the Max window.
  • /verbose Can be used to toggle the reporting of extra state information to the Max window.

Help patches

Each patch or external should have a help patch listing all of its features. The help patch should show how the object would be used in context and designed for easy cut and paste.

For a file named something.pat, something.mxb, or something.mxt, its help patch should be named something.help.pat

A generic help file can be found in the repository in /MMJ-Depot/baseline/support/

Naming conventions

Filename suffixes

Every filename must end with a valid suffix to ensure cross-platform compatibility.

  • Max patches: .pat, or .mxt for patches in text format, or .mxb for patches in binary format
  • Collections: .txt (If you say “coll foo”, Max will load the file “foo.txt” in your search path.)
  • Tables: .mxb (If you say “table foo.mxb, Max will load the file “foo.txt” in your search path.)
  • Help patches: .help.pat (so that Max’s help system will find them)
  • Sound files: .aif, .aiff, .wav, .snd, .mp3, etc.
  • SDIF files: .sdif
  • Java source code: .java
  • Javascript source code: .js
  • MIDI files: .mid
  • PDF files: .pdf
  • Text files: .txt
  • XML files: .xml
  • Image files: .gif, .jpg, .png, etc.

All filenames must be unique

It must be possible to have “everything from CNMAT” (the MMJ Depot, all CNMAT’s externals, our recommended third-party externals, etc.) in one’s search path with no name conflicts.

Whenever possible avoid name conflicts with other third-party externals, patches, packages, etc.

CNMAT does not have a filename prefix for all the patches in the MMJ Depot. (E.g., our envelope follower is called “envelope-follower~”, not “cnmat.envelope-follower~”.)

All filenames should be descriptive

Patches names should say what the patch does clearly and succinctly. It’s a bit of an art to find the “sweet spot” between completely descriptive byt annoyingly long and hard to type patch names versus terse and noninformative patch names.

The name of a patch should say what the patch does, not what context the author of the patch originally intended it to be used in. E.g., a GUI wrapper around lookup~ should not be called “phasor-groove~” just because it was written to sit between a phasor~ object and a groove~ object.

Version numbers

## Version numbers

Each external should include its version number as described here. Packages of patches that we release with the old new Max downloads page can have their version and other information in the same format in a separate "infosource.txt" file.

Each patch or at least package should have a comment listing the version number. (E.g., the individual patches in the Spectral Tutorials don't have version numbers, but the entire tutorial package does.)

We're not consistent about the exact form of the version number, like 1.2 vs. 1.2.3. Sometimes the version number has text in it, like 1.9test. Sometimes the version number encodes the alpha/beta status, like "version 0.9alpha".

Some people use the convention that versions beginning with "0" are pre-release, and that 1.0 is the number of the first released version.

Bottom line: higher numbers are usually more recent.