
As of Max 4.5 there is also the facility for making use of such additional object information for ordinary Max objects. This is typically referred to as the "obex" data, and it is where Jitter stores things like attribute information, the general purpose "dumpout", the internal Jitter object instance, Matrix Operator resources for inlets/outlets, and other auxiliary object information that is not required in a simple Max object. You also need to define a pointer to point to extra information and resources needed to effectively wrap your Jitter class.

Jitter objects can be wrapped within any of these object types.

For more information on these different Max object types, please consult the Max developer documentation. As is typical, for standard Max objects the first entry of the object struct must be of type t_object for UI objects, it must be of type t_jbox for MSP objects, it must be of type t_pxobject and for MSP UI objects, it must be of type t_pxjbox. The first thing you must do is define your Max class object struct. Below is the minimal Max wrapper class for the minimal Jitter class shown in the last chapter. In situations where this might seem difficult, this can typically be accomplished by making special methods in the Jitter class that are only meant to be called by the Max wrapper, or by using Jitter's object notification mechanism, which we'll discuss in a future chapter. In general it is preferable to design the Jitter class so that it knows nothing about the Max patcher, and that any logic necessary to communicate with the patcher is maintained in the Max wrapper class. The first Max wrapper class we'll demonstrate won't have any extra complication beyond simply containing a basic Jitter class. However, there are occasions which warrant additional intervention to achieve special behavior, such as the use of additional inlets and outlets, integrating with MSP, converting matrix information to and from Max lists, etc. For simple classes, this is largely facilitated by a handful of utility functions that take a Jitter class and create the appropriate wrapper class with default functionality. In order to expose the Jitter object to the Max patcher, a Max "wrapper" class must be defined.
