<?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="ftom" module="max" category="Math">
	<digest>
		Convert frequency to a MIDI note number
	</digest>
	<description>
		Converts frequency, given in Hertz, to a MIDI pitch or note number (0-127).
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			math
		</metadata>
		<metadata name="tag">
			MIDI
		</metadata>
		<metadata name="reference">
			TEXT_HERE
		</metadata>
		<metadata name="license">
			TEXT_HERE
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Frequency In
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				MIDI Note Number Out
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="format" optional="1" type="float">
			<digest>
				Float output tag
			</digest>
			<description>
				If a float value is present, the <o>ftom</o> object outputs floating-point values. By default, it outputs int values.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="frequency" optional="0" type="int" />
			</arglist>
			<digest>
				Convert frequency to MIDI note
			</digest>
			<description>
				A frequency value. The corresponding MIDI pitch value (from 0 to 127) is sent out the outlet.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="frequency" optional="0" type="float" />
			</arglist>
			<digest>
				Convert frequency to MIDI note
			</digest>
			<description>
				A frequency value. The corresponding MIDI pitch value (from 0 to 127) is sent out the outlet.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="list of frequencies" optional="0" type="list" />
			</arglist>
			<digest>
				Convert a list of frequencies to MIDI notes
			</digest>
			<description>
				A list of frequency values. Corresponding MIDI pitch values (from 0 to 127) for each list item are sent out the outlet.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="base" get="1" set="1" type="float" size="1">
			<digest>
				Base frequency
			</digest>
			<description>
				Sets the &quot;base frequency&quot; used when converting frequency values (e.g., A = 440.). The default is 440.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Base" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="ftom.png" caption="Find the MIDI key number to play the same pitch as an MSP oscillator" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="expr" />
		<seealso name="mtof" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				The MIDI note value that corresponds to the input frequency. When an input frequency falls between two equal tempered pitches, the value is rounded to the nearest int when <o>ftom</o> is used in its default int mode. When <o>ftom</o> is used in the optional float mode, the fractional part of the float is included. The fractional part could be used to calculate an additional pitch offset for applying MIDI pitch bend.
			</description>
		</entry>
		<entry name="float">
			<description>
				The MIDI note value that corresponds to the input frequency. When an input frequency falls between two equal tempered pitches, the value is rounded to the nearest int when <o>ftom</o> is used in its default int mode. When <o>ftom</o> is used in the optional float mode, the fractional part of the float is included. The fractional part could be used to calculate an additional pitch offset for applying MIDI pitch bend.
			</description>
		</entry>
	</misc>
</c74object>
