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

Go back to the Palette, and this time choose the select Object using the same technique that you used to create the key Object. (You may have to scroll in the menu to find the select Object.) Connect the far left outlet of the key Object to the left inlet of the select Object.

Starting an Argument

The job of the select Object is to watch for incoming values that match its Arguments, and when there is a match, to send out a Bang from one of its four outlets. We'll supply the Arguments next.

Click in the select Object (directly after the word “select”) and type:

FIG. 1: The early stages of a Max patch that plays back Standard MIDI Files under control of a computer keyboard.

FIG. 1: The early stages of a Max patch that plays back Standard MIDI Files under control of a computer keyboard.

113 119 101

Leave a space between the word “select” and the first Argument, and note that there should be a space between the numbers. When the select Object receives a value of 113, a Bang will be sent from the select Object's left outlet. Receiving a 119 will trigger a Bang from the select Object's left-center outlet, and a value of 101 will trigger a Bang from the right-center outlet. Now use the Save As … option under the File menu to save your work.

It Toggles the Mind

Next, choose the toggle Object from the Palette by double-clicking in the white area in the Patcher window to bring up the Palette, single-clicking on the toggle Object in the Palette (fifth Object from left, top row), and clicking again in the white area. When you click on the toggle, it functions like a light switch, alternating between 0 and 1 states. If you send the toggle Object a Bang message, it changes state: off to on or on to off.

Create a metro Object using the technique that you used to create the key Object. The metro Object outputs Bang messages at a specified rate that is defined by the Object's Argument.

Add the Argument 20.83 to the metro Object. Drag the toggle Object so that it is below the select Object, and then drag the metro Object so that it is below the toggle Object. Connect the left outlet of the select Object to the inlet of the toggle Object, and the outlet of the toggle Object to the left inlet of the metro Object. You should now have four Objects connected together (key to select to toggle to metro). For clarity in your design, you should organize your Max patch so that data flows downward.

Seq-ing Solutions

Next, create the seq, the midiflush, and the midiout Objects using the same technique that you used to create the key Object. Drag the midiflush Object to a location under the seq Object, and drag the midiout Object below the midiflush Object. Finally, connect the left outlet of the seq Object to the inlet of the midiflush Object, and the outlet of midiflush to the inlet of midiout.

The seq Object is a MIDI sequencer that plays back Type 0 Standard MIDI Files (SMFs). The midiout Object receives MIDI data from the seq Object. Double-clicking on the midiout Object lets you call up a menu from which you can choose a physical or virtual synthesizer to play the MIDI sequencer data.

Because this patch lets you stop playing an SMF at any point in the file, the likelihood of losing Note Off messages is high. That's why we placed the midiflush Object in between the seq and midiout Objects. The midiflush Object keeps track of all Note On and Note Off messages sent to the midiout Object. When the midiflush Object receives a Bang, it sends Note Off messages for all notes that have received Note On (but not Note Off) messages. Add the button Object (fourth Object from left, top row) to your patch using the same technique that you used to create the toggle Object. The patch should look similar to Fig. 1.

You need a way to load SMFs into the seq Object, and there are several possibilities. If you type in the name of an SMF as an Argument in the seq Object, that MIDI file will be loaded automatically when the Max patch is opened — provided that it is in the same folder as the patch.

Alternatively, by clicking on a message box with a “read” message in it, you can recall the standard Open Document dialog box so that stored MIDI sequences can be loaded into the seq Object. To do this, double-click in the white area in the Patcher window to bring up the Palette, single-click on the message box Object in the Palette (second Object from left, top row), type the word read, click in the white area again, and connect the outlet of the message box Object to the inlet of the seq Object.

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