Most Popular


The EM Poll




CURRENT ISSUE

SUBSCRIBE
$1.84 an issue!

EM DIGITAL EDITION
Try it for free today!

browse back issues

Cycling '74 Max Tutorial

Mar 1, 2009 12:00 PM, By Jeffrey Stolet



         Subscribe in NewsGator Online   Subscribe in Bloglines
 

HOW TO GET STARTED WITH CYCLING '74 MAX GRAPHICAL PROGRAMMING SOFTWARE

CURRENT NEWSSTAND ISSUE

Read the full Table of Contents for the issue on sale now! Click here

Subscribe for only $1.84 an issue!

Please tell us about yourself so we can better serve you. Click here to take our user survey.

MixBooks Logo
Life in the Fast Lane

This collection of St.CroixÕs columns was assembled during the two years following his death of cancer in May 2006. Included are many of his most-read columns, as well as personal notes, drawings and photographs.

Click for more books
EM Podcasts

Listen to these latest podcasts and more:
Bela Fleck on recording Jingle All the Way.Go

What's New: software and sound products. Go

eDeals Newsletter for Discounts on Gear

Get First Dibs on Hot Gear Discounts, Manufacturer Close-Outs and Job Opportunities when you sign up to receive eDeals E-newsletter, sent twice a month. Check out an issue get advertising info or subscribe

It's easy to build a basic sample-playback instrument. Start by creating an sfplay~ Object using the same technique that you used to create the key Object. Next, choose the toggle Object, position it above the sfplay~ Object, and then connect it to the left inlet of the sfplay~ Object. Create four message boxes with the messages open, loop 1, loop 0, and speed $1. Position these message boxes above the sfplay~ Object and to the right of the toggle Object, and then connect each one to the left inlet of the sfplay~ Object.

Now add a floating-point number box, position it just above the speed $1 message box, and connect it to the left inlet of that message box. Clicking on the toggle Object or message boxes allows you to control basic aspects of the sfplay~ Object. Clicking on “open” recalls the standard Open Document dialog box so that stored audio files can be loaded into the sfplay~ Object. Clicking on the toggle Object starts and stops the audio file playback. Clicking on “loop 1” enables the looping function, whereas clicking on “loop 0” disables it.

If you scroll in the number box, you control the rate of sample playback. A value of 1.0 is the sample's normal rate, 2.0 reads through the sample in half the time, and 0.5 reads through the sample in twice the time.

Controlling Amplitude

To control the signal-level output from the sfplay~ Object, you need to use the *~ Object. The *~ Object literally multiplies the value of each audio sample and outputs it. If, for example, you multiply each individual sample by 0.5, you cut the amplitude by half.

FIG. 4: This Max patch is based on the sfplay~ Object with its basic controls. The sfplay~ Object plays audio files from disk.

FIG. 4: This Max patch is based on the sfplay~ Object with its basic controls. The sfplay~ Object plays audio files from disk.

Using the same technique that you used to create the key Object, create a *~ Object, position it below the sfplay~ Object, and connect the left outlet of the sfplay~ Object to the left inlet of the *~ Object. Add the Argument 0.5 to the *~ Object. Next, create a dac~ Object using the same technique that you used to create the key Object. (The dac~ Object is the digital audio converter in Max; it converts all audio signals it receives to the analog domain so that they can be amplified and heard.) Position the dac~ Object below the *~ Object, and connect the outlet of the *~ Object to both the left and right inlets of the dac~ Object.

Finally, choose another toggle Object, position it above and to the right of the dac~ Object, and connect it to the left inlet of the dac~ Object. Clicking on this toggle Object turns the audio on and off. Your sample-playback patch should look like Fig. 4.

Delayed Gratification

Extend your simple audio-playback patch by adding four delay~ Objects. Before you add these Objects, select the patch cord between the sfplay~ and *~ Objects by clicking on it, and delete it by pressing the Delete key. Leave the *~, dac~, and lower toggle Objects connected, but drag them farther down in the window to make space for the delay~ Objects that you are going to add.

Using the same technique that you used to create the key Object, create four delay~ Objects. Position them below the sfplay~ Object, and connect the left outlet of the sfplay~ Object to the left inlets of each of the four delay~ Objects.

Each of these delay~ Objects needs two Arguments. The first Argument specifies the maximum delay time in individual audio samples; the second Argument specifies the initial delay setting. If the sampling rate is 44.1 kHz, then 44100 equals 1 second of time.

FIG. 5: This Max patch, based on the sfplay~ Object, combines four delayed copies and the original signal.

FIG. 5: This Max patch, based on the sfplay~ Object, combines four delayed copies and the original signal.

If you connect an integer number box to the right inlet of each of the delay~ Objects, you can adjust the delay amount in real time. To add four integer-number boxes, type the letter I and then click in the white area four times. Position one of the number boxes above each of the four delay~ Objects, connecting the outlet of each number box to the right inlet of the associated delay~ Object. By scrolling in the number boxes, you adjust the delay times. Now connect the outlets of each of the four delay~ Objects to the left inlet of the *~ below them. Your patch should look something like Fig. 5.

Notice the straight patch cords in Fig. 5. To make your patch cord straight, select the one you want to square off and choose Align from the Arrange menu. Once it's squared off, you can drag the patch cord up or down. I used the Align function in Fig. 5 to help keep patch cords and Objects from colliding with each other.

Max Pleasure

These patches (see Web Clips 1, 2, 3, 4, and 5) can be altered, customized, and extended in many ways using a vast array of Objects I have not mentioned here. For instance, the vst~ Object enables you to modify audio signals with your favorite VST plug-ins, and the rewire~ Object lets you exchange audio and MIDI data with ReWire-compatible applications. This type of flexibility permits you to fully customize your individual sound-design environment.

Max also allows the creation of external Objects. An external Object, while functionally identical to regular Max Objects, is created outside the auspices of Cycling '74, Max's developer. I estimate that more than 1,000 external Objects are available, many of them for free at sites like the Max Objects Database (maxobjects.com).

One especially cool external Object is the aka.wiiremote Object written by Masayuki Akamatsu. This Object permits data to be transmitted wirelessly from the Nintendo Wii Remote into Max through a Bluetooth connection. (For more on the aka.wiiremote Object, see “Music in the Air” on p. 24 of this issue.) Professor Akamatsu has also written a magnificent 1,100-page text called 2061: A Max Odyssey that exhaustively covers Max, MSP, and Jitter. The work is written in Japanese, but all of the beautifully clear examples are posted online for free download at http://max.iamas.ac.jp/2061/?page_id=1100.


Jeffrey Stolet is a composer and professor of music at the University of Oregon. He uses wands, devices, game controllers, and other magical things to tame the sonic and videographic domains.

Get Copyright ClearanceWant to use this article? Click here for options!
© 2009 Penton Media, Inc.



Acceptable Use Policy
blog comments powered by Disqus

Back to Top