The Max Factor
Opcode Max Software
Opcode's Max is an Apple Macintosh based graphical programming environment primarily aimed at manipulating MIDI data. It's also highly addictive as Kendall Wrightson discovered.
Back in 1986 Miller Puckette, a Tennessee mathematician working at the Paris based Institut de Recherche et de Coordination Acoustique/Musique (IRCAM), devised a programming language called Max. Named after the avant garde composer Max V Mathews, Max was originally developed to control IRCAM's unique 4X synthesizer, but it was subsequently ported over to the Apple Macintosh and revamped to utilise the Mac's GUI.
Californian music software specialists Opcode acquired the program in 1989 and since then David Zicarelli has expanded Max into a commercial application capable of creating anything from a simple MIDI data filter to a complete synth editor.
The programs or 'Patches' Max creates are constructed by patching together individual software elements called Objects, 100 of which are built into the program. You can also load in extra 'external' objects. User Interface Objects such as buttons, dials, sliders, pop-up menus and graphic keyboards respond to mouse and keyboard strokes. Others manipulate data or transmit/receive MIDI information from the Mac's serial ports or via MIDI Manager. A Comment Object allows text or instructions to be written into a Patch, as is the case in the simple transposition Patch illustrated in Figure 1.
Though Max is primarily aimed at controlling MIDI data, Max Objects can also address NuBus cards, SCSI devices or indeed anything that can be run on, connected to, or fitted inside a Mac. A good example of this is the CD Object, which can control an Apple CD ROM player and allows playback from any minute:second:block address.
The Max application itself was written in a high level language called C, and Opcode include all the necessary resources for those willing (and able) to write their own Objects. Several external Objects are supplied, and many more should become available from both Opcode and third party developers.
A Max Patch is constructed by selecting Objects from the Object Palette and placing them anywhere within the Patch Window (see Figure 1). The Objects in Figure 1 are all represented by boxes, however others such as keyboards and sliders have more elaborate icons. Whatever their shape, all Objects have little black rectangles which represent 'inlets' and 'outlets'. Clicking on an outlet produces a patch cord which you can connect to any inlet. You are free to move or resize objects, and as they move, all patch cords move too.
Before using a Patch created in this way, you must lock it by clicking the padlock icon at the top of the Patch Window (or by typing Command E). Once locked, the Object palette disappears, Objects are frozen into position, and the Patch becomes active. Should bugs cause any problems, such as stuck notes or loops, MIDI can be instantly disabled by clicking the MIDI socket icon next to the padlock.
The Patch in this example is made up of nine Objects, and its job is to transpose notes upwards by one octave. The NOTEIN Object at the top of the window receives Note On events from the Mac's serial ports (or from another application via MIDI Manager). As a Note On event includes pitch, velocity and channel information, the NOTEIN Object has three outlets. Each outlet is connected to a 'number box' which displays the pitch, velocity and MIDI channel of notes as they are received.
The values in Figure 1 show that the last note played had a pitch of 60 (middle C) and was transmitted on MIDI channel 1. We can also see that the last message received was a Note Off, since the velocity box contains a zero (a Note On event with a velocity of zero turns a note off). The secondary number box connected to the NOTEIN's pitch outlet shows C3, so this is a MIDI note display. Hexadecimal message boxes are also available.
"The Max programming language, originally developed at IRCAM, has since become a commercial application capable of creating anything from a simple MIDI datafile to a complex synth editor."
The '+' box is an 'addition' Object, and its argument — in this case 12 — can be entered directly from the QWERTY keyboard. 60 + 12 = 72, producing C4, as confirmed by the subsequent decimal and MIDI note number boxes. Thus the addition box has transposed the input pitch up by one octave, and by connecting the new pitch and unmodified velocity and channel information to a NOTEOUT Object, the transposed data can be output.
Changing the transposition interval in Figure 1 is as easy as typing a new value into the addition box. Similarly, the transposed note could be set to play on another port and/or MIDI channel by adding arguments to the NOTEOUT box. We could also add more Objects, or even load in another Patch and 'embed' it into our first.
As you can imagine, more sophisticated Patches can look pretty horrendous. Embedding Patches using Send and Receive Objects is the best way of making things clearer, and it's also an effective way of building up a library of frequently used sub-Patches.
In our simple Patch, everything appears to happen instantaneously. However, when constructing more complex Patches it's important to know the order in which Max processes data. Fortunately, there's a simple rule to graphically determine this; right-hand outlet first. For example, the NOTEIN Object sends channel data first, then velocity, then pitch.
The same rule applies to outlets with multiple connections, so in Figure 1 where the pitch outlet of the NOTEIN Object has two connections, the decimal message box (60) receives data before the MIDI note message box (C3). The order can be reversed by simply dragging the the MIDI note message box to the right of the decimal message box. Alternatively, there are several Objects specifically designed to change the order in which data is transmitted, such as SWAP and FSWAP (which reverse the order of two numbers), and others which send lists of data in a specific order such as BUDDY, TRIGGER and BANGBANG (?!).
There are two help facilities available when constructing Max Patches. The first is a simple Assistance Window which displays useful information regarding the currently selected Object or its inlet & outlets.
"Max is an excellent MIDI software development tool and a perfect educational aid, its user interface being simple to understand and fun to use."
The second help facility is accessed by option-clicking any Object, which produces a complete working example of the Object plus explanatory text. Figure 2 shows the Help page for the NOTEOUT Object. Further information is provided by the Max window which displays the memory remaining, the currently loaded external Objects, and any error messages or text generated by the Patch itself.
Max is a Godsend for developers, and a marvellous educational tool, but clearly not a program for the average musician. However, to allow musicians to use Patches created with Max, Opcode intend to release a run-time only version called MaxPlayer in the Autumn. Opcode's hope is that MI manufacturers will bundle MaxPlayer plus a few useful Patches (such as editor/librarians) along with their machines.
Music software houses could also get in on the act by writing Objects to support Max within their applications, to provide more intimate links than those offered by MIDI Manager. This would allow them to offer bolt-on functions aimed at specific end users.
A far larger market for MaxPlayer is provided by the rapidly expanding world of multimedia, where MIDI is likely to become increasingly attractive thanks to the arrival of General MIDI devices. Opcode currently produce a MIDI driver for Apple's HyperCard which allows it to play MIDI files. However, HyperCard could be used as the interactive front end for far more advanced MIDI applications should Opcode decide to write a HyperCard Object for Max. Two other developments will also profoundly affect the future of Max. The first is the launch of Apple's System 7.0 which, with its Inter-Application Communication Architecture (IAC), will dramatically change the way Mac programs interact with each other. The second is Opcode's own recently announced Open MIDI System (OMS), which provides an element of multi-tasking between OMS-compatible software, allowing (say) an editor/librarian to be opened and used while a sequencer is running.
OMS also bypasses MIDI Manager in certain circumstances, so that an application can directly control NuBus cards such as Digidesign's Sample Cell. Future versions of Max will be OMS-compatible (though not the next release, which concentrates on fixing several bugs caused by problems with MIDI Manager version 2.02). This upgrade will also provide some "major free Patches" and may include a DSP Object. Exactly which piece of DSP hardware the Object will support remains a mystery, though Digidesign's Sound Accelerator would seem the most likely choice.
Max is an excellent MIDI software development tool and a perfect educational aid, its user interface being simple to understand and fun to use. If you're involved in either of these areas. Max is more than highly recommended. For the average musician, Max may seem rather esoteric, but if you have even the slightest interest in learning more about MIDI, and can beg, borrow or actually pay for a copy of Max, I guarantee an interesting and highly addictive journey of discovery.
Thanks to Marsha Vdovin at Opcode.
Opcode Max £395 Inc VAT.
MCM, (Contact Details).
Review by Kendall Wrightson
mu:zines is the result of thousands of hours of effort, and will require many thousands more going forward to reach our goals of getting all this content online.
If you value this resource, you can support this project - it really helps!