<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="vexpr" module="max" category="Math">
	<digest>
		Evaluate a math expression for a list
	</digest>
	<description>
		Performs mathematical calculations using C language-style mathematical operations. Operates on inputs that are lists rather than collections of single values.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Math
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Evaluate Expression, int $i1, float $f1, table $s1
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				int $i2, float $f2, table $s2
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Expression Result
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="expression" optional="0" type="list">
			<digest>
				Mathematical expression
			</digest>
			<description>
				The argument to the <o>vexpr</o> object is a mathematical expression composed of numbers, arithmetic operators such as <o>+</o> or <o>*</o>, comparisons such as <m>&lt;</m> or <m>&gt;</m>, C functions such as <m>min ()</m> or <m>pow ()</m>, names of <o>table</o> objects, and changeable arguments (<m>$i</m>, <m>$f</m>, and <m>$s</m>) for ints, floats, and symbols received in the inlets.
			</description>
		</objarg>
		<objarg name="constant" optional="0" type="number">
			<digest>
				A numeric constant
			</digest>
			<description>
				Numbers can be used as constants in the mathematical expression.
			</description>
		</objarg>
		<objarg name="format" optional="0" type="symbol">
			<digest>
				The data format for an inlets
			</digest>
			<description>
				Changeable arguments that specify data formats associated with an inlet are described using a combination of a data type (<m>$i</m> or <m>$f</m>) and an inlet number (example: <m>$i2</m>). The argument will be replaced by numbers received in the specified inlet.
			</description>
		</objarg>
		<objarg name="table" optional="0" type="symbol">
			<digest>
				An accessible table
			</digest>
			<description>
				Changeable arguments that specify accessing data from a table are described using the argument <m>$s</m> and an inlet number which is replaced by the name of a <o>table</o> to be accessed. The argument should be immediately followed by a number in brackets specifying an address in the <o> <b>table</b> </o>. (Examples: <m>$s2[7]</m> or <m>$s3[$i1]</m>.)
			</description>
		</objarg>
		<objarg name="(other)" optional="0" type="symbol">
			<digest>
				An arithmetic operator
			</digest>
			<description>
				The <o>vexpr</o> object understands the following arithmetic operators: <m>+</m>, <m>-</m>, <m>*</m>, <m>/</m>, %. Other operators are <m>~</m> (one's complement), <m>^</m> (bitwise exclusive or), <m>&amp;</m>, <m>&amp;&amp;</m>, <m>|</m>, <m>||</m>, and <m>!</m> (not).
				<br />
				<br />
				Many C language math functions can be understood by <o>vexpr</o>. A function must be followed immediately by parentheses containing any arguments necessary to the function. If the function requires a comma between arguments, the comma must be preceded by a backslash (<m>\</m>) so that Max will not be confused by it. For example: <m>(pow ($i1\,2) + $f2)</m>.				<br />
				<br />
				C language functions understood by <o>vexpr</o> are: abs, min, max, sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, int (convert to integer), float (convert to float), pow, sqrt, fact (factorial), exp (power of e to x), log10 (log), ln or log (natural log), and random. Additional functions can be added by means of external code resources placed in Max's startup folder.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Repeat the most recent evaluation
			</digest>
			<description>
				Evaluates the expression and sends out the results, using the most recently received lists of numbers.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="number" optional="0" type="int" />
			</arglist>
			<digest>
				Evaluate the expression, cause output
			</digest>
			<description>
				An int or float received in any inlet is treated as a single-item <m>list</m>.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="number" optional="0" type="float" />
			</arglist>
			<digest>
				Evaluate the expression, cause output
			</digest>
			<description>
				An int or float received in any inlet is treated as a single-item <m>list</m>.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="numbers" optional="0" type="list" />
			</arglist>
			<digest>
				Evaluate the expression, cause output
			</digest>
			<description>
				The items of each list are used individually, in order from left to right, to replace the changeable argument in a series of evaluations of the expression. When a list is received in the left inlet, the expression is first evaluated using the first item of each list, then using the second item of each list, etc. The series of results of these evaluations is then sent out as a list.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="scalarmode" get="1" set="1" type="int" size="1">
			<digest>
				Scalar mode enable
			</digest>
			<description>
				The word <m>scalarmode</m>, followed by a non-zero number, sets the scalar mode of operation. In scalar mode, sending a list of length 1 (i.e., a single value) will cause that value to be applied to each element of the other list. The message <m>scalarmode 0</m> disables scalar mode.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="symbol" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Scalar Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="vexpr.png" caption="Perform the same calculation on a whole list of input values" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="expr" />
		<seealso name="round" />
		<seealso name="datachapter05" module="max" type="tutorial" />
	</seealsolist>
	<discussion>
		Like its companion <o>expr</o> object, the <o>vexpr</o> object evaluates expressions that use the &quot;variables&quot; $i1-$i9 (the first to ninth inlets, taken as integers), $f1-$f9 (the inlets as floats) and $s1-$s9 (the inlets as symbols), and/or constants of the same types. The <o>vexpr</o> object also has a scalar mode of operation that lets you use the object's inlet value as a single-item list for evaluation with all items in an input list.
	</discussion>
	<misc name="Output">
		<entry name="list">
			<description>
				When a list is received in the left inlet, <o>vexpr</o> uses the first item of the lists it has received in each of its different inlets, puts those items in place of the changeable arguments in the expression, and evaluates the expression. It then does the same with the second item in each list, and so on until it has used the last item of the shortest list. It then sends out all of the different results as a single list.
			</description>
		</entry>
		<entry name="int">
			<description>
				If the input in one of the inlets was a single number rather than a list, and the expression is evaluated as an integer value, then a single result is sent out as an int rather than a list.
			</description>
		</entry>
		<entry name="float">
			<description>
				If the input in one of the inlets was a single number rather than a list, and the expression is evaluated as a float value, then a single result is sent out as a float rather than a list.
			</description>
		</entry>
	</misc>
</c74object>
