Message Box

From ftm

FTM provides an extended message box, the ftm.mess external. The external is very similar to the Max message box and allows for the use of FTM expressions.

The documentation of the FTM expression syntax explains the majority of what one needs to know about the FTM message box. This documentation is complemented here with aspects that particularly concern the FTM message box.

The help patch ftm.mess also gives a complete overview of the external's functionalities and FTM expressions in general.


Inlets and Lists

Input Values: $1 $2 $3

As with the Max message box, one can use place holders for the arguments of incoming messages and lists with $-prefixed indices such as '$1', '$2', '$3', etc.

FTM message boxes can have multiple inlets, whereby the indices correspond to the elements of an incoming list as well as to single values sent to the corresponding inlet.

Lists sent to another than the left most inlet will will be treated with an onset corresponding to the inlet. For example, a list of two elements sent to the third inlet will correspond to the arguments $3 and $4.

The number of inlets of the object corresponds to the maximum index used in its expression. For example an FTM message box simply containing $5 will have 5 inlets. In addition, the number of inlets can be set with the ftm.mess inspector.

(Note: In Max/MSP, to make the inlets appear, you have to delete the ftm.mess and do Undo, or copy the object. This is due to limitations in Max that doesn't allow dynamic adding of inlets to an object, only on reinstantiation of an object.)

The $* List

The pseudo variable '$*' represents a list of all elements sent to the message box. The list represented by '$*' has as least as many element as the highest $-prefixed index. For example the expression '{$* $5}' evaluates to a tuple of six elements, five for the '$*' and one for the '$5'.

(Note: The experimental list tail operator '$|' is deprecated.)

Input List: $*1 $*2 $*3

The pseudo variables '$*1', '$*2', '$*3' represent the input of the individual inlets that can be single values or multiple values (lists and messages). Similar to the $1, $2, $3 one can use them to compose messages and lists in the message box. For example the expression '$*1 $*2' represents the concatenation of the inputs of the first and second inlet.

Expressions and operators requiring single arguments such as infix expressions of binary operators (e.g. "($*1 + $*2)") will generate error messages for incoming lists of multiple elements as well as for empty lists.

By default the input lists are initialised to empty lists.

Private Variables: $x $y $z

The message box can define (see below) and use private variables. Private variables are syntactically identical with variables defined by ftm.object, but only visible within the message box.

Initialisation of Input Values, Lists and Private Variables

The input values represented by '$1', '$2' etc can initialised using an initialisation expression. This expression consists of a list and assignments separated by comma such as '11 22 33, x = 0, y = 1'. While the list determines the initialisation values of the input values ('$1', '$2' etc.), the assignments define and initialise the private variables of the message box.

The initialisation expression can be set in the inspector of the Max/MSP ftm.mess module (using the message #init) or as the attribute @init of ftm.m.