<?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="mc.sfrecord~" module="msp" category="MC, MSP I/O">
	<digest>
		Record to audio file on disk (multi-channel)
	</digest>
	<description>
		Use the <o>mc.sfrecord~</o> object to record and save multi-channel MSP output as an audio file.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MC
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="multi-channel signal">
			<digest>
				(multi-channel signal) Record Input, 1/0 Record On/Off
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="multi-channel signal">
			<digest>
				(multi-channel signal) Record Input, 1/0 Record On/Off
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) elapsed time (ms)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="number-of-channels" optional="1" type="int">
			<digest>
				Number of channels
			</digest>
			<description>
				Sets the number of channels to record via the one multi-channel inlet. The maximum number of channels is 64, and the default is 1. The audio file created will have the same number of channels as this argument, unless you set a lower number with the <at>nchans</at> attribute. Whether you can actually record the maximum number of channels is dependent on the speed of your processor and hard disk.
			</description>
		</objarg>
		<objarg name="buffer-size" optional="1" type="int">
			<digest>
				Buffer size
			</digest>
			<description>
				An optional second argument sets the buffer size. The defult value is 20160.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="recording-start/stop-flag (0 or nonzero)" optional="0" type="int" />
			</arglist>
			<digest>
				Start/stop recording
			</digest>
			<description>
				If a file has been opened with the <m>open</m> message, a non-zero value begins recording, and <m>0</m> stops recording and closes the file. <o>mc.sfrecord~</o> requires another <m>open</m> message to record again if a <m>0</m> has been sent.
				<br />
				<br />
				Recording may also stop spontaneously if there is an error, such as running out of space on your hard disk.
			</description>
		</method>
		<method name="loop">
			<arglist>
				<arg name="looping-flag (0 or 1)" optional="0" type="float" />
			</arglist>
			<digest>
				Trigger recording with a looping length
			</digest>
			<description>
				If a file has been opened with the <m>open</m> message, the word <m>loop</m>, followed by a number that specifies the loop length in milliseconds, begins recording for the specified amount of time, repeating within the specified area. <m>loop 0</m> turns off recording.
			</description>
		</method>
		<method name="open">
			<arglist>
				<arg name="file-type" optional="1" type="symbol" />
				<arg name="filename" optional="1" type="symbol" />
			</arglist>
			<digest>
				Open a file for recording
			</digest>
			<description>
				In left inlet: Opens a file for recording. By default, the file type is AIFF, but <o>sfrecord~</o> also supports WAVE, OGG, FLAC, and Raw Data. The word <m>open</m>, without an argument, brings up a standard Save As dialog allowing you to choose a filename. The optional symbols <m>aiff</m>, <m>wave</m>, <m>ogg</m>, <m>flac</m>, or <m>raw</m> specify the file format (which can also be set in the Save As dialog with a Format pop-up menu). If <m>open</m> is followed by a second symbol, it creates a file in the current default volume. An existing file with the same name will be overwritten. The format symbol (e.g., <m>aiff</m>) can follow the optional filename argument. If only one argument is given to the <m>open</m> message, which is a filename, the file type is determined from the file extension (e.g., &quot;open test.wav&quot; sets the file type to <m>wave</m>).
			</description>
		</method>
		<method name="print">
			<arglist />
			<digest>
				Output status information about recording progress
			</digest>
			<description>
				Outputs cryptic status information about the progress of the recording.
			</description>
		</method>
		<method name="record">
			<arglist>
				<arg name="recording-time" optional="0" units="ms" type="float" />
			</arglist>
			<digest>
				Record for a specified amount of time
			</digest>
			<description>
				If a file has been opened with the <m>open</m> message, the word <m>record</m>, followed by a time in milliseconds, begins recording for the specified amount of time. The recording can be stopped before it reaches the end by sending <o>mc.sfrecord~</o> a <m>0</m>.
			</description>
		</method>
		<method name="samptype">
			<arglist>
				<arg name="sample-type" optional="0" type="symbol" />
				<arg name="byte-swap-flag" optional="0" type="int" />
			</arglist>
			<digest>
				Specify the sample type to use when recording
			</digest>
			<description>
				The word <m>samptype</m>, followed by a symbol, specifies the sample type to use when recording the audio file. The following types of sample data are supported:
				<br />
				<br />
				<m>int8</m>: 8-bit integer
				<br />
				<m>int16</m>: 16-bit integer
				<br />
				<m>int24</m>: 24-bit integer
				<br />
				<m>int32</m>: 32-bit integer
				<br />
				<m>float32</m>: 32-bit floating-point
				<br />
				<m>float64</m>: 64-bit floating-point
				<br />
				<m>mulaw</m>: 8-bit &quot;mu&quot;-law encoding
				<br />
				<m>alaw</m>: 8-bit a-law encoding
				<br />
				<br />
				The optional second argument, a 0 or 1, specifies whether or not byte-swapping should be used, which is only useful when writing a 'raw' audio file.
				<br />
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Multi-channel signal
			</digest>
			<description>
				<o>mc.sfrecord~</o> accepts a multi-channel signal via the one inlet, which is recorded to an audio file when recording is turned on.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="bitdepth" get="1" set="1" type="int" size="1">
			<digest>
				Bits Per Sample
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Bits Per Sample" />
			</attributelist>
		</attribute>
		<attribute name="dither" get="1" set="1" type="int" size="1">
			<digest>
				Dither PCM Output
			</digest>
			<description>
				Enable triangular dithering (TPDF) when writing PCM (integer) files.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Off">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Dither">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Dither + Noise Shaping">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Dither PCM Output" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="nchans" get="1" set="1" type="int" size="1">
			<digest>
				Sets the number of channels to record
			</digest>
			<description>
				Sets the number of channels to record, from 1-64. The default is 1. In order to record more than 1 channel, the maximum number of channels must first be set via the <ar>number-of-channels</ar> argument. Using the <at>nchans</at> attribute you can then specify any number of channels to record that is equal to or less than the <ar>number-of-channels</ar> argument.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Channels" />
			</attributelist>
		</attribute>
		<attribute name="quantization" get="1" set="1" type="int" size="1">
			<digest>
				PCM Quantization Rule
			</digest>
			<description>
				Select the quantization rule when writing PCM (integer) files.
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="2">
					<enumlist>
						<enum name="Round">
							<digest>
								Round when quantizing to integer values.
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Floor">
							<digest>
								Floor when quantizing to integer values.
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="PCM Quantization Rule" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="resample" get="1" set="1" type="float" size="1">
			<digest>
				Resample Factor
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Resample Factor" />
			</attributelist>
		</attribute>
		<attribute name="sortloop" get="1" set="1" type="int" size="1">
			<digest>
				Save Loop Recording In Order
			</digest>
			<description>
				TEXT_HERE
			</description>
			<attributelist>
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Save Loop Recording In Order" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="sfrecord~.png" caption="Save an audio file containing 'real world' sound and/or sound created in MSP" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="sfplay~" />
		<seealso name="mc.sfplay~" />
		<seealso name="sfrecord~" />
		<seealso name="07_samplingchapter06" module="msp" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				The time, in milliseconds, since recording of the file began. If recording has stopped, the signal value will remain at the length of the last recording until a new recording is started.
			</description>
		</entry>
	</misc>
</c74object>
