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

spell

Convert input to ASCII codes

Description

spell takes two optional arguments. The first is a minimum output size. The second is thge ASCII number of a fill character to put between words and at the end of a word if it is less than the minimum output. The default minimum is 0 (none), and the default fill character is space (32), to use 0 as a fill character, supply a negative number as a second argument.

Arguments

Name Type Opt Description
minimum-output-size int opt The first argument sets the minimum output size. Any input that doesn't "spell" to the minimum length is followed by enough fill characters (the default is the space character, 32 in ASCII) to satisfy the minimum requirement. A second optional argument specifies the fill character to use instead of 32. If you want to use '0' as a fill character, use any negative number as a second argument to spell.

Messages

int input [int]
The ASCII value of each of the digits of the number is sent out the outlet, one digit at a time.
list input [list]
Each int in the list is converted to ASCII as described above, and a space character (32) is sent out between items in the list. Any float or symbol items in the list are ignored.
anything input [list]
If the message begins with a symbol, all int and symbol items in the message are converted to ASCII one character at a time, and a space character (32) is placed between them. Any float items in the list are ignored. If the message begins with a float, both floats and symbols are ignored.
symbol input [symbol]
The ASCII value of each letter, digit, or other character in the symbol is sent out the outlet, one character at a time.

Information for box attributes common to all objects

Outputs

int: The ASCII representation of the input is sent out one character at a time.

Examples

Using the spell object a modem command string or a synthesizer patch name can be translated from human terms into computer terms and sent out the serial port in ASCII representation

See Also

Name Description
atoi Convert ASCII characters to integers
itoa Convert integers to ASCII characters
key Report key presses on the computer keyboard
keyup Report key releases on the computer keyboard
message Send any message
sprintf Format a message of words and numbers