<?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="borax" module="max" category="Data, Timing">
	<digest>
		Report note-on and note-off information
	</digest>
	<description>
		Acquires and outputs comprehensive information regarding note-on and note-off events. Information includes note counts, event details and time between note events.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Data
		</metadata>
		<metadata name="tag">
			Timing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Pitch (Also Delta Message)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Velocity
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="INLET_TYPE">
			<digest>
				Reset, Turns Off All Sounding Notes
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				Number of Notes Since Last Reset
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Voice Allocation Number
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="OUTLET_TYPE">
			<digest>
				Number of Notes Currently Active
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="OUTLET_TYPE">
			<digest>
				Pitch
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="4" type="OUTLET_TYPE">
			<digest>
				Velocity
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="5" type="OUTLET_TYPE">
			<digest>
				Duration Count
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="6" type="OUTLET_TYPE">
			<digest>
				Duration Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="7" type="OUTLET_TYPE">
			<digest>
				Note Delta Count
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="8" type="OUTLET_TYPE">
			<digest>
				Delta Time
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Clear data and send note-offs
			</digest>
			<description>
				In right inlet: Resets <o>borax</o> by sending note-offs for all notes currently being held, erasing the <o>borax</o> object's memory of all notes received, and setting its counters and its clock to 0.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="pitch" optional="0" type="int" />
			</arglist>
			<digest>
				Store MIDI pitch data
			</digest>
			<description>
				In left inlet: The number is the pitch value of a MIDI note-on message or note-off message (note-on with a velocity of 0). The pitch is paired with the velocity in the middle inlet. <o>borax</o> ignores note-on messages for pitches it is already holding, and ignores note-off messages for pitches that have already been turned off. If the note is not a duplicate, <o>borax</o> sends out the pitch and velocity values, as well as other information.
			</description>
		</method>
		<method name="delta">
			<arglist />
			<digest>
				Output delta-time and delta-count
			</digest>
			<description>
				Causes the delta time (the time elapsed since the last note-on) and the delta count (the number of delta times that have been reported) to be sent out.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="velocity" optional="0" type="int" />
			</arglist>
			<digest>
				Store MIDI velocity data
			</digest>
			<description>
				In middle inlet: The number is stored as the velocity, to be paired with pitch numbers received in the left inlet.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="pitch" optional="0" type="int" />
				<arg name="velocity" optional="0" type="int" />
			</arglist>
			<digest>
				Store MIDI pitch and velocity
			</digest>
			<description>
				The second number is stored as the velocity, and the first number is used as the pitch, of a pitch-velocity pair. If the note is not a duplicate, <o>borax</o> sends out the pitch and velocity values, as well as other information.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="borax.png" caption="borax provides extensive information about the notes passing through" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="midiparse" />
		<seealso name="poly" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: Each note-on received by <o>borax</o> is assigned a unique number, equal to the total count of note-ons received (since the last reset). That number is sent out when the note-on is received, and the same number is sent out when the note is turned off.
				<br />
				<br />
				Out 2nd outlet: Each note is also assigned a unique voice number, equal to the lowest available number. (A voice becomes available when the note assigned to it is turned off.) That number is sent out when the note-on is received, and the same number is sent out when the note is turned off.
				<br />
				<br />
				Out 3rd outlet: The number of notes being held by <o>borax</o> is sent out each time a note-on or a note-off is received.
				<br />
				<br />
				Out 4th outlet: The pitch of the note-on or note-off is sent out.
				<br />
				<br />
				Out 5th outlet: The velocity of the note-on or note-off is sent out.
				<br />
				<br />
				Out 6th outlet: When a note-off is received, the total count of all completed notes (since the last reset) is sent out.
				<br />
				<br />
				Out 7th outlet: When a note-off is received, the duration of that note, in milliseconds, is sent out.
				<br />
				<br />
				Out 8th outlet: Each time a delta time is reported, the total count of delta times is sent out.
				<br />
				<br />
				Out right outlet: When a note-on is received, the delta time is sent out (the time elapsed since the previous note-on, in milliseconds). A <m>delta</m> message in the left inlet causes the same output.
				<br />
				<br />
				<m>bang</m> received in the right inlet causes <o>borax</o> to provide note-offs for any notes it currently holds. These note-offs trigger the same outputs as if they had actually been received.
			</description>
		</entry>
	</misc>
</c74object>
