Max

Turn files on and off

This example shows how you can turn on and off audio files with a single toggle –– as in swapping between one and the other. Since 1 is on and 0 is off, you can use a == 0 object to produce the opposite (to turn one thing off when you turn the other on and vice versa). This can be seen in action in the example on the left.

Inactivity Ramp

This example shows how to get the output of a slider object to slowly ramp back down to 0 after 10 seconds of inactivity. While in this example we used the slider object, the same result will hold with other objects.

MIDI to Frequency Math

To better understand the function of a mtof object, it can be recreated with an expr object. There are very slight differences between the output of mtof and expr. The differences are pretty minuscule and should not be a problem in most cases, as they are on the order of a few 1/10,000ths of a Hz.

Pack without Pack

Int, float, and list are all (normally hidden) message selectors that are assumed whenever Max encounters a message that consists of (respectively) a single int, a single float, or a multi-item message that starts with a number. Similarly, typing a single int, a single float, or any multi-item list that starts with a number directly into an object box assumes an object of type int (or i), float (or f), or list (or pack).

Combine items into a single message

Unlike the join and pack objects, which combine their inputs into a single space-separated list, the combine object concatenates its inputs into a single item with no space in between. This example shows how you can use combine to join things with no space. If one of the inputs already contains spaces, and you want to retain those spaces in the output, you would need to convert the input to a symbol first, using the tosymbol object.