Max 5 API Reference
![]() |
Functions | |
void | post (char *fmt,...) |
Print text to the Max window. | |
void | cpost (char *fmt,...) |
Print text to the system console. | |
void | error (char *fmt,...) |
Print an error to the Max window. | |
void | ouchstring (char *s,...) |
Put up an error or advisory alert box on the screen. | |
void | postatom (t_atom *ap) |
Print multiple items in the same line of text in the Max window. | |
void | object_post (t_object *x, char *s,...) |
Print text to the Max window, linked to an instance of your object. | |
void | object_error (t_object *x, char *s,...) |
Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background). | |
void | object_warn (t_object *x, char *s,...) |
Print text to the Max window, linked to an instance of your object, and flagged as a warning (highlighted with a yellow background). | |
void | object_error_obtrusive (t_object *x, char *s,...) |
Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background), and grab the user's attention by displaying a banner in the patcher window. |
void cpost | ( | char * | fmt, | |
... | ||||
) |
Print text to the system console.
On the Mac this post will be visible by launching Console.app in the /Applications/Utilities folder. On Windows this post will be visible by launching the dbgView.exe program, which is a free download as a part of Microsoft's SysInternals.
fmt | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
Referenced by db_query().
void error | ( | char * | fmt, | |
... | ||||
) |
Print an error to the Max window.
Max 5 introduced object_error(), which provides several enhancements to error() where a valid t_object pointer is available.
error() is very similar to post(), thought it offers two additional features:
fmt | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
Referenced by jit_gl_report_error(), and jit_qt_utils_tempfile().
void object_error | ( | t_object * | x, | |
char * | s, | |||
... | ||||
) |
Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background).
Max window rows which are generated using object_post() or object_error() can be double-clicked by the user to have Max assist with locating the object in a patcher. Rows created with object_post() and object_error() will also automatically provide the name of the object's class in the correct column in the Max window.
x | A pointer to your object. | |
s | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
void object_error_obtrusive | ( | t_object * | x, | |
char * | s, | |||
... | ||||
) |
Print text to the Max window, linked to an instance of your object, and flagged as an error (highlighted with a red background), and grab the user's attention by displaying a banner in the patcher window.
This function should be used exceedingly sparingly, with preference given to object_error() when a problem occurs.
x | A pointer to your object. | |
s | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
void object_post | ( | t_object * | x, | |
char * | s, | |||
... | ||||
) |
Print text to the Max window, linked to an instance of your object.
Max window rows which are generated using object_post() or object_error() can be double-clicked by the user to have Max assist with locating the object in a patcher. Rows created with object_post() and object_error() will also automatically provide the name of the object's class in the correct column in the Max window.
x | A pointer to your object. | |
s | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
void myMethod(myObject *x, long someArgument) { object_post((t_object*)x, "This is my argument: %ld", someArgument); }
void object_warn | ( | t_object * | x, | |
char * | s, | |||
... | ||||
) |
Print text to the Max window, linked to an instance of your object, and flagged as a warning (highlighted with a yellow background).
Max window rows which are generated using object_post(), object_error(), or object_warn can be double-clicked by the user to have Max assist with locating the object in a patcher. Rows created with object_post(), object_error(), or object_warn() will also automatically provide the name of the object's class in the correct column in the Max window.
x | A pointer to your object. | |
s | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
void ouchstring | ( | char * | s, | |
... | ||||
) |
Put up an error or advisory alert box on the screen.
Don't use this function. Instead use error(), object_error(), or object_error_obtrusive().
This function performs an sprintf() on fmtstring and items, then puts up an alert box. ouchstring() will queue the message to a lower priority level if it’s called in an interrupt and there is no alert box request already pending.
s | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
void post | ( | char * | fmt, | |
... | ||||
) |
Print text to the Max window.
Max 5 introduced object_post(), which provides several enhancements to post() where a valid t_object pointer is available.
post() is a printf() for the Max window. It even works from non-main threads, queuing up multiple lines of text to be printed when the main thread processing resumes. post() can be quite useful in debugging your external object.
fmt | A C-string containing text and printf-like codes specifying the sizes and formatting of the additional arguments. | |
... | Arguments of any type that correspond to the format codes in fmtString. |
Example:
short whatIsIt; whatIsIt = 999; post ("the variable is %ld",(long)whatIsIt);
the variable is 999
Referenced by jit_gl_report_error().
void postatom | ( | t_atom * | ap | ) |
Print multiple items in the same line of text in the Max window.
This function prints a single t_atom on a line in the Max window without a carriage return afterwards, as post() does. Each t_atom printed is followed by a space character.
ap | The address of a t_atom to print. |