<?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="scale~" module="msp" category="MSP Modifiers">
	<digest>
		Map an input range of signal values to an output range
	</digest>
	<description>
		Use the <o>scale~</o> object to map an input range of signal values to an output range. The ranges can be specified with hi and lo reversed for inverted mapping. If specified, the mapping can also be exponential.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			math
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) value to be scaled
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				(signal/float) low input value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal/float">
			<digest>
				(signal/float) high input value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="3" type="signal/float">
			<digest>
				(signal/float) low output value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="4" type="signal/float">
			<digest>
				(signal/float) high output value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="5" type="signal/float">
			<digest>
				(signal/float) exponential base value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) scaled output value
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="minimum-in-value" optional="0" type="number">
			<digest>
				Minimum input value
			</digest>
			<description>
				The first argument is the minimum input value used in the scaling operation.
			</description>
		</objarg>
		<objarg name="maximum-in-value" optional="0" type="number">
			<digest>
				Maximum input value
			</digest>
			<description>
				The second argument is the maximum input value used in the scaling operation.
			</description>
		</objarg>
		<objarg name="minimum-out-value" optional="0" type="number">
			<digest>
				Minimum output value
			</digest>
			<description>
				The third argument is the minimum output value used in the scaling operation.
			</description>
		</objarg>
		<objarg name="maximum-out-value" optional="0" type="number">
			<digest>
				Maximum output value
			</digest>
			<description>
				The fourth argument is the maximum output value used in the scaling operation.
			</description>
		</objarg>
		<objarg name="scaling-curve" optional="1" type="float">
			<digest>
				Scaling curve
			</digest>
			<description>
				This optional fifth argument specifies the nature of the scaling curve. This argument must be a floating-point number greater than 1., with larger values leading to steeper exponential curves.
				<br />
				<br />
				In
				<attr>
					classic
				</attr>
				mode a typical value for this argument is 1.06 and the number is converted according to the following expression:
				<br />
				(out_high-out_low &gt;= 0) ? (out_low + (out_high-out_low) * ( (out_high - out_low) * exp(-1*(in_high-in_low)*log(power)) * exp(x*log(power)) )) : (-1) * ( out_low + (out_high-out_low) * ( (out_high - out_low) * exp(-1*(in_high-in_low)*log(power)) * exp(x*log(power)) ) )
				<br />
				<br />
				In non-
				<attr>
					classic
				</attr>
				(modern) mode the value for the scaling curve must be higher than 0. and is converted according to the following expression:
				<br />
				<br />
				((x-in_low)/(in_high-in_low) == 0) ? out_low : (((x-in_low)/(in_high-in_low)) &gt; 0) ? (out_low + (out_high-out_low) * ((x-in_low)/(in_high-in_low))^exp) : ( out_low + (out_high-out_low) * -((((-x+in_low)/(in_high-in_low)))^(exp)))
				<br />
				<br />
				Note that prior to Max 6.0.4 the exponent was inverted. Thus, if you gave it an exponent of 2 the object behaved like it had an exponent of 0.5, and if you gave it an exponent of 0.5 it behaved like it had an exponent of 2. Patches from versions prior to 6.0.4 may require updating to work properly.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="introduced" get="1" set="1" type="symbol" size="1" value="7.0.0" />
			</attributelist>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In second inlet: Sets the low input value.
				<br />
				<br />
				In third inlet: Sets the high input value.
				<br />
				<br />
				In fourth inlet: Sets the low output value.
				<br />
				In fifth inlet: Sets the high output value.
				<br />
				In sixth inlet: Sets the scaling curve value as described in the object arguments section.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Scale incoming signal values
			</digest>
			<description>
				In left inlet: The incoming signal values are scaled according to the mapping provided by the arguments or values received in the other inlets.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="classic" get="1" set="1" type="int" size="1">
			<digest>
				Backward compatibility mode
			</digest>
			<description>
				Classic mode uses exponential function that is backward compatible with old IRCAM patchers.
			</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="Value" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Classic Exponential Compatibility Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="scale" />
	</seealsolist>
</c74object>
