Troubleshooting in Max

Some Basics for Getting Started with Max Programming

Michael Filimowicz, PhD
Sound & Design
Published in
3 min readJan 10, 2020

--

Details of a Max/MSP patch.
Patcher and Console, w/ print object for troubleshooting

You will always want to keep the Max Console open as you create patches, so you can get a glimpse into how Max is ‘thinking.’ This is important because sometimes it is not ‘thinking’ in the same way that you are thinking! Max does ‘think’ by the way, in its own way, since it is classified as a Turing-complete language. When you want to double check what’s going on within the patch, hook up print objects to the outputs, and name each print object with a unique identifier so you can see its output in the console. One of your most important need-to-know activities is to make sure an object is outputting exactly what you think it should be outputting, when and how you expect it to be.

In the example above, a bang object is connected to a print object with the name ‘bang,’ so with each bang you will see ‘bang•bang’ in the console. The identifier for the integer object is ‘i’ so each output of the integer objects will be prefixed by ‘i•’ just as float objects will be prefixed ‘float•’ not because they are float objects, but because the identifier of its print object is named ‘float.’ Finally, since a toggle object outputs either 1 or 0, that will be the output in the console associated with print ‘toggle.’

The console will also report major errors that occur in your programming. Here’s an example of what happens when you hook up the output of a PLAYR module to a float object. This is known in computer science as an ‘oopsy’ since float objects cannot accept video signal as an input.

Details of a Max/MSP patch.
Yeah, that’s the wrong thing to do, thanks Console!

Some error messages are reported outside the browser, at the top of the patcher as a warning, usually when you’ve done something really crazy.

Details of a Max/MSP patch.
An infinite loop — the kind of thing you want to avoid!

If you produce a stack overflow, which happens when you create infinite loops, you will see this kind of message at the top of the patcher.

Details of a Max/MSP patch.

A lot of debugging is proceeding step by step through the logic of your program, testing the outputs of each operation at each stage to make sure everything is doing what it’s supposed to.

--

--