From ftm
Jump to: navigation, search
m (Initialisation of Input Values, Lists and Private Variables)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
FTM provides an extended message box, the ''ftm.mess'' and ''ftm.m'' externals.
+
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 [[expressions | FTM expressions]].
 
The external is very similar to the Max message box and allows for the use of [[expressions | FTM expressions]].
While ''ftm.mess'' is a graphical external (currently implemented for Max/MSP), ''ftm.m'' is a platform independent standard FTM externals.
 
  
 
The documentation of the [[expressions | FTM expression syntax]] explains the majority of what one needs to know about the FTM message box.
 
The documentation of the [[expressions | 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.
 
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==
 
== Inlets and Lists==
Line 10: Line 11:
 
=== Input Values: $1 $2 $3 ===
 
=== 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.
+
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.
 
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.
Line 23: Line 24:
 
===  The $* List ===
 
===  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.
+
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'.
+
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.'')
+
(''Note: The experimental list tail operator '$|' is deprecated.'')
  
=== Input List: $*1 $*2 $*3 (from FTM 2.3.1) ===
+
=== 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).
+
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 and $3 one can use them to compose messages and lists in the message box.
+
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.
+
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.
 
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.
Line 45: Line 46:
 
== Initialisation of Input Values, Lists and Private Variables ==
 
== Initialisation of Input Values, Lists and Private Variables ==
  
The input values represented by $1, $2 etc can initialised using an initialisation expression.
+
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".
+
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 $3 etc.), the assignments define and initialise the private variables of the message box.
+
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 @init attribute of ''ftm.m''.
+
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''.
  
[[Category:FAQ]]
+
[[Category:FAQ]] [[Category:Expressions]]
 +
[[Category:ftm.mess]] [[Category:FTM Documentation]]

Latest revision as of 10:48, 6 August 2010

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.