<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>in</title> <link rel="stylesheet" type="text/css" href="csound.css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /> <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" /> <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" /> <link rel="prev" href="imagesize.html" title="imagesize" /> <link rel="next" href="in32.html" title="in32" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">in</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="imagesize.html">Prev</a> </td> <th width="60%" align="center">Orchestra Opcodes and Operators</th> <td width="20%" align="right"> <a accesskey="n" href="in32.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="in"> <a id="in"></a> <div class="titlepage"></div> <a id="Indexin" class="indexterm"></a> <div class="refnamediv"> <h2> <span class="refentrytitle">in</span> </h2> <p>in — Reads mono audio data from an external device or stream. </p> </div> <div class="refsect1" title="Description"> <a id="idp26805072"></a> <h2>Description</h2> <p> Reads mono audio data from an external device or stream. </p> <div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"> <table border="0" summary="Warning: Warning"> <tr> <td rowspan="2" align="center" valign="top" width="25"> <img alt="[Warning]" src="images/warning.png" /> </td> <th align="left">Warning</th> </tr> <tr> <td align="left" valign="top"> <p> This opcode is designed to be used only with orchestras that have nchnls=1. Doing so with orchestras with nchnls > 1 will cause incorrect audio input. </p> </td> </tr> </table> </div> </div> <div class="refsect1" title="Syntax"> <a id="idp26815976"></a> <h2>Syntax</h2> <pre class="synopsis">ar1 <span class="command"><strong>in</strong></span></pre> </div> <div class="refsect1" title="Performance"> <a id="idp26816968"></a> <h2>Performance</h2> <p> Reads mono audio data from an external device or stream. If the command-line <a class="link" href="CommandFlags.html#FlagsMinusLowerI"><em class="citetitle">-i</em></a> flag is set, sound is read continuously from the audio input stream (e.g. <span class="emphasis"><em>stdin</em></span> or a soundfile) into an internal buffer. Any number of these opcodes can read freely from this buffer. </p> </div> <div class="refsect1" title="Examples"> <a id="idp26818552"></a> <h2>Examples</h2> <p> Here is an example of the in opcode. It uses the file <a class="ulink" href="examples/in.csd" target="_top"><em class="citetitle">in.csd</em></a>. </p> <div class="example"> <a id="idp26819496"></a> <p class="title"> <strong>Example 362. Example of the in opcode.</strong> </p> <div class="example-contents"> <pre class="programlisting"> <span class="csdtag"><CsoundSynthesizer></span> <span class="csdtag"><CsOptions></span> <span class="comment">; Select audio/midi flags here according to platform</span> -odac -idac <span class="comment">;;;realtime audio I/O</span> <span class="comment">; For Non-realtime ouput leave only the line below:</span> <span class="comment">; in.wav -W ;;; for file output any platform</span> <span class="csdtag"></CsOptions></span> <span class="csdtag"><CsInstruments></span> <span class="ohdr">sr</span> <span class="op">=</span> 44100 <span class="ohdr">ksmps</span> <span class="op">=</span> 32 <span class="ohdr">nchnls</span> <span class="op">=</span> 2 <span class="ohdr">0dbfs</span> <span class="op">=</span> 1 <span class="oblock">instr</span> 1 <span class="comment">;1 channel in, two channels out</span> ain1 <span class="opc">in</span> <span class="comment">;grab your mic and sing</span> adel <span class="opc">linseg</span> 0, p3<span class="op">*</span>.5, 0.02, p3<span class="op">*</span>.5, 0 <span class="comment">;max delay time = 20ms</span> aout <span class="opc">flanger</span> ain1, adel, .7 <span class="opc">fout</span> "in_1.wav", 14, aout, aout <span class="comment">;write to stereo file,</span> <span class="opc">outs</span> aout, aout <span class="comment">;16 bits with header</span> <span class="oblock">endin</span> <span class="csdtag"></CsInstruments></span> <span class="csdtag"><CsScore></span> <span class="stamnt">i</span> 1 0 10 <span class="stamnt">e</span> <span class="csdtag"></CsScore></span> <span class="csdtag"></CsoundSynthesizer></span> </pre> </div> </div> <p><br class="example-break" /> </p> </div> <div class="refsect1" title="See Also"> <a id="idp26820456"></a> <h2>See Also</h2> <p> <a class="link" href="diskin.html" title="diskin"><em class="citetitle">diskin</em></a>, <a class="link" href="inch.html" title="inch"><em class="citetitle">inh</em></a>, <a class="link" href="inh.html" title="inh"><em class="citetitle">inh</em></a>, <a class="link" href="ino.html" title="ino"><em class="citetitle">ino</em></a>, <a class="link" href="inq.html" title="inq"><em class="citetitle">inq</em></a>, <a class="link" href="ins.html" title="ins"><em class="citetitle">ins</em></a>, <a class="link" href="soundin.html" title="soundin"><em class="citetitle">soundin</em></a> </p> </div> <div class="refsect1" title="Credits"> <a id="idp26857880"></a> <h2>Credits</h2> <p> </p> <table border="0" summary="Simple list" class="simplelist"> <tr> <td>Authors: Barry L. Vercoe, Matt Ingalls/Mike Berry</td> </tr> <tr> <td>MIT, Mills College</td> </tr> <tr> <td>1993-1997</td> </tr> </table> <p> </p> <p>Already in version 3.30</p> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="imagesize.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="OpcodesTop.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="in32.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">imagesize </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> in32</td> </tr> </table> </div> </body> </html>