A newer version of Max is available. Click here to access the latest version of this document.

itoa

Convert integers to ASCII characters

Description

itoa converts a stream or list of up to 256 integers into a symbol. This can be useful for formatting sysex bytes into a message for display purposes. The leftmost inlet accepts either a list of integers or an individual int, and immediately translates and transmits them/it. It also responds to bang, outputting the currently stored symbol. The rightmost inlet is used to set the output symbol, but unlike the left inlet it does not cause output. The middle inlet appends characters to the currently-stored symbol, either by list or one character at a time.

Arguments

None.

Messages

bang In left inlet: a bang message can be used to trigger the output of the currently stored string of ascii characters as a symbol.
int input [int]
In left inlet: The integer is interpreted as an ASCII character which is stored internally and sent out the outlet as a symbol.

In middle inlet: The integer is interpreted as an ASCII character which is appended to the internally stored character string. No output is triggered.

In right inlet: The integer is interpreted as an ASCII character which is stored internally, replacing the previously stored character string, but not output.
float input [float]
Converted to int.
list input [list]
In left inlet: Each value in list of integers sent to the left inlet is interpreted as an ASCII character and stored internally as an ASCII character string, replacing the previously stored character string, and output as a symbol.

In middle inlet: A list of integers sent to the middle inlet will be converted to ASCII characters and appended to the current internally-stored character string, without causing output.

In right inlet: A list of integers sent to the right inlet will be converted to ASCII characters and stored internally as an ASCII character string, replacing the previously stored character string, without triggering output .
clear input [list]
In left inlet: The clear message is used to clear the contents of the internally-stored string of ascii characters.

Information for box attributes common to all objects

Output

symbol: The ASCII character string converted from the input is sent out as a symbol.

Examples

Collect typed keys into a symbol (output with return key).

See Also

Name Description
atoi Convert ASCII characters to integers
key Report key presses on the computer keyboard
keyup Report key releases on the computer keyboard
message Send any message
regexp Use PERL-style regular expressions to process input
spell Convert input to ASCII codes
sprintf Format a message of words and numbers
Max Basic Tutorial 8: Keyboard and Mouse Input Max Basic Tutorial 8: Keyboard and Mouse Input
Max Comm Tutorial 2: Serial Communication Max Comm Tutorial 2: Serial Communication